[lxc-devel] [PATCH stable-1.0 6/7] When creating container, save configuration if rootfs already exists

David Ward david.ward at ll.mit.edu
Tue Jun 23 14:57:38 UTC 2015


Commit 6c6892b "fix multithreaded create()" prevented the container
configuration from being saved if the backing store does not need
to be created.

Signed-off-by: David Ward <david.ward at ll.mit.edu>
---
 src/lxc/lxccontainer.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
index 08d788a..acda3de 100644
--- a/src/lxc/lxccontainer.c
+++ b/src/lxc/lxccontainer.c
@@ -1302,6 +1302,8 @@ static bool lxcapi_create(struct lxc_container *c, const char *t,
 	if (lxcapi_is_defined(c) && c->lxc_conf->rootfs.path && !tpath) {
 		/* Rootfs already existed, user just wanted to save the
 		 * loaded configuration */
+		if (!c->save_config(c, NULL))
+			ERROR("failed to save starting configuration for %s\n", c->name);
 		ret = true;
 		goto out;
 	}
-- 
1.7.1



More information about the lxc-devel mailing list