Bug 822159 - Passing the USB devices to QEMU should be passed in a specific order
Passing the USB devices to QEMU should be passed in a specific order
Status: CLOSED WONTFIX
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-16 10:06 EDT by Oved Ourfali
Modified: 2016-04-26 13:14 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-23 17:37:24 EDT
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)

  None (edit)
Description Oved Ourfali 2012-05-16 10:06:02 EDT
Description of problem:

Looks like qemu is sensitive to the order in which the controllers are passed.
Passing them in a wrong order causes problems in QEMU.

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


How reproducible:
Always

Steps to Reproduce:
Tried with two VMs, one in which the order was:

               <controller index="0" model="ich9-uhci3" type="usb"/>
               <controller index="0" model="ich9-ehci1" type="usb"/>
               <controller index="0" model="ich9-uhci1" type="usb"/>
               <controller index="0" model="ich9-uhci2" type="usb"/>

Failed on:
qemu-kvm: -device
ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2: Parameter
'masterbus' expects an USB masterbus
qemu-kvm: -device
ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2: Device
'ich9-usb-uhci3' could not be initialized

>From the qemu log file:
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/root USER=root LOGNAME=root
QEMU_AUDIO_DRV=spice /usr/libexec/qemu-kvm -S -M pc-0.14 -cpu
kvm64,+lahf_lm,+ssse3,-cx16 -enable-kvm -m 512 -smp
1,sockets=1,cores=1,threads=1 -name usb5 -uuid
d15a09b9-dde9-4b0e-8b76-5f7bc22be73a -smbios type=1,manufacturer=Red
Hat,product=RHEV
Hypervisor,version=6Server-6.3.0.2.el6,serial=44454C4C-4200-104C-8036-B9C04F30354A_84:2b:2b:bf:60:b6,uuid=d15a09b9-dde9-4b0e-8b76-5f7bc22be73a
-nodefconfig -nodefaults -chardev
socket,id=charmonitor,path=/var/lib/libvirt/qemu/usb5.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc
base=2012-05-16T06:52:23,driftfix=slew -device
ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 -device
ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device
ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1
-device virtio-serial-pci,id=v!
 irtio-serial0,bus=pci.0,addr=0x6 -drive
if=none,id=drive-ide0-1-0,readonly=on,format=raw,serial= -device
ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive
file=/rhev/data-center/189b1e74-7421-11e1-ae9c-bf3b1f8a7b5b/690bf6ec-75e9-40b3-b754-8c79ee84e5e5/images/fa990a35-dcea-489c-a515-3e22cff48c17/d0111f10-1034-4911-af2a-d19a2804dfc1,if=none,id=drive-virtio-disk0,format=raw,serial=fa990a35-dcea-489c-a515-3e22cff48c17,cache=writeback,werror=stop,rerror=stop,aio=threads
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
-netdev tap,fd=26,id=hostnet0 -device
virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:4a:16:01:52,bus=pci.0,addr=0x3
-chardev
socket,id=charchannel0,path=/var/lib/libvirt/qemu/channels/usb5.com.redhat.rhevm.vdsm,server,nowait
-device
virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm
-chardev spicevmc,id=charchannel1,name=vdagent -device virtseria!
 lport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=
com.redhat.spice.0 -chardev pty,id=charconsole0 -device
virtconsole,chardev=charconsole0,id=console0 -spice port=5901,addr=0 -k en-us
-vga qxl -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 -chardev
spicevmc,id=charredir0,name=usbredir -device
usb-redir,chardev=charredir0,id=redir0 -chardev
spicevmc,id=charredir1,name=usbredir -device
usb-redir,chardev=charredir1,id=redir1
char device redirected to /dev/pts/3
do_spice_init: starting 0.10.1
spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
spice_server_add_interface: SPICE_INTERFACE_MOUSE
spice_server_add_interface: SPICE_INTERFACE_QXL
red_worker_main: begin
display_channel_create: create display channel
cursor_channel_create: create cursor channel
qemu-kvm: -device
ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2: Parameter
'masterbus' expects an USB masterbus
qemu-kvm: -device
ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2: Device
'ich9-usb-uhci3' could not be initialized


