[libvirt] [PATCH 00/12] Remove devices only after DEVICE_DELETED event

Jiri Denemark jdenemar at redhat.com
Mon Jul 15 17:11:01 UTC 2013


This series (partially) fixes a longstanding bug in device unplug from a
live domain. We considered the QEMU command used for that to be
synchronous and removed the unplugged device from domain definition
immediately after the command returned success. This is OK for USB
devices but other devices actually need guest cooperation to be
unplugged and thus they are actually unplugged asynchronously and QEMU
tells us about that using DEVICE_DELETED event. This series is not
complete, it does not check if any device finished unplug while libvirtd
was not running. I'm working on that part but I wanted to get some
feedback on this series as soon as possible.

Path 3/12 explains how I decided to deal with backward compatibility of
the virDomainDetachDeviceFlags API. No libvirt client/app should see any
real difference in behavior after this series unless they want to.


Jiri Denemark (12):
  Add VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event
  examples: Handle VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event
  Clarify virDomainDetachDeviceFlags documentation
  qemu: Add qemuDomainReleaseDeviceAddress to remove any address
  qemu: Separate disk device removal into a standalone function
  qemu: Separate controller removal into a standalone function
  qemu: Separate net device removal into a standalone function
  qemu: Separate host device removal into a standalone function
  Add virDomainDefFindDevice for looking up a device by its alias
  qemu: Add support for DEVICE_DELETED event
  qemu: Remove devices only after DEVICE_DELETED event
  qemu: Emit VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED events

 daemon/remote.c                                    |  32 +
 examples/domain-events/events-c/event-test.c       |  23 +-
 examples/domain-events/events-python/event-test.py |   4 +
 include/libvirt/libvirt.h.in                       |  18 +
 python/libvirt-override-virConnect.py              |   9 +
 python/libvirt-override.c                          |  52 +-
 src/conf/domain_conf.c                             |  41 ++
 src/conf/domain_conf.h                             |   4 +
 src/conf/domain_event.c                            |  85 ++-
 src/conf/domain_event.h                            |   5 +
 src/libvirt.c                                      |  12 +
 src/libvirt_private.syms                           |   3 +
 src/qemu/qemu_capabilities.c                       |   2 +
 src/qemu/qemu_capabilities.h                       |   1 +
 src/qemu/qemu_command.c                            |  35 +-
 src/qemu/qemu_command.h                            |   8 +-
 src/qemu/qemu_domain.h                             |   2 +
 src/qemu/qemu_driver.c                             |  31 +-
 src/qemu/qemu_hotplug.c                            | 660 ++++++++++++---------
 src/qemu/qemu_hotplug.h                            |   7 +-
 src/qemu/qemu_monitor.c                            |  13 +
 src/qemu/qemu_monitor.h                            |   5 +
 src/qemu/qemu_monitor_json.c                       |  15 +
 src/qemu/qemu_process.c                            |  41 ++
 src/remote/remote_driver.c                         |  32 +
 src/remote/remote_protocol.x                       |  13 +-
 src/remote_protocol-structs                        |   5 +
 27 files changed, 847 insertions(+), 311 deletions(-)

-- 
1.8.3.2




More information about the libvir-list mailing list