From: Gerd Hoffmann <kraxel@redhat.com>
To: Paul Brook <paul@codesourcery.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qdev: add return value to init() callbacks.
Date: Wed, 12 Aug 2009 21:47:19 +0200 [thread overview]
Message-ID: <4A831C47.3070309@redhat.com> (raw)
In-Reply-To: <200908122028.41012.paul@codesourcery.com>
On 08/12/09 21:28, Paul Brook wrote:
>> We have already one case in-tree where this is needed:
>> Try -device virtio-blk-pci (without drive= specified) and watch qemu
>> segfault.
>
> No. Failure of the init routine should be fatal. i.e. virtio_blk_init_pci
> should call hw_error.
No. That policy doesn't belong there.
> If you want to allow graceful failure (which is pointless for commandline
> options, but may be desirable for hotplug devices)
Exactly. And for that reason we must pass up the error to the caller.
The caller can then decide what to do with it. For devices added via
command line options we probably want to exit(1). For hotplugging we
probably would not.
> they you need to also add
> some way of reporting why device creation failure. fprintf(stderr) is just
> plain wrong.
Indeed. When hotplugging via monitor the error message should appear on
the monitor, not stderr. It is already an item on my todo list.
I'd prefer to address that in a separate patch though, the patch is
already big and invasive enough as-is.
cheers,
Gerd
next prev parent reply other threads:[~2009-08-12 19:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-12 15:59 [Qemu-devel] [PATCH] qdev: add return value to init() callbacks Gerd Hoffmann
2009-08-12 17:00 ` Markus Armbruster
2009-08-12 19:28 ` Paul Brook
2009-08-12 19:47 ` Gerd Hoffmann [this message]
2009-08-13 6:17 ` Markus Armbruster
2009-08-13 7:48 ` Gerd Hoffmann
2009-08-13 9:06 ` Markus Armbruster
2009-08-13 11:05 ` Gerd Hoffmann
2009-08-13 11:42 ` Markus Armbruster
2009-08-13 14:31 ` Gerd Hoffmann
2009-08-13 17:22 ` Markus Armbruster
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=4A831C47.3070309@redhat.com \
--to=kraxel@redhat.com \
--cc=paul@codesourcery.com \
--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).