]> 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:24 +0000 (10:57 -0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 27 Aug 2015 21:37:15 +0000 (16:37 -0500)
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 ce2ec8aea6dcf1d7eee2befa3289bc9e04523519..932d658ea87911bbf1ca81adcb8c47321e34ec0f 100644 (file)
@@ -1383,6 +1383,8 @@ static bool do_lxcapi_create(struct lxc_container *c, const char *t,
        if (do_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;
        }