[libvirt] [PATCH] Allow use of block devices for guest filesystem

Eric Blake eblake at redhat.com
Thu Aug 4 17:36:38 UTC 2011


On 08/04/2011 09:04 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange"<berrange at redhat.com>
>
> Currently the LXC driver can only populate filesystems from
> host filesystems, using bind mounts. This patch allows host
> block devices to be mounted. It autodetects the filesystem
> format at mount time, and adds the block device to the cgroups
> ACL. Example usage is
>
>      <filesystem type='block' accessmode='passthrough'>
>        <source dev='/dev/sda1'/>
>        <target dir='/home'/>
>      </filesystem>
>
> * src/lxc/lxc_container.c: Mount block device filesystems
> * src/lxc/lxc_controller.c: Add block device filesystems
>    to cgroups ACL
> ---
>   src/lxc/lxc_container.c  |  179 +++++++++++++++++++++++++++++++++++++++++++++-
>   src/lxc/lxc_controller.c |   17 +++++
>   2 files changed, 195 insertions(+), 1 deletions(-)

> +
> +/*
> + * This functions attempts todo automatic detection of filesystem

s/todo/to do/

> + * type following the same rules as the util-linux 'mount' binary.
> + *
> + * The main difference is that we don't (currently) try to use
> + * libblkid to detect the format first. We go straight to using
> + * /etc/filesystems, and then /proc/filesystems
> + */
> +static int lxcContainerMountFSBlockAuto(virDomainFSDefPtr fs,
> +                                        int flags,
> +                                        const char *src,
> +                                        const char *srcprefix)
> +{

>
> -    ret = 0;
> +    /* We've got to the end of /etc/filesystems and saw
> +     * a '*', so we mhust try /proc/filesystems next

s/mhust/must/

ACK with those typo fixes.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list