[PATCH v2 33/38] qemu: Use qemu-xhci with no fallback on RISC-V

Andrea Bolognani via Devel posted 38 patches 1 week, 2 days ago
[PATCH v2 33/38] qemu: Use qemu-xhci with no fallback on RISC-V
Posted by Andrea Bolognani via Devel 1 week, 2 days ago
Similar to loongarch64, the current behavior is a result
of the way the existing code was written rather than a
consequence of an intentional choice. Make the two
architectures behave the same way, as they should have
from the start.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 src/qemu/qemu_domain.c                        |  3 +-
 ...ault-models.riscv64-latest.abi-update.args | 15 ++++---
 ...fault-models.riscv64-latest.abi-update.xml | 26 +++++-------
 ...64-virt-default-models.riscv64-latest.args | 15 ++++---
 ...v64-virt-default-models.riscv64-latest.xml | 26 +++++-------
 ...-fallback-virt-riscv64.riscv64-latest.args | 35 ----------------
 ...t-fallback-virt-riscv64.riscv64-latest.xml | 41 -------------------
 ...ntroller-default-fallback-virt-riscv64.xml |  1 -
 ...r-default-virt-riscv64.riscv64-latest.args |  5 +--
 ...er-default-virt-riscv64.riscv64-latest.xml | 12 ++----
 tests/qemuxmlconftest.c                       |  5 ---
 11 files changed, 44 insertions(+), 140 deletions(-)
 delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.args
 delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.xml
 delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.xml

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 39a54b8009..47ecf56efa 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4322,7 +4322,8 @@ qemuDomainDefaultUSBControllerModel(const virDomainDef *def,
 {
     bool abiUpdate = !!(parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE);
 
-    if (ARCH_IS_LOONGARCH(def->os.arch)) {
+    if (ARCH_IS_LOONGARCH(def->os.arch) ||
+        qemuDomainIsRISCVVirt(def)) {
         /* Use qemu-xhci (USB3) with no fallback */
         if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QEMU_XHCI))
             return VIR_DOMAIN_CONTROLLER_MODEL_USB_QEMU_XHCI;
diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.args b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.args
index 00ecc83126..99e1946d98 100644
--- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.args
+++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.args
@@ -28,20 +28,19 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
 -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-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \
--device '{"driver":"pcie-pci-bridge","id":"pci.3","bus":"pci.1","addr":"0x0"}' \
--device '{"driver":"pcie-root-port","port":10,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x2"}' \
--device '{"driver":"pcie-root-port","port":11,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x1.0x3"}' \
--device '{"driver":"pcie-root-port","port":12,"chassis":6,"id":"pci.6","bus":"pcie.0","addr":"0x1.0x4"}' \
--device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.3","addr":"0x1"}' \
--device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.4","addr":"0x0"}' \
+-device '{"driver":"pcie-root-port","port":10,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x2"}' \
+-device '{"driver":"pcie-root-port","port":11,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x3"}' \
+-device '{"driver":"pcie-root-port","port":12,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x1.0x4"}' \
+-device '{"driver":"qemu-xhci","id":"usb","bus":"pci.2","addr":"0x0"}' \
+-device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.3","addr":"0x0"}' \
 -netdev '{"type":"user","id":"hostnet0"}' \
--device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.2","addr":"0x0"}' \
+-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \
 -chardev pty,id=charserial0 \
 -serial chardev:charserial0 \
 -chardev socket,id=chrtpm,path=/dev/test \
 -tpmdev emulator,id=tpm-tpm0,chardev=chrtpm \
 -device '{"driver":"tpm-tis-device","tpmdev":"tpm-tpm0","id":"tpm0"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.5","addr":"0x0"}' \
+-device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.4","addr":"0x0"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml
index 4543364c89..620da73422 100644
--- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml
+++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.abi-update.xml
@@ -17,11 +17,11 @@
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-riscv64</emulator>
-    <controller type='usb' index='0' model='piix3-uhci'>
-      <address type='pci' domain='0x0000' bus='0x03' slot='0x01' function='0x0'/>
+    <controller type='usb' index='0' model='qemu-xhci'>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
     </controller>
     <controller type='scsi' index='0' model='virtio-scsi'>
-      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
     </controller>
     <controller type='pci' index='0' model='pcie-root'/>
     <controller type='pci' index='1' model='pcie-root-port'>
@@ -34,29 +34,25 @@
       <target chassis='2' port='0x9'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
     </controller>
-    <controller type='pci' index='3' 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='4' model='pcie-root-port'>
+    <controller type='pci' index='3' model='pcie-root-port'>
       <model name='pcie-root-port'/>
-      <target chassis='4' port='0xa'/>
+      <target chassis='3' port='0xa'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
-    <controller type='pci' index='5' model='pcie-root-port'>
+    <controller type='pci' index='4' model='pcie-root-port'>
       <model name='pcie-root-port'/>
-      <target chassis='5' port='0xb'/>
+      <target chassis='4' port='0xb'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/>
     </controller>
-    <controller type='pci' index='6' model='pcie-root-port'>
+    <controller type='pci' index='5' model='pcie-root-port'>
       <model name='pcie-root-port'/>
-      <target chassis='6' port='0xc'/>
+      <target chassis='5' port='0xc'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x4'/>
     </controller>
     <interface type='user'>
       <mac address='52:54:00:09:a4:37'/>
       <model type='virtio'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
     </interface>
     <serial type='pty'>
       <target type='system-serial' port='0'>
@@ -72,7 +68,7 @@
     <audio id='1' type='none'/>
     <video>
       <model type='virtio' heads='1' primary='yes'/>
-      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
     </video>
     <memballoon model='none'/>
   </devices>
diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args
index 00ecc83126..99e1946d98 100644
--- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args
+++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.args
@@ -28,20 +28,19 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
 -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-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \
--device '{"driver":"pcie-pci-bridge","id":"pci.3","bus":"pci.1","addr":"0x0"}' \
--device '{"driver":"pcie-root-port","port":10,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x2"}' \
--device '{"driver":"pcie-root-port","port":11,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x1.0x3"}' \
--device '{"driver":"pcie-root-port","port":12,"chassis":6,"id":"pci.6","bus":"pcie.0","addr":"0x1.0x4"}' \
--device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.3","addr":"0x1"}' \
--device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.4","addr":"0x0"}' \
+-device '{"driver":"pcie-root-port","port":10,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x2"}' \
+-device '{"driver":"pcie-root-port","port":11,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x3"}' \
+-device '{"driver":"pcie-root-port","port":12,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x1.0x4"}' \
+-device '{"driver":"qemu-xhci","id":"usb","bus":"pci.2","addr":"0x0"}' \
+-device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.3","addr":"0x0"}' \
 -netdev '{"type":"user","id":"hostnet0"}' \
--device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.2","addr":"0x0"}' \
+-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}' \
 -chardev pty,id=charserial0 \
 -serial chardev:charserial0 \
 -chardev socket,id=chrtpm,path=/dev/test \
 -tpmdev emulator,id=tpm-tpm0,chardev=chrtpm \
 -device '{"driver":"tpm-tis-device","tpmdev":"tpm-tpm0","id":"tpm0"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
--device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.5","addr":"0x0"}' \
+-device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.4","addr":"0x0"}' \
 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
 -msg timestamp=on
