Prefer sysfs for USB host devicesqemu-0.10.50-10.kvm87.fc12qemu-0.10.50-8.kvm87.fc12qemu-0.10.50-9.kvm87.fc12
commit9cf0574418cc7657618a738dd31337739c635875
authorMark McLoughlin <markmc@redhat.com>
Fri, 3 Jul 2009 08:17:20 +0000 (3 09:17 +0100)
committerMark McLoughlin <markmc@redhat.com>
Fri, 3 Jul 2009 08:29:43 +0000 (3 09:29 +0100)
tree8069559b535b35f731986bdc4be2c560b13bc4c5
parent85da3db92e4b25275426e252974db7eae18e2bb1
Prefer sysfs for USB host devices

Scanning for devices via /sys/bus/usb/devices/ and using them via the
/dev/bus/usb/<bus>/<device> character devices is the prefered method
on modern kernels, so try that first.

When using SELinux and libvirt, qemu will have access to /sys/bus/usb
but not /proc/bus/usb, so although the current code will work just
fine, it will generate SELinux AVC warnings.

See also:

  https://bugzilla.redhat.com/508326

Reported-by: Daniel Berrange <berrange@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
usb-linux.c