]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virt-aa-helper: fix libusb access to udev usb data
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>
Wed, 20 Sep 2017 14:59:07 +0000 (16:59 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 6 Oct 2017 09:14:49 +0000 (11:14 +0200)
commitbf3a4140877299cf351821518d269bcd4888f2f1
treeb4e07731a2e68e9cb990cbc4b656f5a1a9727539
parent750e08443a7b07324d75b4c7648b15a9d77b124e
virt-aa-helper: fix libusb access to udev usb data

libusb as used by qemu needs to read data from /run/udev/data/ about usb
devices. That is read once on the first initialization of libusb_init by
qemu.

Therefore generating just the device we need would not be sufficient as
another hotplug later can need another device which would fail as the
data is no more re-read at this point.

But we can restrict the paths very much to just the major number of
potential usb devices which will make it match approximately the detail
that e.g. an lsusb -v would reveal - that is much safer than the
"/run/udev/data/* r" blanket many users are using now as a workaround.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
examples/apparmor/libvirt-qemu