[PATCH 2/2] qemu: Use .hostdevice attribute for usb-host

Ján Tomko jtomko at redhat.com
Tue Sep 29 15:59:32 UTC 2020


On a Monday in 2020, Michal Privoznik wrote:
>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.

Are you looking for `qemuVirCommandGetFDSet`?

Also, s/Libvirt/libvirt/

>
>Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1877218
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> src/qemu/qemu_command.c | 21 +++++++++++++--------
> 1 file changed, 13 insertions(+), 8 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200929/4a5937b4/attachment-0001.sig>


More information about the libvir-list mailing list