In the other VM the order was:
                <controller index="0" model="ich9-ehci1" type="usb"/>
                <controller index="0" model="ich9-uhci1" type="usb"/>
                <controller index="0" model="ich9-uhci2" type="usb"/>
                <controller index="0" model="ich9-uhci3" type="usb"/>

And it succeeded.
>From the qemu log:
LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/root USER=root LOGNAME=root
QEMU_AUDIO_DRV=spice /usr/libexec/qemu-kvm -S -M pc-0.14 -cpu
kvm64,+lahf_lm,+ssse3,-cx16 -enable-kvm -m 512 -smp
1,sockets=1,cores=1,threads=1 -name usb3 -uuid
bfadbe4b-71e1-477c-ba65-e93a08fb8130 -smbios type=1,manufacturer=Red
Hat,product=RHEV
Hypervisor,version=6Server-6.3.0.2.el6,serial=44454C4C-4200-104C-8036-B9C04F30354A_84:2b:2b:bf:60:b6,uuid=bfadbe4b-71e1-477c-ba65-e93a08fb8130
-nodefconfig -nodefaults -chardev
socket,id=charmonitor,path=/var/lib/libvirt/qemu/usb3.monitor,server,nowait
-mon chardev=charmonitor,id=monitor,mode=control -rtc
base=2012-05-15T12:21:46,driftfix=slew -device
ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x4.0x7 -device
ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x4
-device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x4.0x1
-device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x4.0x2
-device virtio-serial-pci,id=v!
 irtio-serial0,bus=pci.0,addr=0x5 -drive
if=none,id=drive-ide0-1-0,readonly=on,format=raw,serial=11111111-1111-1111-1111-111111111111
-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive
file=/rhev/data-center/189b1e74-7421-11e1-ae9c-bf3b1f8a7b5b/690bf6ec-75e9-40b3-b754-8c79ee84e5e5/images/c6e2e4f8-cc19-43bc-8c6e-ea0b4ece0eb5/154e2704-4d49-433f-8282-440809107424,if=none,id=drive-virtio-disk0,format=raw,serial=c6e2e4f8-cc19-43bc-8c6e-ea0b4ece0eb5,cache=writeback,werror=stop,rerror=stop,aio=threads
-device
virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
-chardev
socket,id=charchannel0,path=/var/lib/libvirt/qemu/channels/usb3.com.redhat.rhevm.vdsm,server,nowait
-device
virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm
-chardev spicevmc,id=charchannel1,name=vdagent -device
virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.s!
 pice.0 -chardev pty,id=charconsole0 -device virtconsole,chardev=charco
nsole0,id=console0 -spice port=5900,addr=0 -k en-us -vga qxl -global
qxl-vga.vram_size=67108864 -device intel-hda,id=sound0,bus=pci.0,addr=0x3
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev
spicevmc,id=charredir0,name=usbredir -device
usb-redir,chardev=charredir0,id=redir0 -chardev
spicevmc,id=charredir1,name=usbredir -device
usb-redir,chardev=charredir1,id=redir1

  
Actual results:
The VM in which the order is wrong fails with error:
ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2: Parameter
'masterbus' expects an USB masterbus
qemu-kvm: -device
ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2: Device
'ich9-usb-uhci3' could not be initialized


Expected results:
Both VMs should start correctly.

Additional info:
Comment 3 Cole Robinson 2016-03-23 17:37:24 EDT
I don't think this is really worth fixing... this seems like one of those 'dont do that' things :) Setting up usb2 with qemu already requires knowing the magic XML incantation to make it work, so it's not like this is intuitive in the first place

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