]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Add pcihole64 test for virt machine
authorMatthew R. Ochs <mochs@nvidia.com>
Thu, 15 May 2025 14:48:53 +0000 (07:48 -0700)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 16 May 2025 11:47:32 +0000 (12:47 +0100)
Add a pcihole64 test for the aarch64 virt machine that verifies the
value is propagated to the highmem-mmio-size virt machine parameter.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Matthew R. Ochs <mochs@nvidia.com>
tests/qemuxmlconfdata/pcihole64-virt.aarch64-latest.args [new file with mode: 0644]
tests/qemuxmlconfdata/pcihole64-virt.aarch64-latest.xml [new file with mode: 0644]
tests/qemuxmlconfdata/pcihole64-virt.xml [new file with mode: 0644]
tests/qemuxmlconftest.c

diff --git a/tests/qemuxmlconfdata/pcihole64-virt.aarch64-latest.args b/tests/qemuxmlconfdata/pcihole64-virt.aarch64-latest.args
new file mode 100644 (file)
index 0000000..d2df31e
--- /dev/null
@@ -0,0 +1,31 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-foo \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-foo/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-foo/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-foo/.config \
+/usr/bin/qemu-system-aarch64 \
+-name guest=foo,debug-threads=on \
+-S \
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-foo/master-key.aes"}' \
+-machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off,highmem-mmio-size=536870912K \
+-accel tcg \
+-cpu cortex-a15 \
+-m size=1048576k \
+-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 6ba7b810-9dad-11d1-80b4-00c04fd430c8 \
+-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 \
+-audiodev '{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxmlconfdata/pcihole64-virt.aarch64-latest.xml b/tests/qemuxmlconfdata/pcihole64-virt.aarch64-latest.xml
new file mode 100644 (file)
index 0000000..1fb38b4
--- /dev/null
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+  <name>foo</name>
+  <uuid>6ba7b810-9dad-11d1-80b4-00c04fd430c8</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='aarch64' machine='virt'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <gic version='2'/>
+  </features>
+  <cpu mode='custom' match='exact' check='none'>
+    <model fallback='forbid'>cortex-a15</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-aarch64</emulator>
+    <controller type='pci' index='0' model='pcie-root'>
+      <pcihole64 unit='KiB'>536870912</pcihole64>
+    </controller>
+    <audio id='1' type='none'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
diff --git a/tests/qemuxmlconfdata/pcihole64-virt.xml b/tests/qemuxmlconfdata/pcihole64-virt.xml
new file mode 100644 (file)
index 0000000..00bb51a
--- /dev/null
@@ -0,0 +1,17 @@
+<domain type='qemu'>
+  <name>foo</name>
+  <uuid>6ba7b810-9dad-11d1-80b4-00c04fd430c8</uuid>
+  <memory unit='KiB'>1048576</memory>
+  <currentMemory unit='KiB'>1048576</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='aarch64' machine='virt'>hvm</type>
+  </os>
+  <devices>
+    <emulator>/usr/bin/qemu-system-aarch64</emulator>
+    <controller type='pci' index='0' model='pcie-root'>
+      <pcihole64 unit='GiB'>512</pcihole64>
+    </controller>
+    <memballoon model='none'/>
+  </devices>
+</domain>
index 1f31ec810c7a34a375ede121d56828b3c1f42804..7fe51ba4f81ca8a349f5d7e402812e299b9545ba 100644 (file)
@@ -2587,6 +2587,7 @@ mymain(void)
 
     DO_TEST_CAPS_LATEST("pcihole64");
     DO_TEST_CAPS_LATEST("pcihole64-q35");
+    DO_TEST_CAPS_ARCH_LATEST("pcihole64-virt", "aarch64");
 
     DO_TEST_CAPS_ARCH_LATEST("arm-vexpressa9-nodevs", "aarch64");
     DO_TEST_CAPS_ARCH_LATEST("arm-vexpressa9-basic", "aarch64");