Commit 78852a0c by Jungsub Shin

start: Fix net iface remaining issue

When creating container that has multiple net ifaces fails because of wrong net config, lxc doesn't remove previously created net ifaces. Solve this issue with changing return path in lxc_spawn(). Signed-off-by: Jungsub Shin jungsub_shin@tmax.co.kr
parent 501751d0
...@@ -1662,6 +1662,20 @@ static int lxc_spawn(struct lxc_handler *handler) ...@@ -1662,6 +1662,20 @@ static int lxc_spawn(struct lxc_handler *handler)
return -1; return -1;
} }
if (conf->shmount.path_host) {
if (!conf->shmount.path_cont) {
lxc_sync_fini(handler);
return -1;
}
ret = lxc_setup_shmount(conf);
if (ret < 0) {
ERROR("Failed to setup shared mount point");
lxc_sync_fini(handler);
return -1;
}
}
if (handler->ns_clone_flags & CLONE_NEWNET) { if (handler->ns_clone_flags & CLONE_NEWNET) {
if (!lxc_list_empty(&conf->network)) { if (!lxc_list_empty(&conf->network)) {
...@@ -1683,26 +1697,11 @@ static int lxc_spawn(struct lxc_handler *handler) ...@@ -1683,26 +1697,11 @@ static int lxc_spawn(struct lxc_handler *handler)
ret = lxc_create_network_priv(handler); ret = lxc_create_network_priv(handler);
if (ret < 0) { if (ret < 0) {
ERROR("Failed to create the network"); ERROR("Failed to create the network");
lxc_sync_fini(handler); goto out_delete_net;
return -1;
} }
} }
} }
if (conf->shmount.path_host) {
if (!conf->shmount.path_cont) {
lxc_sync_fini(handler);
return -1;
}
ret = lxc_setup_shmount(conf);
if (ret < 0) {
ERROR("Failed to setup shared mount point");
lxc_sync_fini(handler);
return -1;
}
}
if (!cgroup_init(handler)) { if (!cgroup_init(handler)) {
ERROR("Failed initializing cgroup support"); ERROR("Failed initializing cgroup support");
goto out_delete_net; goto out_delete_net;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment