*Notes* Deleting usb device from qemu is synchronous operation (although it is not stated in qemu API). I did not used this knowledge in the series. The last patch is remnant of previus version of the series yet it is useful. Diff to previous[1] version: - don't use dummy device while host usb device is unplugged [1] https://www.redhat.com/archives/libvir-list/2019-August/msg01413.html Nikolay Shirokovskiy (11): qemu: track hostdev delete intention qemu: support host usb device unplug qemu: support usb hostdev plugging back qemu: handle host usb device add/del udev events qemu: handle libvirtd restart after host usb device unplug qemu: handle race on device deletion and usb host device plugging qemu: hotplug: update device list on device deleted event qemu: handle host usb device plug/unplug when libvirtd is down qemu: don't mess with non mandatory hostdevs on reattaching qemu: handle detaching of unplugged hostdev conf: parse hostdev missing flag src/conf/domain_conf.c | 32 +++ src/conf/domain_conf.h | 15 ++ src/qemu/Makefile.inc.am | 2 + src/qemu/qemu_conf.h | 3 + src/qemu/qemu_domain.c | 2 + src/qemu/qemu_domain.h | 2 + src/qemu/qemu_driver.c | 431 ++++++++++++++++++++++++++++++++++++++- src/qemu/qemu_hotplug.c | 104 ++++++++-- src/qemu/qemu_hotplug.h | 3 +- src/qemu/qemu_process.c | 59 ++++++ src/util/virhostdev.c | 2 + tests/qemuhotplugtest.c | 2 +- 12 files changed, 637 insertions(+), 20 deletions(-)