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: Markus Armbruster
Subject: Re: [Qemu-devel] error reporting in functions
Date: Thu, 13 Oct 2016 08:39:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Eric Blake <address@hidden> writes:

> 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

A recent one:
Message-ID: <address@hidden>
http://lists.gnu.org/archive/html/qemu-devel/2016-10/msg00435.html

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

Correct.

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



reply via email to

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