diff --git a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml
index 4543364c89..620da73422 100644
--- a/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml
+++ b/tests/qemuxmlconfdata/riscv64-virt-default-models.riscv64-latest.xml
@@ -17,11 +17,11 @@
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-riscv64</emulator>
-    <controller type='usb' index='0' model='piix3-uhci'>
-      <address type='pci' domain='0x0000' bus='0x03' slot='0x01' function='0x0'/>
+    <controller type='usb' index='0' model='qemu-xhci'>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
     </controller>
     <controller type='scsi' index='0' model='virtio-scsi'>
-      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
     </controller>
     <controller type='pci' index='0' model='pcie-root'/>
     <controller type='pci' index='1' model='pcie-root-port'>
@@ -34,29 +34,25 @@
       <target chassis='2' port='0x9'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
     </controller>
-    <controller type='pci' index='3' 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='4' model='pcie-root-port'>
+    <controller type='pci' index='3' model='pcie-root-port'>
       <model name='pcie-root-port'/>
-      <target chassis='4' port='0xa'/>
+      <target chassis='3' port='0xa'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
-    <controller type='pci' index='5' model='pcie-root-port'>
+    <controller type='pci' index='4' model='pcie-root-port'>
       <model name='pcie-root-port'/>
-      <target chassis='5' port='0xb'/>
+      <target chassis='4' port='0xb'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3'/>
     </controller>
-    <controller type='pci' index='6' model='pcie-root-port'>
+    <controller type='pci' index='5' model='pcie-root-port'>
       <model name='pcie-root-port'/>
-      <target chassis='6' port='0xc'/>
+      <target chassis='5' port='0xc'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x4'/>
     </controller>
     <interface type='user'>
       <mac address='52:54:00:09:a4:37'/>
       <model type='virtio'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
     </interface>
     <serial type='pty'>
       <target type='system-serial' port='0'>
@@ -72,7 +68,7 @@
     <audio id='1' type='none'/>
     <video>
       <model type='virtio' heads='1' primary='yes'/>
-      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
     </video>
     <memballoon model='none'/>
   </devices>
diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.args
deleted file mode 100644
index 8911094464..0000000000
--- a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.args
+++ /dev/null
@@ -1,35 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/var/lib/libvirt/qemu/domain--1-test \
-USER=test \
-LOGNAME=test \
-XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-test/.local/share \
-XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-test/.cache \
-XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-test/.config \
-/usr/bin/qemu-system-riscv64 \
--name guest=test,debug-threads=on \
--S \
--object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-test/master-key.aes"}' \
--machine virt,usb=off,dump-guest-core=off,memory-backend=riscv_virt_board.ram,acpi=off \
--accel tcg \
--cpu rv64 \
--m size=2097152k \
--object '{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":2147483648}' \
--overcommit mem-lock=off \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid 11dbdcdd-4c3b-482b-8903-9bdb8c0a2774 \
--display none \
--no-user-config \
--nodefaults \
--chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--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":"pci-ohci","id":"usb","bus":"pci.2","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-fallback-virt-riscv64.riscv64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.xml
deleted file mode 100644
index 2b77091c66..0000000000
--- a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<domain type='qemu'>
-  <name>test</name>
-  <uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid>
-  <memory unit='KiB'>2097152</memory>
-  <currentMemory unit='KiB'>2097152</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='riscv64' machine='virt'>hvm</type>
-    <boot dev='hd'/>
-  </os>
-  <cpu mode='custom' match='exact' check='none'>
-    <model fallback='forbid'>rv64</model>
-  </cpu>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>destroy</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu-system-riscv64</emulator>
-    <controller type='usb' index='0' model='pci-ohci'>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
-    </controller>
-    <controller type='pci' index='0' model='pcie-root'/>
-    <controller type='pci' index='1' model='pcie-root-port'>
-      <model name='pcie-root-port'/>
-      <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'>
-      <model name='pcie-root-port'/>
-      <target chassis='3' port='0x9'/>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
-    </controller>
-    <audio id='1' type='none'/>
-    <memballoon model='none'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.xml b/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.xml
deleted file mode 120000
index 061240f8f2..0000000000
--- a/tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.xml
+++ /dev/null
@@ -1 +0,0 @@
-usb-controller-default-virt-riscv64.xml
\ No newline at end of file
diff --git a/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.args b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.args
index 20ef922cf6..a0f79e499e 100644
--- a/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.args
+++ b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-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":"qemu-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-virt-riscv64.riscv64-latest.xml b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.xml
index 28f2c9eca4..641ea6c3d9 100644
--- a/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.xml
+++ b/tests/qemuxmlconfdata/usb-controller-default-virt-riscv64.riscv64-latest.xml
@@ -17,8 +17,8 @@
   <on_crash>destroy</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-riscv64</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='qemu-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'>
@@ -26,13 +26,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 1232892c9b..7b80e0c528 100644
--- a/tests/qemuxmlconftest.c
+++ b/tests/qemuxmlconftest.c
@@ -2167,11 +2167,6 @@ mymain(void)
                  ARG_END);
 
     DO_TEST_CAPS_ARCH_LATEST("usb-controller-default-virt-riscv64", "riscv64");
-    DO_TEST_FULL("usb-controller-default-fallback-virt-riscv64", ".riscv64-latest",
-                 ARG_CAPS_ARCH, "riscv64",
-                 ARG_CAPS_VER, "latest",
-                 ARG_QEMU_CAPS_DEL, QEMU_CAPS_PIIX3_USB_UHCI, QEMU_CAPS_LAST,
-                 ARG_END);
     DO_TEST_FULL("usb-controller-default-unavailable-virt-riscv64", ".riscv64-latest",
                  ARG_CAPS_ARCH, "riscv64",
                  ARG_CAPS_VER, "latest",
-- 
2.51.0
Re: [PATCH v2 33/38] qemu: Use qemu-xhci with no fallback on RISC-V
Posted by Peter Krempa via Devel 1 day, 12 hours ago
On Thu, Sep 25, 2025 at 20:07:19 +0200, Andrea Bolognani via Devel wrote:
> Similar to loongarch64, the current behavior is a result
> of the way the existing code was written rather than a
> consequence of an intentional choice. Make the two
> architectures behave the same way, as they should have
> from the start.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  src/qemu/qemu_domain.c                        |  3 +-
>  ...ault-models.riscv64-latest.abi-update.args | 15 ++++---
>  ...fault-models.riscv64-latest.abi-update.xml | 26 +++++-------
>  ...64-virt-default-models.riscv64-latest.args | 15 ++++---
>  ...v64-virt-default-models.riscv64-latest.xml | 26 +++++-------
>  ...-fallback-virt-riscv64.riscv64-latest.args | 35 ----------------
>  ...t-fallback-virt-riscv64.riscv64-latest.xml | 41 -------------------
>  ...ntroller-default-fallback-virt-riscv64.xml |  1 -
>  ...r-default-virt-riscv64.riscv64-latest.args |  5 +--
>  ...er-default-virt-riscv64.riscv64-latest.xml | 12 ++----
>  tests/qemuxmlconftest.c                       |  5 ---
>  11 files changed, 44 insertions(+), 140 deletions(-)
>  delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.args
>  delete mode 100644 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.riscv64-latest.xml
>  delete mode 120000 tests/qemuxmlconfdata/usb-controller-default-fallback-virt-riscv64.xml

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