[libvirt] [PATCHv2 03/13] virbuf: more detailed error reporting

Eric Blake eblake at redhat.com
Thu Oct 20 22:11:49 UTC 2011


On 10/19/2011 04:21 AM, Peter Krempa wrote:
> On 09/29/2011 06:22 PM, Eric Blake wrote:
>> The next patch wants to add some sanity checking, which would
>> be a different error than ENOMEM. Many existing callers blindly
>> report OOM failure if virBuf reports an error, and this will be
>> wrong in the (unlikely) case that they actually had a usage error
>> instead; but since the most common error really is ENOMEM, I'm
>> not going to fix all callers. Meanwhile, new discriminating
>> callers can react differently depending on what failure happened.
>>
>> * src/util/buf.c (virBufferSetError): Add parameter.
>> (virBufferGrow, virBufferVasprintf, virBufferEscapeString)
>> (virBufferEscapeSexpr): Adjust callers.
> After you rebase to current head, this patch omits to modify
> an call instance of virBufferSetError in the newly introduced
> function virBufferEscapeShell resulting into:
>
> util/buf.c: In function 'virBufferEscapeShell':
> util/buf.c:563: error: too few arguments to function 'virBufferSetError'

Yep, I caught that one in my local rebase before reading your mail.

>
> I looked trhough all instances of calling virBufferError and found
> none, that would check against a constant, so after this patch, everything
> should work as it used to. Even if it has now access to a reason of the
> error.
>
> ACK with that fixed

Thanks; pushed.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list