From 3fbba94a0fc5553495b301c8caac41a0243a64af Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Wed, 27 Apr 2016 20:22:42 +0800 Subject: [PATCH 1/2] ignore error of setup modules Signed-off-by: Lai Jiangshan --- src/container.c | 9 ++++----- src/util.c | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/container.c b/src/container.c index 52eafad9..b1060c49 100644 --- a/src/container.c +++ b/src/container.c @@ -190,7 +190,8 @@ static int container_setup_modules(struct hyper_container *container) return 0; } } else if (errno == ENOENT) { - hyper_mkdir(dst); + if (hyper_mkdir(dst) < 0) + return -1; } else { return -1; } @@ -572,10 +573,8 @@ static int hyper_container_init(void *data) goto fail; } - if (container_setup_modules(container) < 0) { - fprintf(stderr, "container sets up modules failed\n"); - goto fail; - } + // ignore error of setup modules + container_setup_modules(container); if (container_setup_volume(container) < 0) { fprintf(stderr, "container sets up voulme failed\n"); diff --git a/src/util.c b/src/util.c index 7a2498dc..e30e9138 100644 --- a/src/util.c +++ b/src/util.c @@ -181,8 +181,10 @@ int hyper_mkdir(char *hyper_path) } fprintf(stdout, "create directory %s\n", path); - if (mkdir(path, 0755) < 0 && errno != EEXIST) + if (mkdir(path, 0755) < 0 && errno != EEXIST) { + perror("failed to create directory"); return -1; + } return 0; } From ab1c293818ad9199644bb3e1ae3ae1683fc5ba84 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Wed, 27 Apr 2016 21:45:59 +0800 Subject: [PATCH 2/2] extend the stack for hyper_container_init() container_setup_modules() needs a large stack Signed-off-by: Lai Jiangshan --- src/container.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/container.c b/src/container.c index b1060c49..c0e7f54b 100644 --- a/src/container.c +++ b/src/container.c @@ -652,7 +652,7 @@ static int hyper_setup_pty(struct hyper_container *c) int hyper_start_container(struct hyper_container *container, int utsns, int ipcns, struct hyper_pod *pod) { - int stacksize = getpagesize() * 4; + int stacksize = getpagesize() * 42; struct hyper_container_arg arg = { .c = container, .pod = pod,