}
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");
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) {