]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Don't set PCI address in usb-controller-default tests
authorAndrea Bolognani <abologna@redhat.com>
Thu, 10 Jul 2025 12:57:27 +0000 (14:57 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 6 Oct 2025 09:15:13 +0000 (11:15 +0200)
We want to ensure that libvirt will automatically allocate the
PCI address, and setting it ourselves ahead of time will
prevent that from happening.

In the case of q35, this change will cause additional PCI
controllers to show up. That's desirable, as it demonstrates
the behavior libvirt users will actually see.

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>
tests/qemuxmlconfdata/usb-controller-default-i440fx.xml
tests/qemuxmlconfdata/usb-controller-default-pseries.xml
tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.args
tests/qemuxmlconfdata/usb-controller-default-q35.x86_64-latest.xml
tests/qemuxmlconfdata/usb-controller-default-q35.xml
tests/qemuxmlconfdata/usb-controller-default-unavailable-q35.x86_64-latest.xml

index 81149b73bec43ae067032a867a7a6b3d8727d5e1..3987b78ebc371fb08f477eb8cdbbd313787aaf6d 100644 (file)
@@ -10,9 +10,7 @@
   </os>
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <controller type='usb' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
-    </controller>
+    <controller type='usb' index='0'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
index 3717c5826121cc77e08b1681c2caff5c3422f3dd..676a578eb0f99e3724240c8e541a28358c829688 100644 (file)
@@ -18,9 +18,7 @@
   <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-ppc64</emulator>
-    <controller type='usb' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
-    </controller>
+    <controller type='usb' index='0'/>
     <memballoon model='virtio'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
     </memballoon>
index 23bdedef6c29a3a7444a08c96a0345df28009013..7ba7b39a87d58db9d3852845167a969bac4b0c50 100644 (file)
@@ -26,7 +26,10 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-q35-test/.config \
 -rtc base=utc \
 -no-shutdown \
 -boot strict=on \
--device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pcie.0","addr":"0x1"}' \
+-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"}' \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -global ICH9-LPC.noreboot=off \
 -watchdog-action reset \
index fa67c860bb4c5870262423ec541c6b5aee3810d1..4295586490b820d577d60f3d1d6311f1fd898533 100644 (file)
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
     <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>
     <controller type='usb' index='0' model='piix3-uhci'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
     </controller>
     <controller type='sata' index='0'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
index 1436495902147afc32a0476fe11b6ea5099e2945..b3a57365bcc4f235ca82b232dae6dddb29cb9b1b 100644 (file)
@@ -15,9 +15,7 @@
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
     <controller type='pci' index='0' model='pcie-root'/>
-    <controller type='usb' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
-    </controller>
+    <controller type='usb' index='0'/>
     <memballoon model='none'/>
   </devices>
 </domain>
index c857816a3ebee8101d522cde265d400feb58954c..f5561ebc1a0407e34fb3a8374c1b6b36f212609d 100644 (file)
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
     <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>
     <controller type='usb' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
     </controller>
     <controller type='sata' index='0'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>