From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] error reporting in functions
Date: Thu, 13 Oct 2016 08:39:42 +0200 [thread overview]
Message-ID: <87r37kg3bl.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <14e53dd6-3ce9-70a2-21f8-6110a1bc970d@redhat.com> (Eric Blake's message of "Wed, 12 Oct 2016 15:55:45 -0500")
Eric Blake <eblake@redhat.com> 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: <87a8ekfenp.fsf@dusky.pond.sub.org>
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...
prev parent reply other threads:[~2016-10-13 6:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-12 15:47 [Qemu-devel] error reporting in functions Vladimir Sementsov-Ogievskiy
2016-10-12 20:55 ` Eric Blake
2016-10-13 6:39 ` Markus Armbruster [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r37kg3bl.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.