From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDFaD-0006bo-Jj for qemu-devel@nongnu.org; Wed, 06 Mar 2013 09:44:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDFa8-00011f-CV for qemu-devel@nongnu.org; Wed, 06 Mar 2013 09:44:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDFa8-00011X-4W for qemu-devel@nongnu.org; Wed, 06 Mar 2013 09:44:36 -0500 Message-ID: <51375650.1060800@redhat.com> Date: Wed, 06 Mar 2013 07:44:32 -0700 From: Eric Blake MIME-Version: 1.0 References: <20130306130055.GA29446@redhat.com> In-Reply-To: <20130306130055.GA29446@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2PXORRSBDOLRGMFCUGSWQ" Subject: Re: [Qemu-devel] [PATCH] qdev: DEVICE_DELETED event List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Kevin Wolf , Anthony Liguori , Eduardo Habkost , Stefan Hajnoczi , Markus Armbruster , qemu-devel@nongnu.org, Gerd Hoffmann , laine@redhat.com, Paolo Bonzini , Luiz Capitulino , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2PXORRSBDOLRGMFCUGSWQ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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/ >=20 > Signed-off-by: Michael S. Tsirkin >=20 > 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_ER= ROR > event. >=20 > +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 I= D. > +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 fr= om the > # guest. Hot removal is an operation that requires guest coope= ration. > # This command merely requests that the guest begin the hot rem= oval > -# process. > +# process. Completion of the device removal process is signale= d 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? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2PXORRSBDOLRGMFCUGSWQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRN1ZRAAoJEKeha0olJ0NqaUQIAJbN5g+6hSSIsHqR/iepy0zP +yQj8euOyjpqFeLRU/f483eCvOdttosOWizuaQoep7xDBvtsE4M+s2xE/QXXk0p7 qbWLaJtNzd4zeo6c4CZ40z2LAnxF/R0JD5lH8eat+OcxdgZFQ2igyd7gXYIrSNqN I1HbEHLglKXwv6/aq51j3DINh4/G7LZaGiYAjT3kUahHvuDsBmkpv4mMSz3fzIGA pm1AwjUbkqlVkPfp5Xro+mAFvZagS2gDWCCnosemherz2Fv03r8VcHiPnSINwpic nLtGayjWYw3qMngb1pdHTM6UhzqOSfzzmYnKT8zUWca1RHQm1vqiZlBQPYPCOuw= =z4/B -----END PGP SIGNATURE----- ------enig2PXORRSBDOLRGMFCUGSWQ--