]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuxml2argvtest: Update 'aarch64-virtio-pci-manual-addresses' case
authorPeter Krempa <pkrempa@redhat.com>
Tue, 28 Mar 2023 12:41:57 +0000 (14:41 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 11 Apr 2023 08:08:32 +0000 (10:08 +0200)
With all supported qemu versions we'll pick PCIe to use for the implicit
address busses (those lacking an explicit controller) and thus the
addresses must reflect that.

Update the test to add the new flags, and fix the addresses.
Additionally add a real-caps version of the test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/qemuxml2argvdata/aarch64-virtio-pci-manual-addresses.aarch64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/aarch64-virtio-pci-manual-addresses.args
tests/qemuxml2argvdata/aarch64-virtio-pci-manual-addresses.xml
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/aarch64-virtio-pci-manual-addresses.aarch64-latest.xml [new file with mode: 0644]
tests/qemuxml2xmloutdata/aarch64-virtio-pci-manual-addresses.xml
tests/qemuxml2xmltest.c

diff --git a/tests/qemuxml2argvdata/aarch64-virtio-pci-manual-addresses.aarch64-latest.args b/tests/qemuxml2argvdata/aarch64-virtio-pci-manual-addresses.aarch64-latest.args
new file mode 100644 (file)
index 0000000..dcf5d18
--- /dev/null
@@ -0,0 +1,49 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-aarch64test \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
+/usr/bin/qemu-system-aarch64 \
+-name guest=aarch64test,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64test/master-key.aes"}' \
+-machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram \
+-accel tcg \
+-cpu cortex-a53 \
+-m 1024 \
+-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073741824}' \
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
+-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 \
+-no-acpi \
+-boot strict=on \
+-kernel /aarch64.kernel \
+-initrd /aarch64.initrd \
+-append 'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \
+-dtb /aarch64.dtb \
+-device '{"driver":"i82801b11-bridge","id":"pci.1","bus":"pcie.0","addr":"0x1"}' \
+-device '{"driver":"pci-bridge","chassis_nr":2,"id":"pci.2","bus":"pci.1","addr":"0x0"}' \
+-device '{"driver":"pcie-root-port","port":16,"chassis":3,"id":"pci.3","bus":"pcie.0","multifunction":true,"addr":"0x2"}' \
+-device '{"driver":"pcie-root-port","port":17,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x2.0x1"}' \
+-device '{"driver":"pcie-root-port","port":18,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x2.0x2"}' \
+-device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.4","addr":"0x0"}' \
+-blockdev '{"driver":"file","filename":"/aarch64.raw","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
+-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
+-device '{"driver":"scsi-hd","bus":"scsi0.0","channel":0,"scsi-id":0,"lun":0,"device_id":"drive-scsi0-0-0-0","drive":"libvirt-1-format","id":"scsi0-0-0-0","bootindex":1}' \
+-netdev user,id=hostnet0 \
+-device '{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.3","addr":"0x0"}' \
+-netdev user,id=hostnet1 \
+-device '{"driver":"virtio-net-pci","netdev":"hostnet1","id":"net1","mac":"52:54:00:09:a4:38","bus":"pci.5","addr":"0x0"}' \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
index 65c2b3b7068fa2f85e7a3aab4be2b2172b140f0c..bdc5e7b7987c9953e96e92b1bc2d3464f9524c29 100644 (file)
@@ -32,14 +32,16 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64test/.config \
 -dtb /aarch64.dtb \
 -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1 \
 -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x0 \
--device pci-bridge,chassis_nr=3,id=pci.3,bus=pci.1,addr=0x1 \
--device virtio-scsi-pci,id=scsi0,bus=pci.3,addr=0x1 \
+-device pcie-root-port,port=16,chassis=3,id=pci.3,bus=pcie.0,multifunction=on,addr=0x2 \
+-device pcie-root-port,port=17,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x1 \
+-device pcie-root-port,port=18,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x2 \
+-device virtio-scsi-pci,id=scsi0,bus=pci.4,addr=0x0 \
 -blockdev '{"driver":"file","filename":"/aarch64.raw","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
 -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
 -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,device_id=drive-scsi0-0-0-0,drive=libvirt-1-format,id=scsi0-0-0-0,bootindex=1 \
 -netdev user,id=hostnet0 \
--device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:09:a4:37,bus=pci.3,addr=0x2 \
+-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:09:a4:37,bus=pci.3,addr=0x0 \
 -netdev user,id=hostnet1 \
--device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:09:a4:38,bus=pci.2,addr=0x1 \
+-device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:09:a4:38,bus=pci.5,addr=0x0 \
 -audiodev '{"id":"audio1","driver":"none"}' \
 -msg timestamp=on
index fee32588f73d0f734cb9893b49c839f55d224b89..d1c3ccc70e3564cd8a7f9bc451118119451f502b 100644 (file)
       <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
     </controller>
     <controller type='scsi' index='0' model='virtio-scsi'>
-      <address type='pci' domain='0x0000' bus='0x03' slot='0x01' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
     </controller>
     <interface type='user'>
       <mac address='52:54:00:09:a4:37'/>
       <model type='virtio'/>
-      <address type='pci' domain='0x0000' bus='0x03' slot='0x02' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
     </interface>
     <interface type='user'>
       <mac address='52:54:00:09:a4:38'/>
index faa5077112fd3968aa478876f3999e25bae797a1..7b2ae8865894a147cb9ef60416aa32280cabccdc 100644 (file)
@@ -2358,11 +2358,15 @@ mymain(void)
     DO_TEST_CAPS_ARCH_LATEST("aarch64-virtio-pci-default", "aarch64");
     /* Example of using virtio-pci with no explicit PCI controller
        but with manual PCI addresses */
+    DO_TEST_CAPS_ARCH_LATEST("aarch64-virtio-pci-manual-addresses", "aarch64");
     DO_TEST("aarch64-virtio-pci-manual-addresses",
             QEMU_CAPS_DEVICE_VIRTIO_MMIO,
             QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM,
             QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE,
             QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
+            QEMU_CAPS_DEVICE_PCIE_ROOT_PORT,
+            QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE,
+            QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL,
             QEMU_CAPS_DEVICE_IOH3420,
             QEMU_CAPS_VIRTIO_SCSI);
     DO_TEST("aarch64-video-virtio-gpu-pci",
diff --git a/tests/qemuxml2xmloutdata/aarch64-virtio-pci-manual-addresses.aarch64-latest.xml b/tests/qemuxml2xmloutdata/aarch64-virtio-pci-manual-addresses.aarch64-latest.xml
new file mode 100644 (file)
index 0000000..63c2636
--- /dev/null
@@ -0,0 +1,75 @@
+<domain type='qemu'>
+  <name>aarch64test</name>
+  <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='aarch64' machine='virt'>hvm</type>
+    <kernel>/aarch64.kernel</kernel>
+    <initrd>/aarch64.initrd</initrd>
+    <cmdline>earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait</cmdline>
+    <dtb>/aarch64.dtb</dtb>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <apic/>
+    <pae/>
+    <gic version='2'/>
+  </features>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='allow'>cortex-a53</model>
+  </cpu>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
+  <devices>
+    <emulator>/usr/bin/qemu-system-aarch64</emulator>
+    <disk type='file' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source file='/aarch64.raw'/>
+      <target dev='sda' bus='scsi'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <controller type='pci' index='0' model='pcie-root'/>
+    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
+      <model name='i82801b11-bridge'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+    </controller>
+    <controller type='pci' index='2' model='pci-bridge'>
+      <model name='pci-bridge'/>
+      <target chassisNr='2'/>
+      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
+    </controller>
+    <controller type='scsi' index='0' model='virtio-scsi'>
+      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
+    </controller>
+    <controller type='pci' index='3' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='3' port='0x10'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
+    </controller>
+    <controller type='pci' index='4' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='4' port='0x11'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
+    </controller>
+    <controller type='pci' index='5' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='5' port='0x12'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
+    </controller>
+    <interface type='user'>
+      <mac address='52:54:00:09:a4:37'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
+    </interface>
+    <interface type='user'>
+      <mac address='52:54:00:09:a4:38'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
+    </interface>
+    <audio id='1' type='none'/>
+  </devices>
+</domain>
index 7c90f21f3953ba041af1f1f07ac0f2b8aff44d94..63c2636f5e40cae1a948722b3b18ca386abb6519 100644 (file)
       <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
     </controller>
     <controller type='scsi' index='0' model='virtio-scsi'>
-      <address type='pci' domain='0x0000' bus='0x03' slot='0x01' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
     </controller>
-    <controller type='pci' index='3' model='pci-bridge'>
-      <model name='pci-bridge'/>
-      <target chassisNr='3'/>
-      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
+    <controller type='pci' index='3' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='3' port='0x10'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
+    </controller>
+    <controller type='pci' index='4' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='4' port='0x11'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
+    </controller>
+    <controller type='pci' index='5' model='pcie-root-port'>
+      <model name='pcie-root-port'/>
+      <target chassis='5' port='0x12'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
     </controller>
     <interface type='user'>
       <mac address='52:54:00:09:a4:37'/>
       <model type='virtio'/>
-      <address type='pci' domain='0x0000' bus='0x03' slot='0x02' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
     </interface>
     <interface type='user'>
       <mac address='52:54:00:09:a4:38'/>
       <model type='virtio'/>
-      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
+      <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
     </interface>
     <audio id='1' type='none'/>
   </devices>
index a8a6cd6ca752334a69ae866335c944734696f0b4..328f8cba6afb6c37c23a31fc3734137fd3f96487 100644 (file)
@@ -935,11 +935,15 @@ mymain(void)
             QEMU_CAPS_DEVICE_VIRTIO_MMIO,
             QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM);
     DO_TEST_CAPS_ARCH_LATEST("aarch64-virtio-pci-default", "aarch64");
+    DO_TEST_CAPS_ARCH_LATEST("aarch64-virtio-pci-manual-addresses", "aarch64");
     DO_TEST("aarch64-virtio-pci-manual-addresses",
             QEMU_CAPS_DEVICE_VIRTIO_MMIO,
             QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM,
             QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE,
             QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
+            QEMU_CAPS_DEVICE_PCIE_ROOT_PORT,
+            QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE,
+            QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL,
             QEMU_CAPS_DEVICE_IOH3420,
             QEMU_CAPS_VIRTIO_SCSI);
     DO_TEST("aarch64-video-virtio-gpu-pci",