From 79d066d847b523a254693b9c3c1e5b6af92e2f1c Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Mon, 12 Sep 2016 15:30:10 +0100 Subject: [PATCH 1/5] gitignore: Ignore tags files Running "make tags" generates tags to jump around the code easily. Let's ignore the generated files though. Signed-off-by: Damien Lespiau --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 91b0b3f..f78b6a7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ .#* .git .deps +TAGS +tags init build/hyper_daemon build/hyper-initrd.img From f01a9f408163b6123e4b6bb5169d866efee0b0a2 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Mon, 12 Sep 2016 13:57:31 +0100 Subject: [PATCH 2/5] all: Fix the directroy typo That typo crept in a few places. Signed-off-by: Damien Lespiau --- src/container.c | 10 +++++----- src/init.c | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/container.c b/src/container.c index fa28e6d..f8c20f5 100644 --- a/src/container.c +++ b/src/container.c @@ -32,7 +32,7 @@ static int container_populate_volume(char *src, char *dest) if (stat(dest, &st) == 0) { if (!S_ISDIR(st.st_mode)) { - fprintf(stderr, "the _data in volume %s is not directroy\n", dest); + fprintf(stderr, "the _data in volume %s is not directory\n", dest); return -1; } @@ -45,7 +45,7 @@ static int container_populate_volume(char *src, char *dest) } if (hyper_mkdir(dest, 0777) < 0) { - fprintf(stderr, "fail to create directroy %s\n", dest); + fprintf(stderr, "fail to create directory %s\n", dest); return -1; } @@ -173,7 +173,7 @@ static int container_setup_volume(struct hyper_container *container) sprintf(volume, "/%s/_data/%s", path, filevolume); /* 0777 so that any user can read/write the new file volume */ if (chmod(volume, 0777) < 0) { - fprintf(stderr, "fail to chmod directroy %s\n", volume); + fprintf(stderr, "fail to chmod directory %s\n", volume); return -1; } } @@ -553,7 +553,7 @@ static int hyper_setup_container_rootfs(void *data) sprintf(root, "/tmp/hyper/%s/root/", container->id); if (hyper_mkdir(root, 0755) < 0) { - perror("make root directroy failed"); + perror("make root directory failed"); goto fail; } @@ -666,7 +666,7 @@ static int hyper_setup_pty(struct hyper_container *c) sprintf(root, "/tmp/hyper/%s/devpts/", c->id); if (hyper_mkdir(root, 0755) < 0) { - perror("make container pts directroy failed"); + perror("make container pts directory failed"); return -1; } diff --git a/src/init.c b/src/init.c index 7b24377..9c98b37 100644 --- a/src/init.c +++ b/src/init.c @@ -421,7 +421,7 @@ static int hyper_setup_shared(struct hyper_pod *pod) struct vbsf_mount_info_new mntinf; if (pod->share_tag == NULL) { - fprintf(stdout, "no shared directroy\n"); + fprintf(stdout, "no shared directory\n"); return 0; } @@ -452,7 +452,7 @@ static int hyper_setup_shared(struct hyper_pod *pod) static int hyper_setup_shared(struct hyper_pod *pod) { if (pod->share_tag == NULL) { - fprintf(stdout, "no shared directroy\n"); + fprintf(stdout, "no shared directory\n"); return 0; } @@ -474,7 +474,7 @@ static int hyper_setup_shared(struct hyper_pod *pod) static int hyper_setup_pod(struct hyper_pod *pod) { - /* create tmp proc directroy */ + /* create tmp proc directory */ if (hyper_mkdir("/tmp/hyper/proc", 0755) < 0) { perror("create tmp proc failed"); return -1; @@ -897,7 +897,7 @@ static void hyper_cleanup_hostname(struct hyper_pod *pod) static void hyper_cleanup_shared(struct hyper_pod *pod) { if (pod->share_tag == NULL) { - fprintf(stdout, "no shared directroy\n"); + fprintf(stdout, "no shared directory\n"); return; } @@ -1251,7 +1251,7 @@ int main(int argc, char *argv[]) hyper_mkdir("/sys", 0755) < 0 || hyper_mkdir("/sbin", 0755) < 0 || hyper_mkdir("/proc", 0755) < 0) { - perror("create basic directroy failed"); + perror("create basic directory failed"); return -1; } @@ -1273,7 +1273,7 @@ int main(int argc, char *argv[]) } if (hyper_mkdir("/dev/pts", 0755) < 0) { - perror("create basic directroy failed"); + perror("create basic directory failed"); return -1; } From 6f73ec97e39499692eedbc8c37b7053167059c94 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Mon, 12 Sep 2016 14:22:50 +0100 Subject: [PATCH 3/5] init: Fix copy/paste typo in mount error string The error message should mention devtmpfs and not sysfs in that case. Signed-off-by: Damien Lespiau --- src/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init.c b/src/init.c index 9c98b37..56bd8fd 100644 --- a/src/init.c +++ b/src/init.c @@ -1268,7 +1268,7 @@ int main(int argc, char *argv[]) } if (mount("dev", "/dev", "devtmpfs", MS_NOSUID, NULL) == -1) { - perror("mount sysfs failed"); + perror("mount devtmpfs failed"); return -1; } From ffd28a721c676edcf490bf85e48eaeae4ce1a0d1 Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Mon, 12 Sep 2016 14:47:37 +0100 Subject: [PATCH 4/5] container: Fix error message in hyper_rescan_scsi() The message needs to mention scanning scsi, not virtio-ports. Signed-off-by: Damien Lespiau --- src/container.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/container.c b/src/container.c index f8c20f5..b950e8c 100644 --- a/src/container.c +++ b/src/container.c @@ -471,7 +471,7 @@ static int hyper_rescan_scsi(void) num = scandir("/sys/class/scsi_host/", &list, NULL, NULL); if (num < 0) { - perror("scan /sys/calss/virtio-ports/ failed"); + perror("scan /sys/class/scsi_host/ failed"); return -1; } From 6824ff3d2ef53725f49c2dc54757c3e1f458ad2b Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Mon, 12 Sep 2016 14:56:41 +0100 Subject: [PATCH 5/5] util: Fix 'calss' type in the virtio-ports scanning code Signed-off-by: Damien Lespiau --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index d28b817..df04e3d 100644 --- a/src/util.c +++ b/src/util.c @@ -512,7 +512,7 @@ int hyper_open_channel(char *channel, int mode) num = scandir("/sys/class/virtio-ports/", &list, NULL, NULL); if (num < 0) { - perror("scan /sys/calss/virtio-ports/ failed"); + perror("scan /sys/class/virtio-ports/ failed"); return -1; }