qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 0/9] Miscellaneous error reporting improvements


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 0/9] Miscellaneous error reporting improvements
Date: Fri, 29 May 2015 08:00:28 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 05/29/2015 05:22 AM, Markus Armbruster wrote:
> Kevin Wolf <address@hidden> writes:
> 
>> Am 28.05.2015 um 14:21 hat Markus Armbruster geschrieben:
>>> Touches vl.c, which gives me pretext to ask Paolo: would you be
>>> willing to take this through your tree?  Or should I take it through
>>> mine?
>>
>> After this series we have an ugly half-converted state where
>> qemu_opts_foreach() has both a return code and an Error object,
>> and it's not generally true that an error is set for a failing
>> return code.
>>
>> The most confusing part about this is that you have &error_abort almost
>> everywhere, but the function doesn't actually abort on error, but rather
>> returns a negative error code and leaves errp alone.
> 
> True.  The function contract spells it out, which hopefully reduces the
> confusion somewhat.

Except that you don't enforce the contract; I suggested adding
assert(!*errp) at the right place in the two conversions.

> 
> Would you find NULL less confusing than &error_abort?

NULL says to ignore errors, &error_abort says to diagnose errors as
programming bugs.  If we know we aren't going to have an error, I prefer
diagnosing coding bugs.


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]