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")
Thus arguably we can remove support for '-usb' at least for x86_64, but
almost certainly for anything else too.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
.../usb-legacy-device.x86_64-latest.args | 33 +++++++++++++++++++
.../usb-legacy-device.x86_64-latest.xml | 30 +++++++++++++++++
tests/qemuxmlconfdata/usb-legacy-device.xml | 15 +++++++++
tests/qemuxmlconftest.c | 5 +++
4 files changed, 83 insertions(+)
create mode 100644 tests/qemuxmlconfdata/usb-legacy-device.x86_64-latest.args
create mode 100644 tests/qemuxmlconfdata/usb-legacy-device.x86_64-latest.xml
create mode 100644 tests/qemuxmlconfdata/usb-legacy-device.xml
Preliminarily:
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>
and I'll see how this changes after the patches reworking the code.