Bug 522683 - svirt blocks USB passthrough, even with virt_use_usb enabled - /sys/bus/usb/devices
svirt blocks USB passthrough, even with virt_use_usb enabled - /sys/bus/usb/d...
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
x86_64 Linux
high Severity high
: ---
: ---
Assigned To: Daniel Walsh
Fedora Extras Quality Assurance
Depends On:
Blocks: F12VirtBlocker
  Show dependency treegraph
Reported: 2009-09-11 00:19 EDT by Paul Lambert
Modified: 2009-10-01 17:02 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-10-01 17:02:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
XML file for guest VM. (1.95 KB, text/plain)
2009-09-11 00:19 EDT, Paul Lambert
no flags Details
FE-11 image log after (16.19 KB, text/plain)
2009-09-11 23:41 EDT, Paul Lambert
no flags Details
Windows-XP image same as FE-11 host (3.53 KB, text/plain)
2009-09-11 23:41 EDT, Paul Lambert
no flags Details

  None (edit)
Description Paul Lambert 2009-09-11 00:19:05 EDT
Created attachment 360612 [details]
XML file for guest VM.

Description of problem:  USB devices are not recognized by VM even when SELinux boolean values for qemu and virt are true.

Version-Release number of selected component (if applicable):

How reproducible: Everytime.  This all worked on FE-11

Steps to Reproduce:
1. Plug in USB disk
2. Unmount USB disk from host
3. Launch VM
Actual results:
No USB drives mounted

Expected results:
USB drives mounted to VM system

Additional info:

Using x86_64 FE-12-alpha and FE-11 x86_32 guest.  Host maps USB drives OK.
Comment 1 Mark McLoughlin 2009-09-11 09:06:35 EDT
Thanks for the report

Anything interesting in /var/log/libvirt/qemu/Fedora-11-Home.log ?

This is qemu-kvm-0.10.91-0.5.rc1.fc12 ? Does updating to qemu-kvm-0.10.92-1.fc12 help?

dmesg and lsusb -v output from the guest?
Comment 2 Paul Lambert 2009-09-11 23:41:11 EDT
Created attachment 360752 [details]
FE-11 image log after
Comment 3 Paul Lambert 2009-09-11 23:41:49 EDT
Created attachment 360753 [details]
Windows-XP image same as FE-11 host
Comment 4 Paul Lambert 2009-09-11 23:43:35 EDT
Current RPM QEMU install. 

Comment 5 Paul Lambert 2009-09-14 17:33:31 EDT
Was able to get 12-alpha udpates applied.  Here is my current machine.  USB disk still not mounted.

[root@BRSINC-VM01 admin]# rpm -aq *virt*

[root@BRSINC-VM01 admin]# rpm -aq *kvm*
Comment 6 Glauber Costa 2009-09-17 18:20:41 EDT
Just sent an upstream fix. I will be able to provide a link as soon as qemu mailing list decides to cooperate.
Comment 7 Mark McLoughlin 2009-09-18 08:15:04 EDT
Here's the fix:

Comment 8 Mark McLoughlin 2009-09-23 07:28:27 EDT
Wait, that fix doesn't appear relevant to the F-12 tree - the that fixes looks like it was introduced by the qdev conversion
Comment 9 Mark McLoughlin 2009-09-30 14:01:15 EDT
Okay, I found one issue with libvirt USB passthrough support and pushed a fix:

* Wed Sep 30 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-7
- Fix USB device passthrough (#522683)
Comment 10 Mark McLoughlin 2009-09-30 14:13:24 EDT
Okay, here's some more info:

  - libvirt in F-12 now supports re-labelling the sysfs files for USB
    passthrough, but only for devices specified by bus/device, not
    by product/vendor id

  - so, if you do:

        <address bus='0XX' device='0XX'/>

    instead of:

        <vendor id='0x1d6b'/>
        <product id='0x0002'/>

    then it *should* just work fine

  - if you stick with vendor/product, you need to do:

      $> setsebool virt_use_usb on

  - Now, it looks like we're broken in both of these scenarios currently
    because of this selinux AVC:

type=SYSCALL msg=audit(1254334042.982:608): arch=c000003e syscall=2 success=no exit=-13 a0=5acdf2 a1=90800 a2=5 a3=7fffd314be50 items=0 ppid=1 pid=1823 auid=0 uid=107 gid=107 euid=107 suid=107 fsuid=107 egid=107 sgid=107 fsgid=107 tty=(none) ses=23 comm="qemu-kvm" exe="/usr/bin/qemu-kvm" subj=system_u:system_r:svirt_t:s0:c428,c710 key=(null)
type=AVC msg=audit(1254334042.982:608): avc:  denied  { read } for  pid=1823 comm="qemu-kvm" name="devices" dev=sysfs ino=1764 scontext=system_u:system_r:svirt_t:s0:c428,c710 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir

   - It works fine in permissive mode, so this isn't a qemu issue
Comment 11 Mark McLoughlin 2009-10-01 16:08:04 EDT
Weird, I was sure I added dwalsh already
Comment 12 Daniel Walsh 2009-10-01 17:02:53 EDT
Fixed in selinux-policy-3.6.32-17.fc12.noarch

Note You need to log in before you can comment on or make changes to this bug.