<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <font size="+1">Hi,<br>
      <br>
      While reviewing these I got one question that I think it's better<br>
      asked here since it's not related to a single patch.<br>
      <br>
      I understand the use case for udev machinery to handle the device<br>
      removal event - in fact, I wonder if this should be done to all
      hostdevs,<br>
      not just USB - but I'm not sure about the handling of device add.
      Let's<br>
      say you have a server running lots of guests and an administrator<br>
      physically disconnect a USB device that might have been in used<br>
      as hostdev by any of them. It makes sense to remove the device<br>
      from the domain in this scenario because, well, the device isn't
      there<br>
      anymore.<br>
      <br>
      But when the admin connects the same USB device back, is he/she<br>
      really expecting the device to be automatically assigned to the
      same<br>
      guest, without direct action? Isn't there a chance of </font><font
      size="+1">this admin reconnect<br>
      back the USB device to the server for any other use, then see
      Libvirt<br>
      automatically re-assign the device back to the guest that was
      using it<br>
      before, and get not so pleased about it (i.e. furiously opening a
      new<br>
      Libvirt bug)?<br>
      <br>
      <br>
      <br>
      Thanks,<br>
      <br>
      <br>
      DHB<br>
      <br>
      <br>
      <br>
    </font><br>
    <div class="moz-cite-prefix">On 9/9/19 8:33 AM, Nikolay Shirokovskiy
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:20190909113314.22362-1-nshirokovskiy@virtuozzo.com">
      <pre class="moz-quote-pre" wrap="">*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] <a class="moz-txt-link-freetext" href="https://www.redhat.com/archives/libvir-list/2019-August/msg01413.html">https://www.redhat.com/archives/libvir-list/2019-August/msg01413.html</a>

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(-)

</pre>
    </blockquote>
    <br>
  </body>
</html>