
On Thu, Feb 15, 2024 at 02:29:32PM +0100, Peter Krempa wrote:
On Wed, Feb 14, 2024 at 18:11:15 +0100, Andrea Bolognani wrote:
This provides coverage for the scenario in which an attempt is made to use a USB device together with the legacy USB controller.
Note that, while the test case passes, the configuration it produces doesn't actually work:
$ qemu-system-x86_64 -M pc -usb -device usb-tablet,bus=usb.0 Bus 'usb.0' not found
This is because the bus created by the legacy USB controller is automatically assigned ID "usb-bus.0", but libvirt doesn't take this into consideration when assigning addresses to USB devices.
In other words, the legacy USB controller will only work as long as no attempt is made to attach devices to it, which arguably doesn't make for a very useful controller.
Looking at the history the change of the bus name is documented in commit f9618633a86cc74b33f178f05154d4edbc08c0fc :
usb: update docs for bus name change
At some point the default usb bus name changed from 'usb.0' to 'usb-bus.0' (probably as part of the qom conversion). Update the usb documentation accordingly.
Released in qemu-1.5.0. The most likely commit which did the change was 0d936928ef87ca1bb7b41b5b89c400c699a7691c ("convert busses to QOM")
Good spelunking. I didn't go that far back, I just checked that QEMU 4.2.0 also behaved like this.
Thus arguably we can remove support for '-usb' at least for x86_64, but almost certainly for anything else too.
Spoiler: that's exactly what happens a few additional patches in ;) -- Andrea Bolognani / Red Hat / Virtualization