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 <m...@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
signature.asc
Description: OpenPGP digital signature