[libvirt] [PATCH] Santize the reporting of VIR_ERR_INVALID_ERROR

Eric Blake eblake at redhat.com
Mon May 28 15:17:01 UTC 2012


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 at redhat.com>
>>>
>>> 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 at 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: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120528/538263ba/attachment-0001.sig>


More information about the libvir-list mailing list