Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 947724

Summary: fail to passthrough USB stick via '-usbdevice host:$vendorid:$productid' under pc-i440fx-1.4 machine type
Product: Red Hat Enterprise Linux 7 Reporter: Sibiao Luo <sluo>
Component: qemu-kvmAssignee: Yvugenfi <yvugenfi>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 7.0CC: acathrow, chayang, hhuang, juzhang, kraxel, martin.wilck, mazhang, michen, mmishael, qzhang, rhod, shuang, sluo, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-15 16:05:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
device manager screenshoot.
none
screen shot from Win7
none
Qemu assigns the USB device 2.0 to UHCI (USB 1.0) . none

Description Sibiao Luo 2013-04-03 06:27:54 UTC
Description of problem:
boot a win2012 64bit guest with passthrough USB stick via '-usbdevice host:$vendorid:$productid' under pc-i440fx-1.4 machine type, but guest cann't detect the disk correctly. btw i test it with Q35 which has no such issue.


Version-Release number of selected component (if applicable):
host info:
kernel-3.9.0-0.rc4.45.el7.x86_64
qemu-kvm-1.4.0-1.el7.x86_64
seabios-1.7.2-0.2.gita810e4e7.el7.x86_64
guest info:
windows: win2012 64bit

How reproducible:
100%

Steps to Reproduce:
1.check the usb info from host.
# lsusb | grep CompUSA
Bus 002 Device 007: ID 1516:6221 CompUSA 
[root@dhcp-9-242 home]# lsusb -vs 002:007

Bus 002 Device 007: ID 1516:6221 CompUSA 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x1516 CompUSA
  idProduct          0x6221 
  bcdDevice            1.00
...
2.boot a win2012 64bit guest with passthrough USB stick via '-usbdevice host:$vendorid:$productid' under pc-i440fx-1.4 machine type.
# /usr/libexec/qemu-kvm -S -M pc-i440fx-1.4 -cpu SandyBridge...-readconfig /home/ich9-ehci-uhci.cfg -usbdevice host:1516:6221
3.check the usb info via HMP monitor.
(qemu) info usb
4.check the device manager in guest.
  
Actual results:
after step 3, it display like:
(qemu) info usb
  Device 0.1, Port 1, Speed 480 Mb/s, Product host:2.7
  Device 1.0, Port 1, Speed 1.5 Mb/s, Product USB Redirection Device
  Device 1.1, Port 2, Speed 480 Mb/s, Product QEMU USB MSD
after step 4, there is no USB disk in device manager, the driver display that fail to load correctly for 'USB Mass Strage Device'. I will attach the screenshoot later.

Expected results:
can passthrough the usb disk successfully to guest without any problem.

Additional info:

Comment 1 Sibiao Luo 2013-04-03 06:28:25 UTC
Created attachment 731049 [details]
device manager screenshoot.

Comment 2 Sibiao Luo 2013-04-03 06:36:19 UTC
I test it with other method with the usb stick passthrough under both Q35 and pc-i440fx-1.4 machine type, test results were listed as following.
Test Matrix:
+----------+---------------+---------------+
|  Method  |     Q35       | pc-i440fx-1.4 |
+----------+---------------+---------------+
| Method 1 |     PASS      |     PASS      |         
+----------+---------------+---------------+
| Method 2 |     PASS      |     PASS      |       
+----------+---------------+---------------+
| Method 3 |     PASS      |     FAIL      |       
+----------+---------------+---------------+
- Method 1:
 e.g:...-device usb-ehci,id=ehci,bus=pcie.0,addr=0x8 -device usb-host,hostbus=2,hostaddr=7,id=usb-stick,bus=ehci.0
- Method 2:
 e.g:...-device usb-ehci,id=ehci,bus=pcie.0,addr=0x8 -device usb-host,bus=ehci.0,vendorid=0x1516,productid=0x6221
- Method 3:
 e.g:...-device usb-ehci,id=ehci,bus=pcie.0,addr=0x8 -usbdevice host:1516:6221

Best Regards.
sluo

Comment 3 Sibiao Luo 2013-04-03 06:51:29 UTC
I tried the win7 64bit guest with '-usbdevice host:$vendorid:$productid' under the pc-i440fx-1.4, it hit the same issue as win2012 64bit, the device driver 'USB Mass Strage Device' was not loaded correctly.

Also tried the rhel7.0 guest with '-usbdevice host:$vendorid:$productid' under the pc-i440fx-1.4, it has no such issue.

Comment 4 Martin Wilck 2013-09-25 16:21:37 UTC
Created attachment 802942 [details]
screen shot from Win7

