From: Paolo Bonzini <pbonzini@redhat.com>
To: Eduardo Habkost <ehabkost@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 17:19:56 -0500 (EST) [thread overview]
Message-ID: <800158468.913862.1516313996908.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20180118213805.GI5292@localhost.localdomain>
----- 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. 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...
Paolo
>
> --
> Eduardo
next prev parent reply other threads:[~2018-01-18 22:20 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 [this message]
2018-01-18 22:39 ` Eduardo Habkost
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=800158468.913862.1516313996908.JavaMail.zimbra@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=ehabkost@redhat.com \
--cc=f4bug@amsat.org \
--cc=famz@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).