]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/utils.h
implement backend drivers and container clone API (v3)
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 16 Apr 2013 13:07:05 +0000 (08:07 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Tue, 30 Apr 2013 14:12:42 +0000 (09:12 -0500)
commit9be53773792fc9e8bd173edc3b7ac7e144875387
treee462f278444ade4db4a951f8e0a7d1686346bcf3
parentab1bf971d2db43777cbf3892fb887bf71ce7d155
implement backend drivers and container clone API (v3)

1. commonize waitpid users to use a single helper.  We frequently want
to run something in a clean namespace, or fork off a script.  This
lets us keep the function doing fork:(1)exec(2)waitpid simpler.

2. start a blockdev backend implementation.  This will be used for
mounting, copying, and snapshotting container filesystems.

3. implement btrfs, lvm, directory, and overlayfs backends.

4. For overlayfs, support a new lxc.rootfs format of
'bdevtype:<extra>'.  This means you can now use overlayfs-based
containers without using lxc-start-ephemeral, by using
lxc.rootfs = overlayfs:/readonly-dir:writeable-dir

5. add a set of simple clone testcases

6. Write a new lxc_clone.c based on api clone.

Still to do (there's more, but off top of my head):

1. support zfs, aufs
2. have clone handle other mount entries (right now it only clones
the rootfs)
3. python, lua, and go bindings (not me :)
4. lxc-destroy: if lvm backing store, check for snapshots of it.
   (what about directories which have overlayfs clones?)

Changes since v2:
Initialize random generator when picking new macaddr (reported
  by caglar@10ur.org)
Fix wrong use of bitmask flags
On copy-clone of btrfs, create a subvolume
lxc_clone.c: respect the command line usage of the old script
lxc-clone(1): update documentation
Refuse to try changing backing stores expect to overlayfs, as
  it is not implemented (yet) anyway.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Conflicts:
src/lxc/utils.h
15 files changed:
configure.ac
doc/lxc-clone.sgml.in
src/lxc/Makefile.am
src/lxc/bdev.c [new file with mode: 0644]
src/lxc/bdev.h [new file with mode: 0644]
src/lxc/conf.c
src/lxc/lxc-clone-sh.in [new file with mode: 0755]
src/lxc/lxc-clone.in [deleted file]
src/lxc/lxc_clone.c [new file with mode: 0644]
src/lxc/lxccontainer.c
src/lxc/lxccontainer.h
src/lxc/utils.c
src/lxc/utils.h
src/tests/Makefile.am
src/tests/clonetest.c [new file with mode: 0644]