qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] error reporting in functions


From: Eric Blake
Subject: Re: [Qemu-devel] error reporting in functions
Date: Wed, 12 Oct 2016 15:55:45 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

On 10/12/2016 10:47 AM, Vladimir Sementsov-Ogievskiy wrote:
> HI all!
> 
> My questions is: what are general recommendations in Qemu for return
> code, if we have Error **errp?
> What should I prefer: errp, duplicated by int return code, or void
> functions with errp?

Markus has already had several threads commenting on this very topic in
the past.  A lot of code uses void return, but some newer code is using
an int return for simplifying the call-sites (and glib prefers the int
rather than void return, as well).  Markus was playing with a Coccinelle
script to see how painful a bulk-conversion of the code base would be,
but it is probably stalled behind more pressing work at the moment.

> 
> void + errp seems good, just to not duplicate things. But it has a
> disadvantage of necessity of "local_err" and "error_propagate" in caller
> function, if its behaviour depends on callee function success...
> 

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