This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1006894 - Inconsistent behavior while autoassigning usb ports
Inconsistent behavior while autoassigning usb ports
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: qemu (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Fedora Virtualization Maintainers
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-11 09:16 EDT by Lukas Doktor
Modified: 2014-06-16 08:02 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-04 04:06:30 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)

  None (edit)
Description Lukas Doktor 2013-09-11 09:16:05 EDT
Description of problem:
Hi guys, I found another inconsistency, which confuses me. When I add usb-bus and than plug some devices into this bus without specifying port it assigns them incrementally (1, 2, 3, 4, 5, ...). Anyway when I remove the device and than try to add them again, it assigns them in the different manner. (from what I've seen it's the opposite order of the removed devices).

I'd like to ask if this is something we intend to unify or if I should just always assign port and not trust qemu to do it incrementally?

Version-Release number of selected component (if applicable):
qemu-kvm-1.4.2-7.fc19.x86_64


How reproducible:
Always


Steps to Reproduce (UHCI):
1. echo -e "device_add usb-tablet,bus=uhci.0,id=aa\ndevice_add usb-tablet,bus=uhci.0,id=bb,port=2\ndevice_del aa\ndevice_del bb\ndevice_add usb-tablet,bus=uhci.0,id=aa\ndevice_add usb-tablet,bus=uhci.0,id=bb,port=2" | qemu-kvm -nodefaults -monitor stdio     -device ich9-usb-uhci1,id=uhci
2. echo -e "device_add usb-tablet,bus=uhci.0,id=aa\ndevice_add usb-tablet,bus=uhci.0,id=bb,port=2\ndevice_del bb\ndevice_del aa\ndevice_add usb-tablet,bus=uhci.0,id=aa\ndevice_add usb-tablet,bus=uhci.0,id=bb,port=2" | qemu-kvm -nodefaults -monitor stdio     -device ich9-usb-uhci1,id=uhci


Actual results:
Step 1 passes (adds 2 devices, removes them and add them again in the same order)
Step 2 fails (adds 2 devices, removes them and while adding them again it assigns the last port first)


Steps to Reproduce (EHCI):
1. echo -e "device_add usb-tablet,bus=ehci.0,id=aa\ndevice_add usb-tablet,bus=ehci.0,id=bb\ndevice_add usb-tablet,bus=ehci.0,id=cc\ndevice_add usb-tablet,bus=ehci.0,id=dd\ndevice_add usb-tablet,bus=ehci.0,id=ee\ndevice_add usb-tablet,bus=ehci.0,id=ff,port=6\ndevice_del aa\ndevice_del bb\ndevice_del cc\ndevice_del dd\ndevice_del ee\ndevice_del ff\ndevice_add usb-tablet,bus=ehci.0,id=aa\ndevice_add usb-tablet,bus=ehci.0,id=bb\ndevice_add usb-tablet,bus=ehci.0,id=cc\ndevice_add usb-tablet,bus=ehci.0,id=dd\ndevice_add usb-tablet,bus=ehci.0,id=ee\ndevice_add usb-tablet,bus=ehci.0,id=ff,port=6" | qemu-kvm -nodefaults -monitor stdio     -device usb-ehci,id=ehci
2. echo -e "device_add usb-tablet,bus=ehci.0,id=aa\ndevice_add usb-tablet,bus=ehci.0,id=bb\ndevice_add usb-tablet,bus=ehci.0,id=cc\ndevice_add usb-tablet,bus=ehci.0,id=dd\ndevice_add usb-tablet,bus=ehci.0,id=ee\ndevice_add usb-tablet,bus=ehci.0,id=ff,port=6\ndevice_del ff\ndevice_del ee\ndevice_del dd\ndevice_del cc\ndevice_del bb\ndevice_del aa\ndevice_add usb-tablet,bus=ehci.0,id=aa\ndevice_add usb-tablet,bus=ehci.0,id=bb\ndevice_add usb-tablet,bus=ehci.0,id=cc\ndevice_add usb-tablet,bus=ehci.0,id=dd\ndevice_add usb-tablet,bus=ehci.0,id=ee\ndevice_add usb-tablet,bus=ehci.0,id=ff,port=6" | qemu-kvm -nodefaults -monitor stdio     -device usb-ehci,id=ehci


Actual results:
Step 1 passes (adds 6 devices, removes them and add them again in the same order)
Step 2 fails (adds 6 devices, removes them and while adding them again it assigns the last port first)


Expected results:
usb port should assigns the port incrementally (or am I wrong?). Why does it matter where from I remove the device?


Additional info:
The only difference between step 1 and step 2 are reversed order of device_del.
Comment 1 Cole Robinson 2013-10-31 16:53:45 EDT
Hans, Gerd, care to weigh in?(In reply to Lukas Doktor from comment #0)
> Description of problem:
> Hi guys, I found another inconsistency, which confuses me. When I add
> usb-bus and than plug some devices into this bus without specifying port it
> assigns them incrementally (1, 2, 3, 4, 5, ...). Anyway when I remove the
> device and than try to add them again, it assigns them in the different
> manner. (from what I've seen it's the opposite order of the removed devices).
> 
> I'd like to ask if this is something we intend to unify or if I should just
> always assign port and not trust qemu to do it incrementally?

Hans, Gerd, care to weigh in?
Comment 2 Gerd Hoffmann 2013-11-04 04:06:30 EST
If you want a specific port assigning, just explicitly say so.

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