Re: [PATCH] Santize the reporting of VIR_ERR_INVALID_ERROR

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

 



On 05/28/2012 07:34 AM, Daniel P. Berrange wrote:
> On Fri, May 25, 2012 at 05:35:20PM -0600, Eric Blake wrote:
>> On 05/25/2012 11:44 AM, Daniel P. Berrange wrote:
>>> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
>>>
>>> To ensure consistent error reporting of invalid arguments,
>>> provide a number of predefined helper methods & macros.
>>>
>>>  - An arg which must not be NULL:
>>>
>>>    virCheckNonNullArgReturn(argname, retvalue)
>>>    virCheckNonNullArgGoto(argname, label)
>>
>> ... Looks useful.  I'll review the macros first.
> 
> [snip]
> 
>> ACK with problems fixed.  If you post a v2, post an interdiff (I don't
>> want to scroll through the whole thing again :)
> 
> Here is what I propose to amend before pushing

> +++ b/src/libvirt.c
> @@ -4918,16 +4918,16 @@ virDomainMigratePeer2Peer (virDomainPtr domain,
>      }
>  
>      if (!tempuri->server) {
> -        virReportInvalidArg(tempuri,
> -                            _("server field in tempuri in %s must not be NULL"),
> +        virReportInvalidArg(dconnuri,
> +                            _("unable to parser server from dconnuri in %s"),

s/parser/parse/

>                              __FUNCTION__);
>          virDispatchError(domain->conn);
>          virURIFree(tempuri);
>          return -1;
>      }
>      if (STRPREFIX(tempuri->server, "localhost")) {
> -        virReportInvalidArg(tempuri,
> -                            _("server field in tempuri in %s must not be 'localhost'"),
> +        virReportInvalidArg(dconnuri,
> +                            _("unable to parser server from dconnuri in %s"),

and again.

ACK with those changes.

-- 
Eric Blake   eblake@xxxxxxxxxx    +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]