I see the same problem with F19 and a Win7 guest. The windows device manager tells me "This Device cannot start (Code 10)".

Comment 5 Miki Mishael 2013-12-15 12:44:32 UTC
Created attachment 836928 [details]
Qemu assigns the USB device 2.0 to UHCI (USB 1.0) .

Comment 6 Miki Mishael 2013-12-15 12:46:48 UTC
host info:
Linux Snarl.daynix 3.10.9-200.fc19.x86_64 #1 SMP Wed Aug 21 19:27:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
QEMU emulator version 1.6.1, Copyright (c) 2003-2008 Fabrice Bellard

guest info:
windows: win2012 64bit

2.boot a win2012 64bit guest with passthrough USB stick via '-usbdevice host:$vendorid:$productid' under pc-i440fx-1.4 machine type.
# /usr/libexec/qemu-kvm -S -M pc-i440fx-1.4 -cpu SandyBridge...-readconfig /home/ich9-ehci-uhci.cfg -usbdevice host:1516:6221

This command line dosen't work for me either, You can use this line and it will work on pc-i440fx-1.4 and q35 or other method.
-usb \
-usbdevice tablet \
-readconfig /home/mikim/general/ich9-ehci-uhci.cfg \
-device usb-host,hostbus=1,hostaddr=4 \

When using :

Bus 001 Device 004: ID 1e3d:2096 Chipsbank Microelectronics Co., Ltd

The problem is that Qemu assigns the  USB device 2.0 to UHCI (Universal Host Controller Interface), Which is 1.0 and the host USB controller is USB 2.0 and also the device itself.
So there is problem to operate USB 2.0 device with USB 1.0 controller assigned to it.


Regarding :
I test it with other method with the usb stick pass through under both Q35 and pc-i440fx-1.4 machine type, test results were listed as following.
Test Matrix:
+----------+---------------+---------------+
|  Method  |     Q35       | pc-i440fx-1.4 |
+----------+---------------+---------------+
| Method 1 |     PASS      |     PASS      |         
+----------+---------------+---------------+
| Method 2 |     PASS      |     PASS      |       
+----------+---------------+---------------+
| Method 3 |     PASS      |     FAIL      |       
+----------+---------------+---------------+
This is correct.
 
 
Conclusions:

Don't use the directive "-usbdevice host:1516:6221" with USB pass through on pc-i440fx-1.4.
Usb pass through works.

Comment 7 juzhang 2013-12-16 03:49:41 UTC
Hi Sluo,

Can you please have a look which method is used by libvirt? If libvirt using method3, we might need to reopen this bug. Thanks.

Best Regards,
Junyi

Comment 8 Sibiao Luo 2013-12-16 06:25:10 UTC
(In reply to juzhang from comment #7)
> Hi Sluo,
> 
> Can you please have a look which method is used by libvirt? If libvirt using
> method3, we might need to reopen this bug. Thanks.
> 
the libvirt use the method *1* specified hostbus and hostaddr.

# lsusb | grep CompUSA
Bus 002 Device 003: ID 1516:6221 CompUSA

Configure my sluo_win2012-64.xml:
...
    <hostdev mode='subsystem' type='usb' managed='yes'>
      <source>
        <vendor id='0x1516'/>
        <product id='0x6221'/>
      </source>
    </hostdev>
...
# virsh define sluo_win2012-64.xml
Domain sluo_win2012-64 defined from sluo_win2012-64.xml
# virsh start sluo_win2012-64
Domain sluo_win2012-64 started

After VM boot up, i check the qmeu-kvm command line which was "-device usb-host,hostbus=2,hostaddr=3,id=hostdev0".
# ps axu | grep qemu-kvm
qemu      9272 70.2  1.3 2163544 106440 ?      Sl   14:23   0:12 /usr/libexec/qemu-kvm -name sluo_win2012-64 -S -machine pc-i440fx-rhel7.0.0,accel=tcg,usb=off -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid b192ddaf-e73f-4812-bb8f-007b2e2a34d7 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/sluo_win2012-64.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -boot order=c,menu=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive file=/home/win2012-64.qcow2,if=none,id=drive-ide0-0-0,format=qcow2,cache=none,aio=native -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0 -spice port=5900,addr=127.0.0.1,disable-ticketing,seamless-migration=on -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=67108864 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device usb-host,hostbus=2,hostaddr=3,id=hostdev0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6

Best Regards,
sluo

Comment 9 juzhang 2013-12-16 06:52:28 UTC
Thanks sluo.

If so, from QE POV, it's ok closed as wontfix.

Best Regards,
Junyi