]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
set lxc.rootfs.backend on copy/snapshot as well 945/head
authorChristian Brauner <christian.brauner@mailbox.org>
Tue, 5 Apr 2016 18:43:02 +0000 (20:43 +0200)
committerChristian Brauner <christian.brauner@mailbox.org>
Tue, 5 Apr 2016 18:43:02 +0000 (20:43 +0200)
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
src/lxc/lxccontainer.c

index 29cbd330c3d748dc4c82d0c9a81188b5974ce09a..a6003a6617bc01fb4370aafd29d771f865a471a2 100644 (file)
@@ -2845,6 +2845,8 @@ static int copy_storage(struct lxc_container *c0, struct lxc_container *c,
        }
        free(c->lxc_conf->rootfs.path);
        c->lxc_conf->rootfs.path = strdup(bdev->src);
+       free(c->lxc_conf->rootfs.bdev_type);
+       c->lxc_conf->rootfs.bdev_type = strdup(bdev->type);
        bdev_put(bdev);
        if (!c->lxc_conf->rootfs.path) {
                ERROR("Out of memory while setting storage path");
@@ -2856,6 +2858,11 @@ static int copy_storage(struct lxc_container *c0, struct lxc_container *c,
                ERROR("Error saving new rootfs to cloned config");
                return -1;
        }
+       clear_unexp_config_line(c->lxc_conf, "lxc.rootfs.backend", false);
+       if (!do_append_unexp_config_line(c->lxc_conf, "lxc.rootfs.backend", c->lxc_conf->rootfs.bdev_type)) {
+               ERROR("Error saving new rootfs to cloned config");
+               return -1;
+       }
        if (flags & LXC_CLONE_SNAPSHOT)
                copy_rdepends(c, c0);
        if (need_rdep) {