From 21e584a4fb42a2d9df0e4cc9a85ae9ba366bd030 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Thu, 25 Sep 2025 14:04:15 +0200 Subject: [PATCH] qemu: Don't special-case realview/versatilebp for USB MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We have special behavior for these two machine types, and more specifically for the USB controller that they get added by default - something that doesn't generally happen on Arm. Not only this is inconsistent with other machine types for the architecture, it also means that the model for the USB controller that gets added automatically (pci-ohci, USB1) is worse than the default one for user-added USB controllers (qemu-xhci, USB3) which is just silly. Bring these machine types in line with the rest of the architecture. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik Reviewed-by: Peter Krempa Reviewed-by: Ján Tomko --- src/qemu/qemu_domain.c | 7 ------- ...aarch64-realview-minimal.aarch64-latest.abi-update.args | 2 +- .../aarch64-realview-minimal.aarch64-latest.abi-update.xml | 2 +- .../aarch64-realview-minimal.aarch64-latest.args | 2 +- .../aarch64-realview-minimal.aarch64-latest.xml | 2 +- ...rmv7l-versatilepb-minimal.armv7l-latest.abi-update.args | 2 +- ...armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml | 2 +- .../armv7l-versatilepb-minimal.armv7l-latest.args | 2 +- .../armv7l-versatilepb-minimal.armv7l-latest.xml | 2 +- .../usb-controller-automatic-realview.aarch64-latest.args | 2 +- .../usb-controller-automatic-realview.aarch64-latest.xml | 2 +- ...usb-controller-automatic-versatilepb.armv7l-latest.args | 2 +- .../usb-controller-automatic-versatilepb.armv7l-latest.xml | 2 +- ...ontroller-default-fallback-realview.aarch64-latest.args | 2 +- ...controller-default-fallback-realview.aarch64-latest.xml | 2 +- tests/qemuxmlconftest.c | 2 +- 16 files changed, 15 insertions(+), 22 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 118470fef8..9927ab3cbb 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4434,13 +4434,6 @@ qemuDomainDefaultUSBControllerModelAutoAdded(const virDomainDef *def, } } - if (ARCH_IS_ARM(def->os.arch)) { - if (STREQ(def->os.machine, "versatilepb") || - STRPREFIX(def->os.machine, "realview-eb")) - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_PCI_OHCI)) - return VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI; - } - return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; } diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args index 0d956241fc..ccbff79f35 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml index c31c7b2bbc..056e5e56a8 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml @@ -15,7 +15,7 @@ destroy /usr/bin/qemu-system-aarch64 - +
diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args index 0d956241fc..ccbff79f35 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml index c31c7b2bbc..056e5e56a8 100644 --- a/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml @@ -15,7 +15,7 @@ destroy /usr/bin/qemu-system-aarch64 - +
diff --git a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.args b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.args index a05a413290..88fe2b62e8 100644 --- a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.args +++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml index 7b21b24927..a9da2a3b13 100644 --- a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml +++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml @@ -17,7 +17,7 @@ destroy /usr/bin/qemu-system-armv7l - +
diff --git a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args index a05a413290..88fe2b62e8 100644 --- a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args +++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml index 7b21b24927..a9da2a3b13 100644 --- a/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml @@ -17,7 +17,7 @@ destroy /usr/bin/qemu-system-armv7l - +
diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args index 0d956241fc..ccbff79f35 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml index 250da1b5e0..8bb25de20a 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml @@ -15,7 +15,7 @@ destroy /usr/bin/qemu-system-aarch64 - +
diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.args b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.args index a05a413290..88fe2b62e8 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.args @@ -26,7 +26,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-armv7ltest/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.xml index 482029e3b0..8a12dda0f7 100644 --- a/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.xml @@ -17,7 +17,7 @@ destroy /usr/bin/qemu-system-armv7l - +
diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args index ccbff79f35..0d956241fc 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args @@ -25,7 +25,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \ -rtc base=utc \ -no-shutdown \ -boot strict=on \ --device '{"driver":"qemu-xhci","id":"usb","bus":"pci","addr":"0x1"}' \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci","addr":"0x1"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml index 8bb25de20a..250da1b5e0 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml @@ -15,7 +15,7 @@ destroy /usr/bin/qemu-system-aarch64 - +
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index f6853f6074..0bf4afbf24 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2209,7 +2209,7 @@ mymain(void) DO_TEST_FULL("usb-controller-default-fallback-realview", ".aarch64-latest", ARG_CAPS_ARCH, "aarch64", ARG_CAPS_VER, "latest", - ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST, + ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST, ARG_END); DO_TEST_FULL("usb-controller-default-unavailable-realview", ".aarch64-latest", ARG_CAPS_ARCH, "aarch64", -- 2.47.3