]> git.proxmox.com Git - mirror_lxc.git/commitdiff
clone: make sure to update the rootfs path in unexpanded conf
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 18 Jun 2014 23:01:50 +0000 (18:01 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 18 Jun 2014 23:02:35 +0000 (18:02 -0500)
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxccontainer.c

index 20bf60092ab0b4b77df79c0c029f50f4d63d3dcb..3d1cf34582f20c1a45c707bd167164b19bf094de 100644 (file)
@@ -2546,6 +2546,12 @@ static int copy_storage(struct lxc_container *c0, struct lxc_container *c,
                ERROR("Out of memory while setting storage path");
                return -1;
        }
+       free(c->lxc_unexp_conf->rootfs.path);
+       c->lxc_unexp_conf->rootfs.path = strdup(c->lxc_conf->rootfs.path);
+       if (!c->lxc_unexp_conf->rootfs.path) {
+               ERROR("Out of memory while setting storage path");
+               return -1;
+       }
        if (flags & LXC_CLONE_SNAPSHOT)
                copy_rdepends(c, c0);
        if (need_rdep) {