From: Osier Yang <jyang@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Anthony Liguori" <aliguori@us.ibm.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"libvir-list@redhat.com" <libvir-list@redhat.com>,
"Stefan Hajnoczi" <stefanha@gmail.com>,
qemu-devel@nongnu.org, "Luiz Capitulino" <lcapitulino@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
laine@redhat.com, "Paolo Bonzini" <pbonzini@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] qdev: DEVICE_DELETED event
Date: Fri, 08 Mar 2013 18:56:43 +0800 [thread overview]
Message-ID: <5139C3EB.3070401@redhat.com> (raw)
In-Reply-To: <87boaujmvk.fsf@blackfin.pond.sub.org>
On 2013年03月08日 16:50, Markus Armbruster wrote:
> Osier Yang<jyang@redhat.com> writes:
>
>> I'm wondering if it could be long time to wait for the device_del
>> completes (AFAIK from previous bugs, it can be, though it should be
>> fine for most of the cases). If it's too long, it will be a problem
>> for management, because it looks like hanging. We can have a timeout
>> for the device_del in libvirt, but the problem is the device_del
>> can be still in progress by qemu, which could cause the inconsistency.
>> Unless qemu has some command to cancel the device_del.
>
> I'm afraid cancelling isn't possible, at least not for PCI.
>
> Here's how device_del works for PCI when it works, roughly:
>
> 1. device_del asks the device model to unplug itself.
>
> 2. PCI device models delegate the job to the device model providing
> their PCI bus. Let's assume it's our PIIX3/PIIX4 mongrel. That one
> puts an unplug request into PIIX4 function 3 where guest ACPI can see
> it, and triggers its interrupt. Then it immediately sends the QMP
> success reply.
>
> 3. Guest ACPI (SeaBIOS) services the interrupt. It finds the unplug
> request, and asks the guest OS nicely to give up the device.
>
> 4. If the guest OS has a working ACPI driver, and it feels like giving
> up the device, it does so, and tells ACPI when it's done.
>
> 5. Guest ACPI cleans up whatever it needs cleaned up, and signals
> successful unplug by writing the slog number to a PIIX4 function 3
> register.
>
> 6. The PIIX device destroys the device in that slot.
>
> I call this the ACPI unplug dance.
>
> We don't control steps 3..5.
>
> There's no way for the guest to tell us "I got your unplug request, but
> I'm not going to honor it". Even if their was, a guest without a
> working ACPI driver wouldn't use it, so we couldn't rely on it anyway.
>
> There's no way for us to tell the guest "I changed my mind on this
> unplug". All we can do is wait and see. Either the device goes away,
> or it stays.
Hum, as I replied to Jirka in later mail, IMHO it needs to change
libvirt detaching APIs to either wait for the event or find the
device is really removed by polling before returning success. But
it sounds to me that how long it takes to wait or polling is really
depended?
Osier
next prev parent reply other threads:[~2013-03-08 10:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 13:00 [Qemu-devel] [PATCH] qdev: DEVICE_DELETED event Michael S. Tsirkin
2013-03-06 13:57 ` Andreas Färber
2013-03-06 14:13 ` Michael S. Tsirkin
2013-03-07 9:55 ` Markus Armbruster
2013-03-07 10:07 ` Michael S. Tsirkin
2013-03-07 13:11 ` Andreas Färber
2013-03-07 14:14 ` Markus Armbruster
2013-03-07 16:35 ` Michael S. Tsirkin
2013-03-07 17:23 ` Markus Armbruster
2013-03-07 18:12 ` Michael S. Tsirkin
2013-03-07 19:00 ` Andreas Färber
2013-03-07 19:15 ` Michael S. Tsirkin
2013-03-08 7:09 ` Osier Yang
2013-03-08 8:50 ` Markus Armbruster
2013-03-08 9:25 ` Jiri Denemark
2013-03-08 10:37 ` Osier Yang
2013-03-08 10:56 ` Osier Yang [this message]
2013-03-08 11:58 ` Markus Armbruster
2013-03-07 20:18 ` Markus Armbruster
2013-03-07 20:29 ` Michael S. Tsirkin
2013-03-06 14:44 ` Eric Blake
2013-03-06 14:50 ` Michael S. Tsirkin
2013-03-06 14:52 ` Paolo Bonzini
2013-03-06 15:41 ` Eric Blake
2013-03-07 9:38 ` 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=5139C3EB.3070401@redhat.com \
--to=jyang@redhat.com \
--cc=afaerber@suse.de \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=laine@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=libvir-list@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.