move hyper_start_containers() to hyper_start_pod()

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
Lai Jiangshan
2016-07-06 15:55:07 +08:00
parent cd9a8f4306
commit 98b8211ddc
+8 -7
View File
@@ -414,7 +414,7 @@ int hyper_start_containers(struct hyper_pod *pod)
return 0;
}
static int hyper_setup_container(struct hyper_pod *pod)
static int hyper_setup_pod_init(struct hyper_pod *pod)
{
int stacksize = getpagesize() * 4;
int flags = CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWIPC |
@@ -461,11 +461,6 @@ static int hyper_setup_container(struct hyper_pod *pod)
goto out;
}
if (hyper_start_containers(pod) < 0) {
fprintf(stderr, "start containers failed\n");
goto out;
}
ret = 0;
out:
close(arg.ctl_pipe[1]);
@@ -587,7 +582,7 @@ static int hyper_setup_pod(struct hyper_pod *pod)
return -1;
}
if (hyper_setup_container(pod) < 0) {
if (hyper_setup_pod_init(pod) < 0) {
fprintf(stderr, "start container failed\n");
return -1;
}
@@ -641,6 +636,12 @@ static int hyper_start_pod(char *json, int length)
return -1;
}
if (hyper_start_containers(pod) < 0) {
fprintf(stderr, "start containers failed\n");
hyper_destroy_pod(pod);
return -1;
}
return 0;
}