Re: [PATCH 3/3] lib: Check conditions for VIR_DOMAIN_BLOCK_REBASE_RELATIVE right away

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

 



On 07/08/2014 09:53 AM, Eric Blake wrote:

>> +    if (flags & VIR_DOMAIN_BLOCK_REBASE_RELATIVE && !base) {
>> +        virReportInvalidArg(base, "%s",
>> +                            _("flag VIR_DOMAIN_BLOCK_REBASE_RELATIVE is valid "
>> +                              "only with non-null base"));
>> +        goto error;
>> +    }
> 
> I'd shorten this to:
> 
> if (flags & VIR_DOMAIN_BLOCK_REBASE_RELATIVE)
>     virCheckNonNullArgGoto(params, error);

too much copy-and-paste; I meant:
    virCheckNonNullArgGoto(base, error);

> 
> for consistency with other validity checks in this file.
> 
> I'd also like to see this restriction mentioned in the libvirt.c docs.


-- 
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]