[PATCH v2 34/38] qemu: Unify USB controllers across Arm architectures

Andrea Bolognani via Devel posted 38 patches 1 week, 2 days ago
[PATCH v2 34/38] qemu: Unify USB controllers across Arm architectures
Posted by Andrea Bolognani via Devel 1 week, 2 days ago
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 <abologna@redhat.com>
---
 src/qemu/qemu_domain.c                                          | 2 +-
 .../usb-controller-default-versatilepb.armv7l-latest.args       | 2 +-
 .../usb-controller-default-versatilepb.armv7l-latest.xml        | 2 +-
 tests/qemuxmlconftest.c                                         | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

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 @@
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-armv7l</emulator>
-    <controller type='usb' index='0' model='piix3-uhci'>
+    <controller type='usb' index='0' model='qemu-xhci'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
     </controller>
     <controller type='pci' index='0' model='pci-root'/>
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index 7b80e0c528..abe5609889 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -2179,7 +2179,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",
-- 
2.51.0
Re: [PATCH v2 34/38] qemu: Unify USB controllers across Arm architectures
Posted by Peter Krempa via Devel 1 day, 11 hours ago
On Thu, Sep 25, 2025 at 20:07:20 +0200, Andrea Bolognani via Devel wrote:
> 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 <abologna@redhat.com>
> ---
>  src/qemu/qemu_domain.c                                          | 2 +-
>  .../usb-controller-default-versatilepb.armv7l-latest.args       | 2 +-
>  .../usb-controller-default-versatilepb.armv7l-latest.xml        | 2 +-
>  tests/qemuxmlconftest.c                                         | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>