]> git.ipfire.org Git - thirdparty/lxc.git/commit
clone_paths: use 'rootfs' for destination directory
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 29 Jan 2015 16:09:45 +0000 (16:09 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 29 Jan 2015 16:55:10 +0000 (17:55 +0100)
commit730e3f9e2ffcc7e34c4236a37215f6be8c8cc7f3
tree4af05ebe2080275f200f97216209d855f4689e48
parente8bd4e430bf76ed4737563476ce685b2425412ec
clone_paths: use 'rootfs' for destination directory

We were trying to be smart and use whatever the last part of
the container's rootfs path was.  However for block devices
that doesn't make much sense.  I.e. if lxc.rootfs = /dev/md-1,
chances are that /var/lib/lxc/c1/md-1 does not exist.

So always use the $lxcpath/$lxcname/rootfs, and if it does
not exist, try to create it.

With this, 'lxc-clone -s -o c1 -n c2' where c1 has an lvm backend
is fixed.  See https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1414771

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/bdev.c