From: Eric Blake <eblake@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Anthony Liguori" <aliguori@us.ibm.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Stefan Hajnoczi" <stefanha@gmail.com>,
"Markus Armbruster" <armbru@redhat.com>,
qemu-devel@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
laine@redhat.com, "Paolo Bonzini" <pbonzini@redhat.com>,
"Luiz Capitulino" <lcapitulino@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] qdev: DEVICE_DELETED event
Date: Wed, 06 Mar 2013 07:44:32 -0700 [thread overview]
Message-ID: <51375650.1060800@redhat.com> (raw)
In-Reply-To: <20130306130055.GA29446@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2599 bytes --]
On 03/06/2013 06:00 AM, Michael S. Tsirkin wrote:
> libvirt has a long-standing bug: when removing the device,
> it can request removal but does not know when does the
> removal complete. Add an event so we can fix this in a robust way.
s/complete/completes/
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>
> diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt
> index b2698e4..ec5b810 100644
> --- a/QMP/qmp-events.txt
> +++ b/QMP/qmp-events.txt
> @@ -136,6 +136,21 @@ Example:
> Note: The "ready to complete" status is always reset by a BLOCK_JOB_ERROR
> event.
>
> +DEVICE_DELETED
> +-----------------
> +
> +It's emitted whenever the device removal completion is acknowledged
I know this is copy-and-paste from DEVICE_TRAY_MOVED, but most of the
file uses the more succinct: s/It's emitted/Emitted/
> +by the guest. At this point, it's safe to reuse the specified device ID.
> +Device removal can be initiated by the guest or by HMP/QMP commands.
> +
> +Data:
> +
> +- "device": device name (json-string)
> +
> +{ "event": "DEVICE_DELETED",
> + "data": { "device": "virtio-net-pci-0" },
> + "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
Long overdue!
> +++ b/qapi-schema.json
> @@ -2354,7 +2354,9 @@
> # Notes: When this command completes, the device may not be removed from the
> # guest. Hot removal is an operation that requires guest cooperation.
> # This command merely requests that the guest begin the hot removal
> -# process.
> +# process. Completion of the device removal process is signaled with a
> +# DEVICE_DELETED event. Guest reset will automatically complete removal
> +# for all devices.
Question - if libvirt misses the event (for example, if libvirtd
requests a remove, but then gets restarted, and the event arrives before
libvirtd is back up), is there a way to poll whether the the removal has
completed? The event is great to minimize polling overhead in the
common case, but we generally provide this sort of information via a
pollable interface at the same time.
> #
> # Since: 0.14.0
> ##
> ---
> QMP/qmp-events.txt | 15 +++++++++++++++
> hw/qdev.c | 6 ++++++
> include/monitor/monitor.h | 1 +
> monitor.c | 1 +
> qapi-schema.json | 4 +++-
> 5 files changed, 26 insertions(+), 1 deletion(-)
Looks like your patch body is included twice?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
next prev parent reply other threads:[~2013-03-06 14:44 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
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 [this message]
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=51375650.1060800@redhat.com \
--to=eblake@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=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.