qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated clean


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC PATCH v1 0/5] Add error_abort and associated cleanups
Date: Tue, 03 Dec 2013 05:58:52 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

On 12/03/2013 02:44 AM, Markus Armbruster wrote:
> Peter Crosthwaite <address@hidden> writes:
> 
>> Following our discussion RE self asserting API calls, here is a spin of
>> my proposal. This series obsoletes the need for _nofail variants for
>> Error ** accepting APIs. Is also greately reduces the verbosity of calls
>> sites that are currently asserting against errors.
>>
>> Patch 1 is the main event - addition of error_abort. The following
>> patches then cleanup uses of _nofail and assert_no_error().
>>
>> To give it a smoke test, I introduce a (critical) bug into QOM:
> [...]
>>  32 files changed, 100 insertions(+), 143 deletions(-)
> 
> I like it.  Nice diffstat, too.
> 
> There are some _nofail functions left, but none of them can use
> error_abort.
> 

Also, is it worth adding asserts and/or compiler annotations to require
that the Error **err argument of functions be non-NULL, to ensure that
callers are always passing either a valid destination or one of the
special addresses?  But doing so would probably require adding a special
address for error_ignore for callers that intend to discard an error in
cases where the return type of the function lets them know to proceed
with a fallback implementation (that is, cases where ignoring an error
makes sense).

-- 
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]