]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Don't special-case realview/versatilebp for USB
authorAndrea Bolognani <abologna@redhat.com>
Thu, 25 Sep 2025 12:04:15 +0000 (14:04 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 6 Oct 2025 09:16:29 +0000 (11:16 +0200)
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 <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>
16 files changed:
src/qemu/qemu_domain.c
tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.args
tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.abi-update.xml
tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.args
tests/qemuxmlconfdata/aarch64-realview-minimal.aarch64-latest.xml
tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.args
tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.abi-update.xml
tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.args
tests/qemuxmlconfdata/armv7l-versatilepb-minimal.armv7l-latest.xml
tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.args
tests/qemuxmlconfdata/usb-controller-automatic-realview.aarch64-latest.xml
tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.args
tests/qemuxmlconfdata/usb-controller-automatic-versatilepb.armv7l-latest.xml
tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.args
tests/qemuxmlconfdata/usb-controller-default-fallback-realview.aarch64-latest.xml
tests/qemuxmlconftest.c

index 118470fef874c96f77c3a981c804cb2eb8f0e4c5..9927ab3cbb6570a2fa5c04e5e0d30ec491758a7c 100644 (file)
@@ -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;
 }
 
index 0d956241fceada77bdee50eaf844b2af7fe9404e..ccbff79f3578ddf4696bf8ec0117b6d57617e89b 100644 (file)
@@ -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
index c31c7b2bbc806d6da35dad0bca17d530b08a2ae0..056e5e56a842e840287d9f3664885adc8a246a57 100644 (file)
@@ -15,7 +15,7 @@
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
-    <controller type='usb' index='0' model='pci-ohci'>
+    <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 0d956241fceada77bdee50eaf844b2af7fe9404e..ccbff79f3578ddf4696bf8ec0117b6d57617e89b 100644 (file)
@@ -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
index c31c7b2bbc806d6da35dad0bca17d530b08a2ae0..056e5e56a842e840287d9f3664885adc8a246a57 100644 (file)
@@ -15,7 +15,7 @@
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
-    <controller type='usb' index='0' model='pci-ohci'>
+    <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 a05a4132903b0ce0e1ff3b4e09a66ae876387406..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":"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
index 7b21b249273c8d0ac0cc6beb89673aac198e6eb9..a9da2a3b13cc341bb9158f45b50aedcb28a11266 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='pci-ohci'>
+    <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 a05a4132903b0ce0e1ff3b4e09a66ae876387406..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":"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
index 7b21b249273c8d0ac0cc6beb89673aac198e6eb9..a9da2a3b13cc341bb9158f45b50aedcb28a11266 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='pci-ohci'>
+    <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 0d956241fceada77bdee50eaf844b2af7fe9404e..ccbff79f3578ddf4696bf8ec0117b6d57617e89b 100644 (file)
@@ -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
index 250da1b5e01cd22b10a218be585d08ac572d6ac0..8bb25de20ae1d7abe756a75db113326f5343843b 100644 (file)
@@ -15,7 +15,7 @@
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
-    <controller type='usb' index='0' model='pci-ohci'>
+    <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 a05a4132903b0ce0e1ff3b4e09a66ae876387406..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":"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
index 482029e3b09aec8397b8ca8984208bb6aaec2375..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='pci-ohci'>
+    <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 ccbff79f3578ddf4696bf8ec0117b6d57617e89b..0d956241fceada77bdee50eaf844b2af7fe9404e 100644 (file)
@@ -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
index 8bb25de20ae1d7abe756a75db113326f5343843b..250da1b5e01cd22b10a218be585d08ac572d6ac0 100644 (file)
@@ -15,7 +15,7 @@
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
-    <controller type='usb' index='0' model='qemu-xhci'>
+    <controller type='usb' index='0' model='pci-ohci'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
     </controller>
     <controller type='pci' index='0' model='pci-root'/>
index f6853f6074444ae614aa0d108513fd270815e969..0bf4afbf242780d89a7cfd3c497ecff62f220f12 100644 (file)
@@ -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",