]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
When creating container, save configuration if rootfs already exists
authorDavid Ward <david.ward@ll.mit.edu>
Tue, 23 Jun 2015 14:57:38 +0000 (10:57 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 27 Aug 2015 21:50:31 +0000 (17:50 -0400)
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@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c

index 9a407c300934c304036274c207c488436a6aa53c..f962fb9bd6037bdeb76f9d472ee5414e87429823 100644 (file)
@@ -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;
        }