[libvirt] [PATCH v2 5/5] Support NBD backed disks/filesystems in LXC driver

Eric Blake eblake at redhat.com
Tue Apr 30 23:59:13 UTC 2013


On 04/22/2013 08:06 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> The LXC driver can already configure <disk> or <filesystem>
> devices to use the loop device. This extends it to also allow
> for use of the NBD device, to support non-raw formats.

Cool!  But here we are at the end of the series, with no testsuite
additions?

> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  src/lxc/lxc_controller.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 78 insertions(+), 2 deletions(-)
> 

> +static int virLXCControllerSetupNBDDeviceFS(virDomainFSDefPtr fs)
> +{
> +    char *dev;
> +
> +    if (fs->format <= VIR_STORAGE_FILE_NONE) {
> +        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                       _("An explicit disk format must be specified"));
> +        return -1;
> +    }
> +
> +    if (virFileNBDDeviceAssociate(fs->src,
> +                                  fs->format,
> +                                  !!fs->readonly,

fs->readonly is already a boolean, thanks to Osier's recent cleanups.
No need for the !!


> +static int virLXCControllerSetupNBDDeviceDisk(virDomainDiskDefPtr disk)
> +{
> +    char *dev;
> +
> +    if (disk->format <= VIR_STORAGE_FILE_NONE) {
> +        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                       _("An explicit disk format must be specified"));
> +        return -1;
> +    }
> +
> +    if (virFileNBDDeviceAssociate(disk->src,
> +                                  disk->format,
> +                                  !!disk->readonly,

Likewise for disk->readonly being boolean.

ACK with nits fixed.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130430/58f55239/attachment-0001.sig>


More information about the libvir-list mailing list