]> xenbits.xensource.com Git - libvirt.git/commit
Allow use of file images for LXC container filesystems
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 4 Aug 2011 09:13:02 +0000 (10:13 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 8 Aug 2011 10:38:09 +0000 (11:38 +0100)
commit5f5c6fde000752f62295da766668775e1bb254f7
tree1c14e0f5368c98d68ebd657d355118a7dc84403f
parent8c7477c4810c2a233ee9f3b8bd702a46178c00cb
Allow use of file images for LXC container filesystems

A previous commit gave the LXC driver the ability to mount
block devices for the container filesystem. Through use of
the loopback device functionality, we can build on this to
support use of plain file images for LXC filesytems.

By setting the LO_FLAGS_AUTOCLEAR flag we can ensure that
the loop device automatically disappears when the container
dies / shuts down

* src/lxc/lxc_container.c: Raise error if we see a file
  based filesystem, since it should have been turned into
  a loopback device already
* src/lxc/lxc_controller.c: Rewrite any filesystems of
  type=file, into type=block, by binding the file image
  to a free loop device
src/lxc/lxc_container.c
src/lxc/lxc_controller.c