mirror of
https://github.com/clearlinux/hyperstart.git
synced 2026-09-03 12:11:34 +00:00
move hyper_start_containers() to hyper_start_pod()
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
+8
-7
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user