From: Marcel Apfelbaum <marcel.a@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
aliguori@us.ibm.com, qemu-devel@nongnu.org, afaerber@suse.de,
sw@weilnetz.de
Subject: Re: [Qemu-devel] [PATCH] qdev-monitor: Avoid exiting when hot-plugging two devices with the same bootindex value
Date: Thu, 12 Sep 2013 14:23:52 +0300 [thread overview]
Message-ID: <1378985032.2186.36.camel@localhost.localdomain> (raw)
In-Reply-To: <874n9qe1xi.fsf@blackfin.pond.sub.org>
On Thu, 2013-09-12 at 13:04 +0200, Markus Armbruster wrote:
> Marcel Apfelbaum <marcel.a@redhat.com> writes:
>
> > On Thu, 2013-09-12 at 11:43 +0200, Markus Armbruster wrote:
> >> Paolo Bonzini <pbonzini@redhat.com> writes:
> >>
> >> > Il 11/09/2013 20:26, Marcel Apfelbaum ha scritto:
> >> >> Qemu is expected to quit if the same boot index value is used by
> >> >> two devices.
> >> >> However, hot-plugging a device with a bootindex value already used should
> >> >> fail with a friendly message rather than quitting a running VM.
> >> >
> >> > I think the problem is right where QEMU exits, i.e. in
> >> > add_boot_device_path. This function should return an error instead, via
> >> > an Error ** argument.
> >>
> >> Agree.
> >>
> >> > Callers, typically a device's init or realize function, will either
> >> > print the error before returning an error code (e.g. -EBUSY for init) or
> >> > propagate the error up (for realize).
> >> >
> >> > Returning/propagating failure will still cause QEMU to exit when the
> >> > duplicate bootindexes are found on the command line.
> >>
> >> I have an unfinished patch in my tree that does exactly that. It's
> >> unfinished, because cleanup on error paths needs work. Current state
> >> appended with FIXMEs and all. Beware, the FIXMEs may not be correct and
> >> are almost certainly not complete.
> > Thanks Markus,
> > Should I use it as my starting point and finish it or you intend to?
>
> If you have cycles to spare, you're quite welcome to take this patch and
> run with it!
I'll try to finish it, thanks!
>
> You may have noticed that my patch moves the code to add the boot device
> path in a few cases. I did this in the hope of simplifying error paths.
> Do not hesitate to undo such moves where they turn out not to simplify
> anything.
>
> Here's an issue that exists before my patch: DeviceClass method
> unrealize() should clean up everything done by realize(). In
> particular, unrealize() needs to remove any entry added to fw_boot_order
> by realize() via add_boot_device_path(). Code to do that doesn't exist,
> yet. Hot unplug is technically broken for all devices with bootindex.
> Impact unknown. Should probably be fixed in a separate patch.
The outcome is that after hot-unplugging a device with bootindex=x,
the device still remains in the fw_boot_order and no device can
be hot-plugged with the same bootindex 'x'. Furthermore, because
of the current issue Qemu quits on an operation that should succeed!
I plan to send a patch to fix this too.
Thanks,
Marcel
next prev parent reply other threads:[~2013-09-12 11:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-11 18:26 [Qemu-devel] [PATCH] qdev-monitor: Avoid exiting when hot-plugging two devices with the same bootindex value Marcel Apfelbaum
2013-09-11 18:41 ` Marcel Apfelbaum
2013-09-12 7:49 ` Paolo Bonzini
2013-09-12 8:38 ` Marcel Apfelbaum
2013-09-12 9:43 ` Markus Armbruster
2013-09-12 10:33 ` Marcel Apfelbaum
2013-09-12 11:04 ` Markus Armbruster
2013-09-12 11:23 ` Marcel Apfelbaum [this message]
2013-09-16 9:54 ` Marcel Apfelbaum
2013-09-16 10:11 ` Paolo Bonzini
2013-09-16 15:14 ` Michael S. Tsirkin
2013-09-16 15:34 ` Paolo Bonzini
2013-09-16 15:59 ` Michael S. Tsirkin
2013-09-16 11:03 ` Gleb Natapov
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=1378985032.2186.36.camel@localhost.localdomain \
--to=marcel.a@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/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).