]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Unify USB controllers across Arm architectures
authorAndrea Bolognani <abologna@redhat.com>
Tue, 19 Aug 2025 13:18:42 +0000 (15:18 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 6 Oct 2025 09:16:27 +0000 (11:16 +0200)
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>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c
tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.args
tests/qemuxmlconfdata/usb-controller-default-versatilepb.armv7l-latest.xml
tests/qemuxmlconftest.c

index 47ecf56efa67df0454f74b4911349f34ef2aa6cb..118470fef874c96f77c3a981c804cb2eb8f0e4c5 100644 (file)
@@ -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;
index 8636c54dfe119053d5b9a35b259ae8a7c18c9fca..88fe2b62e8d815d24eb119c74a111598139abf1c 100644 (file)
@@ -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
index e1a607c25663a769f00fcb65fd1ba199c932806c..8a12dda0f702c6494129f90d29c32cf0bce48c57 100644 (file)
@@ -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'/>
index 499de7a1ced781847b66bbf948a6c26d6eaca7a7..f6853f6074444ae614aa0d108513fd270815e969 100644 (file)
@@ -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",