This is another case where the current behavior can be traced
back to the fact that x86 was the only architecture to really
be taken into account for a long time: in reality, using an
Intel-specific USB1 controller for a modern, PCIe-native,
virtualization-friendly Arm guest just doesn't make any sense.

Remove this fallback. All virt machine types now behave the
same across architectures.

Signed-off-by: Andrea Bolognani <abolo...@redhat.com>
---
 src/qemu/qemu_domain.c                               |  1 +
 ...default-fallback-virt-aarch64.aarch64-latest.args |  5 ++---
 ...-default-fallback-virt-aarch64.aarch64-latest.xml | 12 ++++--------
 tests/qemuxmlconftest.c                              |  4 ++--
 4 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 529acefbd7..df64ddbec1 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4322,6 +4322,7 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef 
*def,
     bool abiUpdate = !!(parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE);
 
     if (ARCH_IS_LOONGARCH(def->os.arch) ||
+        qemuDomainIsARMVirt(def) ||
         qemuDomainIsRISCVVirt(def)) {
         /* Use USB3 for modern architectures */
         if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI))
diff --git 
a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.args
 
b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.args
index 63ea7be2aa..44689d81f9 100644
--- 
a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.args
+++ 
b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.args
@@ -27,9 +27,8 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \
 -no-shutdown \
 -boot strict=on \
 -device 
'{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}'
 \
--device '{"driver":"pcie-pci-bridge","id":"pci.2","bus":"pci.1","addr":"0x0"}' 
\
--device 
'{"driver":"pcie-root-port","port":9,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x1"}'
 \
--device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.2","addr":"0x1"}' \
+-device 
'{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}'
 \
+-device '{"driver":"nec-usb-xhci","id":"usb","bus":"pci.1","addr":"0x0"}' \
 -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-virt-aarch64.aarch64-latest.xml
 
b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.xml
index cea6dde62d..943c433f40 100644
--- 
a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.xml
+++ 
b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-aarch64.aarch64-latest.xml
@@ -20,8 +20,8 @@
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-aarch64</emulator>
-    <controller type='usb' index='0' model='piix3-uhci'>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' 
function='0x0'/>
+    <controller type='usb' index='0' model='nec-xhci'>
+      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 
function='0x0'/>
     </controller>
     <controller type='pci' index='0' model='pcie-root'/>
     <controller type='pci' index='1' model='pcie-root-port'>
@@ -29,13 +29,9 @@
       <target chassis='1' port='0x8'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x0' multifunction='on'/>
     </controller>
-    <controller type='pci' index='2' model='pcie-to-pci-bridge'>
-      <model name='pcie-pci-bridge'/>
-      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' 
function='0x0'/>
-    </controller>
-    <controller type='pci' index='3' model='pcie-root-port'>
+    <controller type='pci' index='2' model='pcie-root-port'>
       <model name='pcie-root-port'/>
-      <target chassis='3' port='0x9'/>
+      <target chassis='2' port='0x9'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x1'/>
     </controller>
     <audio id='1' type='none'/>
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
index 439aa42e6b..84e37c4cb3 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -2019,13 +2019,13 @@ mymain(void)
     DO_TEST_FULL("usb-controller-default-fallback-virt-aarch64", 
".aarch64-latest",
                  ARG_CAPS_ARCH, "aarch64",
                  ARG_CAPS_VER, "latest",
-                 ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, 
QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_LAST,
+                 ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, QEMU_CAPS_LAST,
                  ARG_END);
     DO_TEST_FULL("usb-controller-default-unavailable-virt-aarch64", 
".aarch64-latest",
                  ARG_CAPS_ARCH, "aarch64",
                  ARG_CAPS_VER, "latest",
                  ARG_FLAGS, FLAG_EXPECT_PARSE_ERROR,
-                 ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, 
QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_PCI_OHCI, 
QEMU_CAPS_LAST,
+                 ARG_QEMU_CAPS_DEL, QEMU_CAPS_DEVICE_QEMU_XHCI, 
QEMU_CAPS_NEC_USB_XHCI, QEMU_CAPS_LAST,
                  ARG_END);
 
     DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-virt-riscv64", "riscv64");
-- 
2.50.1

Reply via email to