From: Serge Hallyn Date: Wed, 30 Oct 2013 17:47:38 +0000 (-0500) Subject: api_create: undo unneeded chunk in previous commit X-Git-Tag: lxc-1.0.0.alpha3~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0590e82c10ea3b75f0c4d462de3f5bb344da37c5;p=thirdparty%2Flxc.git api_create: undo unneeded chunk in previous commit lxc_conf exists after api_save_config Signed-off-by: Serge Hallyn --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 680b536d2..1254dc040 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1128,24 +1128,22 @@ static bool lxcapi_create(struct lxc_container *c, const char *t, goto out; } - if (c->lxc_conf) { - /* - * either template or rootfs.path should be set. - * if both template and rootfs.path are set, template is setup as rootfs.path. - * container is already created if we have a config and rootfs.path is accessible - */ - if (!c->lxc_conf->rootfs.path && !tpath) - /* no template passed in and rootfs does not exist: error */ - goto out; - if (c->lxc_conf->rootfs.path && access(c->lxc_conf->rootfs.path, F_OK) != 0) - /* rootfs passed into configuration, but does not exist: error */ - goto out; - if (lxcapi_is_defined(c) && c->lxc_conf->rootfs.path && !tpath) { - /* Rootfs already existed, user just wanted to save the - * loaded configuration */ - ret = true; - goto out; - } + /* + * either template or rootfs.path should be set. + * if both template and rootfs.path are set, template is setup as rootfs.path. + * container is already created if we have a config and rootfs.path is accessible + */ + if (!c->lxc_conf->rootfs.path && !tpath) + /* no template passed in and rootfs does not exist: error */ + goto out; + if (c->lxc_conf->rootfs.path && access(c->lxc_conf->rootfs.path, F_OK) != 0) + /* rootfs passed into configuration, but does not exist: error */ + goto out; + if (lxcapi_is_defined(c) && c->lxc_conf->rootfs.path && !tpath) { + /* Rootfs already existed, user just wanted to save the + * loaded configuration */ + ret = true; + goto out; } /* Mark that this container is being created */