Bug 813713 - Windows guest can't drive more than 21 usb-storage devices
Windows guest can't drive more than 21 usb-storage devices
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.3
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Gerd Hoffmann
Virtualization Bugs
:
Depends On: 812328
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-18 05:37 EDT by Qingtang Zhou
Modified: 2013-02-21 02:33 EST (History)
11 users (show)

See Also:
Fixed In Version: qemu-kvm-0.12.1.2-2.306.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 812328
Environment:
Last Closed: 2013-02-21 02:33:57 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
cmd line of qemu-kvm (6.33 KB, text/plain)
2012-04-18 05:37 EDT, Qingtang Zhou
no flags Details
output of devcon.exe (58.25 KB, text/plain)
2012-04-18 05:45 EDT, Qingtang Zhou
no flags Details
initial boot 23 disks (83.34 KB, image/png)
2012-11-28 21:15 EST, Shaolong Hu
no flags Details
after reboot 24 disks (83.25 KB, image/png)
2012-11-28 21:16 EST, Shaolong Hu
no flags Details

  None (edit)
Description Qingtang Zhou 2012-04-18 05:37:51 EDT
Created attachment 578289 [details]
cmd line of qemu-kvm

Description of problem:
when assigned 24 'usb-storage' devices to a windows guest, this guest can only recognize 20 devices of them, other 2 devices has following status in "Device Manager":
"""
Windows cannot load the device driver for this hardware because there is a duplicate device already running in the system. (Code 42)
"""
(This status message is a bit different in Win7 guest.)

I met this problem on WinXP/Win2003/Win7 guest. Tested RHEL6 guest, all usb-storage devices are found.


Version-Release number of selected component (if applicable):
# rpm -q kernel
kernel-2.6.32-262.el6.x86_64

# rpm -qa |grep qemu
qemu-kvm-tools-0.12.1.2-2.276.el6.x86_64
qemu-img-0.12.1.2-2.276.el6.x86_64
gpxe-roms-qemu-0.9.7-6.9.el6.noarch
qemu-kvm-0.12.1.2-2.276.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1. assign 24 usb-storages to guest.
2. Start the guest with those disks.
3. Only 20 usb-storage device can be used in windows.
  
Actual results:


Expected results:


