From: Eduardo Habkost <ehabkost@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Eric Blake" <eblake@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Fam Zheng" <famz@redhat.com>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code
Date: Thu, 18 Jan 2018 20:39:47 -0200 [thread overview]
Message-ID: <20180118223947.GK5292@localhost.localdomain> (raw)
In-Reply-To: <800158468.913862.1516313996908.JavaMail.zimbra@redhat.com>
On Thu, Jan 18, 2018 at 05:19:56PM -0500, Paolo Bonzini wrote:
>
> ----- Eduardo Habkost <ehabkost@redhat.com> ha scritto:
> > We can do some effort to document the preferred convention to
> > return success/failure, but I don't think we will be able to
> > convert the existing void/ret/bool functions to a single style
> > (whatever it is) in a reasonable time.
> >
> > That said, IMO returning 0/-1 or true/false is always preferred
> > to returning void, so there's no need to add more local_err
> > boilerplate code.
>
> I strongly prefer having one way to say things, and having return value and Error*
> (with no clear winner for return value) is a disadvantage. [...]
I sympathize with this argument.
...wait, now we're repeating the discussion from the previous
thread:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg461702.html
> [...] Your solution is
> slightly more verbose in that it makes it harder to use && and ||, but I am not
> even sure it is a disadvantage. And the clear advantage that a full conversion
> is mandatory and can be automated...
Well, even if we don't decide about void vs non-void right now,
we would still need something better to live with until a
conversion to non-void is finished. I think I should rebase and
resubmit my ERR_IS_SET series.
--
Eduardo
prev parent reply other threads:[~2018-01-18 22:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-18 2:52 [Qemu-devel] [PATCH] scsi-generic: Simplify error handling code Fam Zheng
2018-01-18 4:34 ` Philippe Mathieu-Daudé
2018-01-18 8:20 ` Paolo Bonzini
2018-01-18 11:21 ` Philippe Mathieu-Daudé
2018-01-18 12:03 ` Paolo Bonzini
2018-01-18 15:55 ` Philippe Mathieu-Daudé
2018-01-18 15:59 ` Paolo Bonzini
2018-01-18 20:34 ` Eric Blake
2018-01-18 21:38 ` Eduardo Habkost
2018-01-18 22:19 ` Paolo Bonzini
2018-01-18 22:39 ` Eduardo Habkost [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=20180118223947.GK5292@localhost.localdomain \
--to=ehabkost@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=f4bug@amsat.org \
--cc=famz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).