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

Eric Blake eblake at redhat.com
Tue Jul 8 16:00:48 UTC 2014


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

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


More information about the libvir-list mailing list