[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



On 04/22/2013 08:06 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange 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 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

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]