qemu: Use .hostdevice attribute for usb-host
qemu: Use .hostdevice attribute for usb-host

This originally started as bug 1595525 in which namespaces and
libusb used in QEMU were not playing nicely with each other. The
problem was that libusb built a cache of USB devices it saw
(which was a very limited set because of the namespace) and then
expected to receive udev events to keep the cache in sync. But
those udev events didn't come because on hotplug when we mknod()
devices in the namespace no udev event is generated. And what is
worse - libusb failed to open a device that wasn't in the cache.

Without going further into what the problem was, libusb added a
new API for opening USB devices that avoids using cache which
QEMU incorporated and exposes under "hostdevice" attribute.

What is even nicer is that QEMU uses qemu_open() for path
provided in the attribute and thus FD passing could be used.
Except qemu_open() expects so called FD sets instead of `getfd'
and these are not implemented in libvirt, yet.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1877218
Signed-off-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>
Reviewed-by: Daniel Henrique Barboza <627b089ad62deae9aaf06ccfa2c9056df28927e0@gmail.com>
Reviewed-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>

crobinso/libvirt,olafhering/libvirt,jfehlig/libvirt,crobinso/libvirt,nertpinx/libvirt,zippy2/libvirt,olafhering/libvirt,jardasgit/libvirt,libvirt/libvirt,jfehlig/libvirt,libvirt/libvirt,zippy2/libvirt,libvirt/libvirt,jfehlig/libvirt,nertpinx/libvirt,nertpinx/libvirt,nertpinx/libvirt,zippy2/libvirt,jardasgit/libvirt,crobinso/libvirt,jardasgit/libvirt,libvirt/libvirt,jardasgit/libvirt,jardasgit/libvirt,nertpinx/libvirt,olafhering/libvirt,jfehlig/libvirt,olafhering/libvirt,crobinso/libvirt,zippy2/libvirt