Commit 8869eb5f by Christian Brauner

set lxc.rootfs.backend on copy/snapshot as well

parent 39460be8
...@@ -2845,6 +2845,8 @@ static int copy_storage(struct lxc_container *c0, struct lxc_container *c, ...@@ -2845,6 +2845,8 @@ static int copy_storage(struct lxc_container *c0, struct lxc_container *c,
} }
free(c->lxc_conf->rootfs.path); free(c->lxc_conf->rootfs.path);
c->lxc_conf->rootfs.path = strdup(bdev->src); 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); bdev_put(bdev);
if (!c->lxc_conf->rootfs.path) { if (!c->lxc_conf->rootfs.path) {
ERROR("Out of memory while setting storage 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, ...@@ -2856,6 +2858,11 @@ static int copy_storage(struct lxc_container *c0, struct lxc_container *c,
ERROR("Error saving new rootfs to cloned config"); ERROR("Error saving new rootfs to cloned config");
return -1; 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) if (flags & LXC_CLONE_SNAPSHOT)
copy_rdepends(c, c0); copy_rdepends(c, c0);
if (need_rdep) { if (need_rdep) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment