From: Anthony Liguori <anthony@codemonkey.ws>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, "H. Peter Anvin" <hpa@linux.intel.com>,
Gerd Hoffmann <kraxel@redhat.com>, Alexander Graf <agraf@suse.de>,
"Richard W. M. Jones" <rjones@redhat.com>
Subject: Re: [Qemu-devel] qdev: Some ISA devices don't handle second instantiation gracefully
Date: Tue, 12 Oct 2010 09:24:05 -0500 [thread overview]
Message-ID: <4CB46F85.8060007@codemonkey.ws> (raw)
In-Reply-To: <m3fwwbfrd8.fsf@blackfin.pond.sub.org>
On 10/12/2010 08:54 AM, Markus Armbruster wrote:
>
>> I think the proper thing to do is remove all exit(1)s and propagate
>> errors instead.
>>
> exit() is good enough during startup, i.e. -device. It's wrong for hot
> plug; anything to be used in a hot plug path must propagate errors. We
> could keep exiting in code that's only used by non-hotpluggable devices.
>
I'm not really suggesting that we move exit()s out of all devices right
now. Am just suggesting that we bump them up one level.
>> A simple approach would be to make register_ioport_{read,write}()
>> return an int, then do a query-replace on the source tree to make all
>> invocations of it simply check the return value and exit if it's
>> non-zero.
>>
> In similar cases, we've used a simple FOO_nofail() wrapper in places
> that want to exit.
>
> I'll see what I can do.
>
I prefer propagating the exit but am not deeply opposed to nofail().
Regards,
Anthony Liguori
next prev parent reply other threads:[~2010-10-12 14:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-12 12:50 [Qemu-devel] isa-applesmc doesn't handle second instantiation gracefully Markus Armbruster
2010-10-12 12:57 ` [Qemu-devel] " Alexander Graf
2010-10-12 13:00 ` [Qemu-devel] qdev: Some ISA devices don't handle second instantiation gracefully (was: isa-applesmc doesn't handle second instantiation gracefully) Markus Armbruster
2010-10-12 13:04 ` [Qemu-devel] " Alexander Graf
2010-10-12 14:52 ` [Qemu-devel] Re: qdev: Some ISA devices don't handle second instantiation gracefully Gerd Hoffmann
2010-10-12 13:27 ` [Qemu-devel] " Anthony Liguori
2010-10-12 13:54 ` Markus Armbruster
2010-10-12 14:24 ` Anthony Liguori [this message]
2010-10-13 12:47 ` [Qemu-devel] Re: qdev: Some ISA devices don't handle second instantiation gracefully (was: isa-applesmc doesn't handle second instantiation gracefully) Richard W.M. Jones
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=4CB46F85.8060007@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=agraf@suse.de \
--cc=armbru@redhat.com \
--cc=hpa@linux.intel.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rjones@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).