]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/lxccontainer.c
snapshot: enforce keeping same backing store type (v2)
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 1 Jan 2014 19:43:35 +0000 (13:43 -0600)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 2 Jan 2014 18:12:42 +0000 (12:12 -0600)
commit0a83cbbb7592ccb4901a790e7677884d728df6f7
tree4c69fc2aa1b7a42ab94a98fc876819bd94bbfb7e
parenta771fe18d28890cfc545995fb818aa7472744fde
snapshot: enforce keeping same backing store type (v2)

Stéphane noticed that lxc-snapshot of a dir-backed container
created an overlayfs container.  The expectation is that the
user can continue to modify the original container and later make
a new snapshot, but this doesn't work with the existing behavior -
the overlayfs clone will end up with the modified contents.

So add a 'LXC_CLONE_KEEPBDEVTYPE' flag, which c->snapshot()
passes to c->clone().

Also add a LXC_CLONE_MAYBE_SNAPSHOT.  If this is set and a
backing store does not support snapshotting, then proceed with
a copy clone.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/bdev.c
src/lxc/bdev.h
src/lxc/lxccontainer.c
src/lxc/lxccontainer.h