From: Andrea Bolognani Date: Tue, 19 Aug 2025 13:18:42 +0000 (+0200) Subject: qemu: Unify USB controllers across Arm architectures X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bfe1aca211a85bcf834ed1fedcfd41b2f7cc938f;p=thirdparty%2Flibvirt.git qemu: Unify USB controllers across Arm architectures Currently we differentiate between 64-bit and 32-bit architectures, which doesn't seem very reasonable considering that the same machine types are available in both cases. Remove this inconsistency. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik Reviewed-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 47ecf56efa..118470fef8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4331,7 +4331,7 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def, return VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT; } - if (def->os.arch == VIR_ARCH_AARCH64) { + if (ARCH_IS_ARM(def->os.arch)) { /* Prefer qemu-xhci or nec-xhci (USB3) */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI)) return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI; diff --git a/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.args b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.args index 8636c54dfe..88fe2b62e8 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.args +++ b/tests/qemuxmlconfdata/usb-controller-default-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":"piix3-usb-uhci","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-default-versatilepb.armv7l-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.xml index e1a607c256..8a12dda0f7 100644 --- a/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.xml +++ b/tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.xml @@ -17,7 +17,7 @@ destroy /usr/bin/qemu-system-armv7l - +
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 499de7a1ce..f6853f6074 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2196,7 +2196,7 @@ mymain(void) DO_TEST_FULL("usb-controller-default-fallback-versatilepb", ".armv7l-latest", ARG_CAPS_ARCH, "armv7l", 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-versatilepb", ".armv7l-latest", ARG_CAPS_ARCH, "armv7l",