From: John Snow <jsnow@redhat.com>
To: Eric Blake <eblake@redhat.com>,
Mao Zhongyi <maozy.fnst@cn.fujitsu.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/6] hw/ide: Convert DeviceClass init to realize
Date: Fri, 15 Sep 2017 17:46:09 -0400 [thread overview]
Message-ID: <73bfb1bd-a7f0-cf9a-eadb-a82f59471ced@redhat.com> (raw)
In-Reply-To: <162e5e37-d90d-9f25-ed73-9a7e914324c0@redhat.com>
On 09/15/2017 05:42 PM, Eric Blake wrote:
> On 09/15/2017 04:35 PM, John Snow wrote:
>>
>>
>> On 08/04/2017 06:26 AM, Mao Zhongyi wrote:
>>> Replace init with realize in IDEDeviceClass, which has errp
>>> as a parameter. So all the implementations now use error_setg
>>> instead of error_report for reporting error.
>>>
>
>>> @@ -2398,7 +2399,7 @@ int ide_init_drive(IDEState *s, BlockBackend *blk, IDEDriveKind kind,
>>> const char *version, const char *serial, const char *model,
>>> uint64_t wwn,
>>> uint32_t cylinders, uint32_t heads, uint32_t secs,
>>> - int chs_trans)
>>> + int chs_trans, Error **errp)
>>
>> this function now requires an additional invariant, which is that we
>> must return -1 AND set errp. Probably wisest to just get rid of the
>> return code so that we don't accidentally goof this up in the future.
>>
>> I think Markus has had some guidance on this in the past, but admittedly
>> I can't remember his preference.
>
[...]
> So these days, the preference is to KEEP the redundancy rather than
> eliminate it, due to ease-of-use concerns.
>
OK, that's fine. I only want consistency with whatever the
paradigm-du-jour is for error handling. Thanks for the quick rebuttal.
--js
next prev parent reply other threads:[~2017-09-15 21:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 10:26 [Qemu-devel] [PATCH v2 0/6] Convert to realize and improve error handling Mao Zhongyi
2017-08-04 10:26 ` [Qemu-devel] [PATCH v2 1/6] hw/ide: Convert DeviceClass init to realize Mao Zhongyi
2017-09-15 21:35 ` John Snow
2017-09-15 21:42 ` Eric Blake
2017-09-15 21:46 ` John Snow [this message]
2017-09-15 22:03 ` [Qemu-devel] [Qemu-block] " John Snow
2017-09-18 1:37 ` Mao Zhongyi
2017-09-18 1:35 ` [Qemu-devel] " Mao Zhongyi
2017-08-04 10:26 ` [Qemu-devel] [PATCH v2 2/6] hw/block/fdc: Convert " Mao Zhongyi
2017-09-15 22:12 ` John Snow
2017-08-04 10:26 ` [Qemu-devel] [PATCH v2 3/6] hw/block/nvme: " Mao Zhongyi
2017-08-04 10:26 ` [Qemu-devel] [PATCH v2 4/6] hw/block: Fix the return type Mao Zhongyi
2017-08-04 12:53 ` Stefan Hajnoczi
2017-08-04 10:26 ` [Qemu-devel] [PATCH v2 5/6] hw/block: Use errp directly rather than local_err Mao Zhongyi
2017-08-04 12:53 ` Stefan Hajnoczi
2017-08-04 10:26 ` [Qemu-devel] [PATCH v2 6/6] dev-storage: Fix the unusual function name Mao Zhongyi
2017-08-04 16:26 ` Philippe Mathieu-Daudé
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=73bfb1bd-a7f0-cf9a-eadb-a82f59471ced@redhat.com \
--to=jsnow@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=maozy.fnst@cn.fujitsu.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).