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.
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?