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.
Description of problem:
'firstport' 0-2 for the companion controllers "-device ich9-usb-ehci1,addr=1d.7,multifunction=on,id=ehci1 -device pci-ohci,addr=1d.0,multifunction=on,masterbus=ehci1.0,firstport=#" does not take effect
Version-Release number of selected component (if applicable):
Host kernel: 3.10.0-306.0.1.el7.ppc64le
Guest kernel: 3.10.0-306.0.1.el7.ppc64le
Qemu-kvm-rhev: qemu-kvm-rhev-2.3.0-22.el7.ppc64le
How reproducible:
100%
Steps to Reproduce:
Boot guests in each steps with following shell script:
# cat ehciohci.sh
#!/bin/sh
CLI="/usr/libexec/qemu-kvm -name virtioblk-0828-le1 -machine pseries,accel=kvm,usb=off -m 2048M -realtime mlock=off -smp 152,sockets=1,cores=20,threads=8 -uuid 95346a10-1828-403a-a610-ac5a52a29415 -no-user-config -nodefaults -monitor stdio -rtc base=utc,clock=host -no-shutdown -boot strict=on -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,format=qcow2,file=/home/virtioblk-0828-le1 -device virtio-blk-pci,id=image1,drive=drive_image1,bus=pci.0,addr=04,bootindex=1 -netdev tap,id=hostnet0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown -device spapr-vlan,netdev=hostnet0,id=net0,mac=52:54:00:c4:e7:15,reg=0x2000 -msg timestamp=on ****-device ich9-usb-ehci1,addr=1d.7,multifunction=on,id=ehci1 -device pci-ohci,addr=1d.0,multifunction=on,masterbus=ehci1.0,firstport=3****"
while [ ${i:=0} -lt ${1:-1} ]
do
CLI="$CLI -drive file=/home/disk/disk$i.qcow2,if=none,id=drive-usb-0-$i,media=disk,format=qcow2,cache=none,aio=native"
CLI="$CLI -device usb-storage,drive=drive-usb-0-$i,id=usb-0-$i,removable=on"
i=$((i+1))
done
$CLI
1. Boot guest with 'firstport=3' as that in the script, and with 10 usb disks; check the usb disks with hmp cmd 'info usb':
# ./ehciohci.sh 10
2. Boot guest by changing 'firstport=0'/'firstport=1'/'firstport=2' in the script in turn, and all with 10 usb disks:
# ./ehciohci.sh 10
3. Boot guest by changing 'firstport=0'/'firstport=1'/'firstport=2' in the script in turn, and all with 6 usb disks; check the usb disks with hmp cmd 'info usb':
# ./ehciohci.sh 6
Actual results:
In step1, can boot up the guest successfully, and the 'info usb' is as follows:
# ./usb-xhci-storage.sh 6
char device redirected to /dev/pts/3 (label charserial0)
QEMU 2.3.0 monitor - type 'help' for more information
(qemu) info usb
Device 0.0, Port 1, Speed 480 Mb/s, Product QEMU USB MSD
Device 0.0, Port 2, Speed 480 Mb/s, Product QEMU USB MSD
Device 0.0, Port 3, Speed 480 Mb/s, Product QEMU USB MSD
Device 0.1, Port 4, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.2, Port 5, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.3, Port 6, Speed 12 Mb/s, Product QEMU USB Hub
Device 0.4, Port 6.1, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.5, Port 6.2, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.6, Port 6.3, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.7, Port 6.4, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.8, Port 6.5, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.9, Port 6.6, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.10, Port 6.7, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.11, Port 6.8, Speed 12 Mb/s, Product QEMU USB Hub
Device 0.12, Port 6.8.1, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.0, Port 6.8.2, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.0, Port 6.8.3, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.0, Port 6.8.4, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.0, Port 6.8.5, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.0, Port 6.8.6, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.0, Port 6.8.7, Speed 12 Mb/s, Product QEMU USB MSD
Device 0.0, Port 6.8.8, Speed 12 Mb/s, Product QEMU USB Hub
Device 0.0, Port 6.8.8.1, Speed 12 Mb/s, Product QEMU USB MSD
In step2, for all 3 tries, all a failure, i.e. could not boot up the guest with following prompt:
# ./usb-xhci-storage.sh 10
char device redirected to /dev/pts/3 (label charserial0)
QEMU 2.3.0 monitor - type 'help' for more information
(qemu) 2015-09-07T10:47:40.620264Z qemu-kvm: -device usb-storage,drive=drive-usb-0-6,id=usb-0-6,removable=on: tried to attach usb device QEMU USB MSD to a bus with no free ports
2015-09-07T10:47:40.620321Z qemu-kvm: -device usb-storage,drive=drive-usb-0-6,id=usb-0-6,removable=on: Device 'usb-storage' could not be initialized
In step3, for all 3 tries, all can boot up the guest successfully, the 'info usb' is as follows:
# ./usb-xhci-storage.sh 6
char device redirected to /dev/pts/3 (label charserial0)
QEMU 2.3.0 monitor - type 'help' for more information
(qemu)
(qemu) info usb
Device 0.0, Port 1, Speed 480 Mb/s, Product QEMU USB MSD
Device 0.0, Port 2, Speed 480 Mb/s, Product QEMU USB MSD
Device 0.0, Port 3, Speed 480 Mb/s, Product QEMU USB MSD
Device 0.0, Port 4, Speed 480 Mb/s, Product QEMU USB MSD
Device 0.0, Port 5, Speed 480 Mb/s, Product QEMU USB MSD
Device 0.0, Port 6, Speed 480 Mb/s, Product QEMU USB MSD
(qemu)
In conclusion, the when 'firstport' for the companion controllers is set to 0-2, it seems take no effect
Expected results:
When 'firstport' for the companion controllers is set to 0-2, it should take effect
Additional info:
Besides, if boot up the guest with 25 or more usb disks, there is always following error:
[root@ibm-p8-rhevm-10 home]# ./ehciohci.sh 25
char device redirected to /dev/pts/1 (label charserial0)
QEMU 2.3.0 monitor - type 'help' for more information
(qemu) ehci: Bad asynchronous state 0. Resetting to active
**
ERROR:hw/usb/hcd-ehci.c:2139:ehci_advance_async_state: code should not be reached
Please note the script name should be 'ehciohci.sh' instead of 'usb-xhci-storage.sh' in the bug Description, I have made a mistake.
BTW, there is bz1261288 pci-ohci related.
It doesn't work better if I change OHCI by UHCI, but it works fine if I use "-readconfig /home/lvivier/Projects/qemu/docs/ich9-ehci-uhci.cfg" from qemu source tree.
Sounds like a command line parameters problem.
(In reply to Laurent Vivier from comment #6)
> It doesn't work better if I change OHCI by UHCI, but it works fine if I use
> "-readconfig /home/lvivier/Projects/qemu/docs/ich9-ehci-uhci.cfg" from qemu
> source tree.
>
> Sounds like a command line parameters problem.
Gu Nini, Can you check this? Thanks.
ehci has 6 ports, ohci has three, so you need two ohci controllers to make things work correctly, like this in libvirt syntax:
<controller type='usb' index='2' model='ich9-ehci1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x7' multifunction='on'/>
</controller>
<controller type='usb' index='2' model='pci-ohci'>
<master startport='0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x0' multifunction='on'/>
</controller>
<controller type='usb' index='2' model='pci-ohci'>
<master startport='3'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x1' multifunction='on'/>
</controller>
which libvirt translates to:
-device ich9-usb-ehci1,id=usb2,bus=pci.0,multifunction=on,addr=0x1d.0x7 -device pci-ohci,masterbus=usb2.0,firstport=0,bus=pci.0,multifunction=on,addr=0x1d -device pciohci,masterbus=usb2.0,firstport=3,bus=pci.0,multifunction=on,addr=0x1d.0x1
(In reply to Karen Noel from comment #7)
> (In reply to Laurent Vivier from comment #6)
> > It doesn't work better if I change OHCI by UHCI, but it works fine if I use
> > "-readconfig /home/lvivier/Projects/qemu/docs/ich9-ehci-uhci.cfg" from qemu
> > source tree.
> >
> > Sounds like a command line parameters problem.
>
> Gu Nini, Can you check this? Thanks.
Yes, it can work now with the way Gerd Hoffmann provided, is there anywhere we can check the usage of this type scenarios, otherwise should we record it to somewhere?
Libvirt does not check if the companion controllers cover all the ports of the master controllers.
*** This bug has been marked as a duplicate of bug 1069590 ***
Description of problem: 'firstport' 0-2 for the companion controllers "-device ich9-usb-ehci1,addr=1d.7,multifunction=on,id=ehci1 -device pci-ohci,addr=1d.0,multifunction=on,masterbus=ehci1.0,firstport=#" does not take effect Version-Release number of selected component (if applicable): Host kernel: 3.10.0-306.0.1.el7.ppc64le Guest kernel: 3.10.0-306.0.1.el7.ppc64le Qemu-kvm-rhev: qemu-kvm-rhev-2.3.0-22.el7.ppc64le How reproducible: 100% Steps to Reproduce: Boot guests in each steps with following shell script: # cat ehciohci.sh #!/bin/sh CLI="/usr/libexec/qemu-kvm -name virtioblk-0828-le1 -machine pseries,accel=kvm,usb=off -m 2048M -realtime mlock=off -smp 152,sockets=1,cores=20,threads=8 -uuid 95346a10-1828-403a-a610-ac5a52a29415 -no-user-config -nodefaults -monitor stdio -rtc base=utc,clock=host -no-shutdown -boot strict=on -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,format=qcow2,file=/home/virtioblk-0828-le1 -device virtio-blk-pci,id=image1,drive=drive_image1,bus=pci.0,addr=04,bootindex=1 -netdev tap,id=hostnet0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown -device spapr-vlan,netdev=hostnet0,id=net0,mac=52:54:00:c4:e7:15,reg=0x2000 -msg timestamp=on ****-device ich9-usb-ehci1,addr=1d.7,multifunction=on,id=ehci1 -device pci-ohci,addr=1d.0,multifunction=on,masterbus=ehci1.0,firstport=3****" while [ ${i:=0} -lt ${1:-1} ] do CLI="$CLI -drive file=/home/disk/disk$i.qcow2,if=none,id=drive-usb-0-$i,media=disk,format=qcow2,cache=none,aio=native" CLI="$CLI -device usb-storage,drive=drive-usb-0-$i,id=usb-0-$i,removable=on" i=$((i+1)) done $CLI 1. Boot guest with 'firstport=3' as that in the script, and with 10 usb disks; check the usb disks with hmp cmd 'info usb': # ./ehciohci.sh 10 2. Boot guest by changing 'firstport=0'/'firstport=1'/'firstport=2' in the script in turn, and all with 10 usb disks: # ./ehciohci.sh 10 3. Boot guest by changing 'firstport=0'/'firstport=1'/'firstport=2' in the script in turn, and all with 6 usb disks; check the usb disks with hmp cmd 'info usb': # ./ehciohci.sh 6 Actual results: In step1, can boot up the guest successfully, and the 'info usb' is as follows: # ./usb-xhci-storage.sh 6 char device redirected to /dev/pts/3 (label charserial0) QEMU 2.3.0 monitor - type 'help' for more information (qemu) info usb Device 0.0, Port 1, Speed 480 Mb/s, Product QEMU USB MSD Device 0.0, Port 2, Speed 480 Mb/s, Product QEMU USB MSD Device 0.0, Port 3, Speed 480 Mb/s, Product QEMU USB MSD Device 0.1, Port 4, Speed 12 Mb/s, Product QEMU USB MSD Device 0.2, Port 5, Speed 12 Mb/s, Product QEMU USB MSD Device 0.3, Port 6, Speed 12 Mb/s, Product QEMU USB Hub Device 0.4, Port 6.1, Speed 12 Mb/s, Product QEMU USB MSD Device 0.5, Port 6.2, Speed 12 Mb/s, Product QEMU USB MSD Device 0.6, Port 6.3, Speed 12 Mb/s, Product QEMU USB MSD Device 0.7, Port 6.4, Speed 12 Mb/s, Product QEMU USB MSD Device 0.8, Port 6.5, Speed 12 Mb/s, Product QEMU USB MSD Device 0.9, Port 6.6, Speed 12 Mb/s, Product QEMU USB MSD Device 0.10, Port 6.7, Speed 12 Mb/s, Product QEMU USB MSD Device 0.11, Port 6.8, Speed 12 Mb/s, Product QEMU USB Hub Device 0.12, Port 6.8.1, Speed 12 Mb/s, Product QEMU USB MSD Device 0.0, Port 6.8.2, Speed 12 Mb/s, Product QEMU USB MSD Device 0.0, Port 6.8.3, Speed 12 Mb/s, Product QEMU USB MSD Device 0.0, Port 6.8.4, Speed 12 Mb/s, Product QEMU USB MSD Device 0.0, Port 6.8.5, Speed 12 Mb/s, Product QEMU USB MSD Device 0.0, Port 6.8.6, Speed 12 Mb/s, Product QEMU USB MSD Device 0.0, Port 6.8.7, Speed 12 Mb/s, Product QEMU USB MSD Device 0.0, Port 6.8.8, Speed 12 Mb/s, Product QEMU USB Hub Device 0.0, Port 6.8.8.1, Speed 12 Mb/s, Product QEMU USB MSD In step2, for all 3 tries, all a failure, i.e. could not boot up the guest with following prompt: # ./usb-xhci-storage.sh 10 char device redirected to /dev/pts/3 (label charserial0) QEMU 2.3.0 monitor - type 'help' for more information (qemu) 2015-09-07T10:47:40.620264Z qemu-kvm: -device usb-storage,drive=drive-usb-0-6,id=usb-0-6,removable=on: tried to attach usb device QEMU USB MSD to a bus with no free ports 2015-09-07T10:47:40.620321Z qemu-kvm: -device usb-storage,drive=drive-usb-0-6,id=usb-0-6,removable=on: Device 'usb-storage' could not be initialized In step3, for all 3 tries, all can boot up the guest successfully, the 'info usb' is as follows: # ./usb-xhci-storage.sh 6 char device redirected to /dev/pts/3 (label charserial0) QEMU 2.3.0 monitor - type 'help' for more information (qemu) (qemu) info usb Device 0.0, Port 1, Speed 480 Mb/s, Product QEMU USB MSD Device 0.0, Port 2, Speed 480 Mb/s, Product QEMU USB MSD Device 0.0, Port 3, Speed 480 Mb/s, Product QEMU USB MSD Device 0.0, Port 4, Speed 480 Mb/s, Product QEMU USB MSD Device 0.0, Port 5, Speed 480 Mb/s, Product QEMU USB MSD Device 0.0, Port 6, Speed 480 Mb/s, Product QEMU USB MSD (qemu) In conclusion, the when 'firstport' for the companion controllers is set to 0-2, it seems take no effect Expected results: When 'firstport' for the companion controllers is set to 0-2, it should take effect Additional info: