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,
}
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) {
......
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