Additional info:
qemu-kvm cmd line:
(actual cmd line is very long, I'll send it as a attachment)
# qemu ... \
-device usb-ehci,id=usb1,bus=pci.0,addr=0x4 \
-device usb-ehci,id=usb2,bus=pci.0,addr=0x5 \
-device usb-ehci,id=usb3,bus=pci.0,addr=0x6 \
-device usb-ehci,id=usb4,bus=pci.0,addr=0x7 \
-drive file='/home/autotest-devel/client/tests/kvm/stg0.qcow2',if=none,id=usb2.0,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb1.0,port=1,drive=usb2.0 \
-drive file='/home/autotest-devel/client/tests/kvm/stg1.qcow2',if=none,id=usb2.1,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb1.0,port=2,drive=usb2.1 \
-drive file='/home/autotest-devel/client/tests/kvm/stg2.qcow2',if=none,id=usb2.2,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb1.0,port=3,drive=usb2.2 \
-drive file='/home/autotest-devel/client/tests/kvm/stg3.qcow2',if=none,id=usb2.3,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb1.0,port=4,drive=usb2.3 \
-drive file='/home/autotest-devel/client/tests/kvm/stg4.qcow2',if=none,id=usb2.4,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb1.0,port=5,drive=usb2.4 \
-drive file='/home/autotest-devel/client/tests/kvm/stg5.qcow2',if=none,id=usb2.5,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb1.0,port=6,drive=usb2.5 \
...
Comment 1 Qingtang Zhou 2012-04-18 05:45:16 EDT
Created attachment 578293 [details]
output of devcon.exe

$ grep "Name: USB Mass Storage Device" dev_list|wc -l
22
$ grep "Name: QEMU QEMU HARDDISK USB Device" dev_list |wc -l
20
Comment 3 Gerd Hoffmann 2012-04-20 08:42:04 EDT
The usb devices need unique serial numbers.
http://patchwork.ozlabs.org/patch/154012/
Comment 7 Gerd Hoffmann 2012-07-13 07:48:11 EDT
patches posted.
Comment 13 Shaolong Hu 2012-10-26 05:58:56 EDT
Test with qemu-kvm-rhev-0.12.1.2-2.331.el6.x86_64:

Attach 24 usb storage device to a win7 guest, in guest device manager, can see 24 "USB Mass Storage Device" under "Universal Serial Bus controllers", but in "Disk Management", only see 23.


CMD:

/usr/libexec/qemu-kvm \
-name vm1 \
-chardev socket,id=qmp_monitor_id_qmpmonitor1,path=/tmp/monitor-qmpmonitor1-20120417-201603-0CS2,server,nowait \
-mon chardev=qmp_monitor_id_qmpmonitor1,mode=control \
-chardev socket,id=serial_id_20120417-201603-0CS2,path=/tmp/serial-20120417-201603-0CS2,server,nowait \
-device isa-serial,chardev=serial_id_20120417-201603-0CS2 \
-device usb-ehci,id=usb1,bus=pci.0,addr=0x4 \
-device usb-ehci,id=usb2,bus=pci.0,addr=0x5 \
-device usb-ehci,id=usb3,bus=pci.0,addr=0x6 \
-device usb-ehci,id=usb4,bus=pci.0,addr=0x7 \
-drive file=nfs/win7-64-virtio.qcow2,index=0,if=none,id=drive-virtio-disk1,media=disk,cache=none,boot=on,snapshot=off,readonly=off,format=qcow2,aio=native \
-device virtio-blk-pci,bus=pci.0,addr=0x8,drive=drive-virtio-disk1,id=virtio-disk1 \
-drive file=disk1,if=none,id=usb2.0,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb1.0,port=1,drive=usb2.0 \
-drive file=disk2,if=none,id=usb2.1,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb1.0,port=2,drive=usb2.1 \
-drive file=disk3,if=none,id=usb2.2,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb1.0,port=3,drive=usb2.2 \
-drive file=disk4,if=none,id=usb2.3,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb1.0,port=4,drive=usb2.3 \
-drive file=disk5,if=none,id=usb2.4,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb1.0,port=5,drive=usb2.4 \
-drive file=disk6,if=none,id=usb2.5,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb1.0,port=6,drive=usb2.5 \
-drive file=disk7,if=none,id=usb2.6,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb2.0,port=1,drive=usb2.6 \
-drive file=disk8,if=none,id=usb2.7,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb2.0,port=2,drive=usb2.7 \
-drive file=disk9,if=none,id=usb2.8,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb2.0,port=3,drive=usb2.8 \
-drive file=disk10,if=none,id=usb2.9,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb2.0,port=4,drive=usb2.9 \
-drive file=disk11,if=none,id=usb2.10,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb2.0,port=5,drive=usb2.10 \
-drive file=disk12,if=none,id=usb2.11,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb2.0,port=6,drive=usb2.11 \
-drive file=disk13,if=none,id=usb2.12,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb3.0,port=1,drive=usb2.12 \
-drive file=disk14,if=none,id=usb2.13,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb3.0,port=2,drive=usb2.13 \
-drive file=disk15,if=none,id=usb2.14,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb3.0,port=3,drive=usb2.14 \
-drive file=disk16,if=none,id=usb2.15,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb3.0,port=4,drive=usb2.15 \
-drive file=disk17,if=none,id=usb2.16,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb3.0,port=5,drive=usb2.16 \
-drive file=disk18,if=none,id=usb2.17,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb3.0,port=6,drive=usb2.17 \
-drive file=disk19,if=none,id=usb2.18,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb4.0,port=1,drive=usb2.18 \
-drive file=disk20,if=none,id=usb2.19,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb4.0,port=2,drive=usb2.19 \
-drive file=disk21,if=none,id=usb2.20,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb4.0,port=3,drive=usb2.20 \
-drive file=disk22,if=none,id=usb2.21,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb4.0,port=4,drive=usb2.21 \
-drive file=disk23,if=none,id=usb2.22,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb4.0,port=5,drive=usb2.22 \
-drive file=disk24,if=none,id=usb2.23,media=disk,cache=none,boot=off,snapshot=off,readonly=off,format=qcow2,aio=native \
-device usb-storage,bus=usb4.0,port=6,drive=usb2.23 \
-m 4096 \
-smp 2,cores=1,threads=1,sockets=2 \
-rtc base=localtime,clock=host,driftfix=slew \
-M rhel6.3.0 \
-boot order=cdn,once=c,menu=off   \
-enable-kvm \
-vnc :10 \
-monitor stdio
Comment 14 Gerd Hoffmann 2012-10-30 04:52:12 EDT
Hmm.  I see them all just fine.  Not all of them got a driver letter though because windows ran out of them (A: + B: = reservd for floppy, C: = hard disk, D: = cdrom, E: -> Z: assigned to 22 usb drives), so they are not visible in the windows explorer.  I see them in disk management though (control panel -> administrative tools -> computer management -> disk managment).

Please recheck.
Comment 22 Shaolong Hu 2012-11-28 21:15:27 EST
Created attachment 653926 [details]
initial boot 23 disks
Comment 23 Shaolong Hu 2012-11-28 21:16:00 EST
Created attachment 653927 [details]
after reboot 24 disks
Comment 26 Shaolong Hu 2012-11-29 21:28:24 EST
OK, this bug is about windows seeing duplicate devices which is fixed, in device manager all 24 disks could be recognized, as to sometimes one disk can not be used (error: device cannot be start), open new one to track it:
Bug 882050 - Attach 24 usb-storage device to windows guest, sometimes after reboot one disk can not be used with error "device cannot start"

Set this bug verified.
Comment 28 errata-xmlrpc 2013-02-21 02:33:57 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0527.html

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