Bug 557236

Summary: libvirt (virsh) does not see a USB device for passthrough (Sony Reader)
Product: [Fedora] Fedora Reporter: Adam Williamson <awilliam>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: berrange, clalance, crobinso, itamar, jforbes, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-16 13:47:24 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Adam Williamson 2010-01-20 14:34:44 EST
I have a Sony Reader ebook, USB ID 054c:031e . I'd like to pass it through to a virt-manager (KVM) virtual machine. However, in virt-manager's list of USB devices available for passthrough, it just doesn't show up. I found another bug report which suggested a virsh command to check if libvirt sees the device, and sure enough, it doesn't. See the below output - you can see from the lsusb that it's bus 1 device 3, but the virsh command shows bus 1 devices 0, 2 and 4. The virsh command _does_ show the block devices, but that's obviously not enough for passthrough to work. I unmounted the partitions before trying this, so that's not interfering.

If I do it the old-skool way, by editing the machine's XML definition (either by hand or via virsh) and adding a stanza for the device:

    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x054c'/>
        <product id='0x031e'/>
      </source>
    </hostdev>

the passthrough works fine (if I disable SELinux - I'll file a separate bug about that). But it'd be nice to be able to do it via libvirt / virt-manager.

Will attach the verbose lsusb output for the device.

[root@adam adamw]# virsh nodedev-list
block_sda_ST3500320AS_9QM6VHET
block_sdb_Multiple_Card_Reader_058F63666433_0_0
block_sdc_Sony_PRS_600_0_0
block_sdd_Sony_PRS_600_MS_0_1
block_sde_Sony_PRS_600_SD_0_2
block_sdf_Sony_PRS_600_Launcher_0_3
block_sr0
computer
net_eth0_00_23_54_57_d9_09
net_ra0_00_1f_1f_2a_63_09
pci_0000_00_00_0
pci_0000_00_01_0
pci_0000_00_1a_0
pci_0000_00_1a_1
pci_0000_00_1a_2
pci_0000_00_1a_7
pci_0000_00_1b_0
pci_0000_00_1c_0
pci_0000_00_1c_4
pci_0000_00_1c_5
pci_0000_00_1d_0
pci_0000_00_1d_1
pci_0000_00_1d_2
pci_0000_00_1d_7
pci_0000_00_1e_0
pci_0000_00_1f_0
pci_0000_00_1f_2
pci_0000_00_1f_3
pci_0000_00_1f_5
pci_0000_01_00_0
pci_0000_02_00_0
pci_0000_03_00_0
pci_0000_05_00_0
pci_0000_05_01_0
pci_0000_05_03_0
scsi_1_0_0_0
scsi_4_0_0_0
scsi_6_0_0_0
scsi_7_0_0_0
scsi_7_0_0_1
scsi_7_0_0_2
scsi_7_0_0_3
scsi_host0
scsi_host1
scsi_host2
scsi_host3
scsi_host4
scsi_host5
scsi_host6
scsi_host7
scsi_target1_0_0
scsi_target4_0_0
scsi_target6_0_0
scsi_target7_0_0
usb_1_0_1_0
usb_1_2_1_0
usb_1_4
usb_1_4_1_0
usb_2_0_1_0
usb_2_3
usb_2_3_1_2
usb_2_3_1_3
usb_3_0_1_0
usb_4_0_1_0
usb_5_0_1_0
usb_6_0_1_0
usb_6_2
usb_7_0_1_0
usb_7_2_1_0
usb_7_2_1_1
usb_7_2_1_2
usb_7_2_1_3
usb_8_0_1_0
usb_8_2_1_0
usb_usb1
usb_usb2
usb_usb3
usb_usb4
usb_usb5
usb_usb6
usb_usb7

[root@adam adamw]# lsusb
Bus 008 Device 002: ID 046d:c01d Logitech, Inc. MX510 Optical Mouse
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 002: ID 045e:070f Microsoft Corp. 
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 002: ID 03f0:0505 Hewlett-Packard ScanJet 2100c
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 19ff:0103 Dynex 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 054c:031e Sony Corp. 
Bus 001 Device 002: ID 058f:6366 Alcor Micro Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Comment 1 Adam Williamson 2010-01-20 14:45:50 EST
When libvirt is starting up, it posts these messages to /var/log/messages, which look like they may be related:

Jan 20 11:44:11 adam libvirtd: 11:44:11.570: warning : qemudDispatchSignalEvent:385 : Shutting down on signal 15
Jan 20 11:44:12 adam libvirtd: 11:44:12.159: error : udevStrToLong_ui:73 : Failed to convert '031e' to unsigned int#012
Jan 20 11:44:12 adam libvirtd: 11:44:12.204: error : udevStrToLong_ui:73 : Failed to convert 'ff' to unsigned int#012
Jan 20 11:44:12 adam libvirtd: 11:44:12.208: error : udevStrToLong_ui:73 : Failed to convert '070f' to unsigned int#012
Jan 20 11:44:12 adam libvirtd: 11:44:12.215: error : udevStrToLong_ui:73 : Failed to convert '008' to unsigned int#012
Jan 20 11:44:12 adam libvirtd: 11:44:12.216: error : udevStrToLong_ui:73 : Failed to convert '008' to unsigned int#012
Jan 20 11:44:12 adam libvirtd: 11:44:12.222: error : udevStrToLong_ui:73 : Failed to convert '0e' to unsigned int#012
Jan 20 11:44:12 adam libvirtd: 11:44:12.223: error : udevStrToLong_ui:73 : Failed to convert '0e' to unsigned int#012
Jan 20 11:44:12 adam libvirtd: 11:44:12.308: warning : qemudStartup:1067 : Unable to create cgroup for driver: No such device or address

Note the mention of '031e', which is the Reader's device ID.
Comment 3 Adam Williamson 2010-02-11 13:01:14 EST
thanks. 'POST' status isn't used in Fedora (see https://fedoraproject.org/wiki/BugZappers/BugStatusWorkFlow ) - up until the fix actually lands in a Fedora package for the appropriate release it's still ASSIGNED. For Rawhide, you can set it to MODIFIED once you put a fixed package in Rawhide and ask for confirmation that it works before setting CLOSED, or if you're confident about the fix you can just set CLOSED as soon as the fix is in the Rawhide package. Setting back to ASSIGNED for now.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers
Comment 4 Daniel Berrange 2010-02-11 13:10:05 EST
Please don't change the status. To quote the very link you gave

  "POST: This state is primarily used by developers working on virtualization and the kernel. "
Comment 5 Bug Zapper 2010-03-15 10:08:42 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 13 development cycle.
Changing version to '13'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 Adam Williamson 2010-03-16 13:47:24 EDT
This seems to be fixed in current F13, though it's been exchanged for a worse bug (the VM won't start up if the USB passthrough device is configured). I'll file that separately.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers