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

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

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]