Code:
qemu-system-x86_64 -m 512M -cdrom debian-10.6.0-amd64-netinst.iso -s -serial mon:stdio -device qemu-xhci,id=xhci -device usb-mouse,bus=xhci.0 -device usb-mouse,bus=xhci.0 -device usb-mouse,bus=xhci.0 -device usb-mouse,bus=xhci.0
QEMU 5.1.50 monitor - type 'help' for more information
(qemu) stop
(qemu) info usb
Device 0.1, Port 1, Speed 480 Mb/s, Product QEMU USB Mouse
Device 0.4, Port 2, Speed 480 Mb/s, Product QEMU USB Mouse
Device 0.3, Port 3, Speed 480 Mb/s, Product QEMU USB Mouse
Device 0.2, Port 4, Speed 12 Mb/s, Product QEMU USB Hub
Device 0.5, Port 4.1, Speed 12 Mb/s, Product QEMU USB Mouse
After increasing the # of ports:
Code:
qemu-system-x86_64 -m 512M -cdrom debian-10.6.0-amd64-netinst.iso -s -serial mon:stdio -device qemu-xhci,p2=8,p3=8,id=xhci -device usb-mouse,bus=xhci.0 -device usb-mouse,bus=xhci.0 -device usb-mouse,bus=xhci.0 -device usb-mouse,bus=xhci.0 -enable-kvm
QEMU 5.1.50 monitor - type 'help' for more information
(qemu) stop
(qemu) info usb
Device 0.1, Port 1, Speed 480 Mb/s, Product QEMU USB Mouse
Device 0.4, Port 2, Speed 480 Mb/s, Product QEMU USB Mouse
Device 0.3, Port 3, Speed 480 Mb/s, Product QEMU USB Mouse
Device 0.2, Port 4, Speed 480 Mb/s, Product QEMU USB Mouse
(qemu)
With usb-hub, but unfortunately v1.1 only
Code:
qemu-system-x86_64 -m 512M -cdrom debian-10.6.0-amd64-netinst.iso -s -serial mon:stdio -device qemu-xhci,p2=8,p3=8,id=xhci -device usb-mouse,bus=xhci.0 -device usb-mouse,bus=xhci.0 -device usb-mouse,bus=xhci.0 -device usb-hub,bus=xhci.0,port=4 -device usb-mouse,bus=xhci.0,port=4.4 -enable-kvm
QEMU 5.1.50 monitor - type 'help' for more information
(qemu) info usb
Device 0.1, Port 1, Speed 480 Mb/s, Product QEMU USB Mouse
Device 0.4, Port 2, Speed 480 Mb/s, Product QEMU USB Mouse
Device 0.3, Port 3, Speed 480 Mb/s, Product QEMU USB Mouse
Device 0.2, Port 4, Speed 12 Mb/s, Product QEMU USB Hub
Device 0.5, Port 4.4, Speed 12 Mb/s, Product QEMU USB Mouse
The location, on the commandline, of usb-hub relative to other consumers of the bus affects the upstream port=## parameter for the hub device.
[1]
https://www.kraxel.org/blog/2018/08/qemu-usb-tips/[2]
https://github.com/qemu/qemu/blob/master/docs/usb2.txt