Add test coverage for machine-specific PCI features: - Add XML tests for aarch64 virt highmem-mmio-size - Add command line generation tests This ensures proper handling of machine-specific PCI features like the high memory MMIO window size configuration. Signed-off-by: Matthew R. Ochs <mochs@xxxxxxxxxx> --- ...rch64-virt-machine-pci.aarch64-latest.args | 31 +++++++++++++++++++ ...arch64-virt-machine-pci.aarch64-latest.xml | 30 ++++++++++++++++++ .../aarch64-virt-machine-pci.xml | 20 ++++++++++++ tests/qemuxmlconftest.c | 2 ++ 4 files changed, 83 insertions(+) create mode 100644 tests/qemuxmlconfdata/aarch64-virt-machine-pci.aarch64-latest.args create mode 100644 tests/qemuxmlconfdata/aarch64-virt-machine-pci.aarch64-latest.xml create mode 100644 tests/qemuxmlconfdata/aarch64-virt-machine-pci.xml diff --git a/tests/qemuxmlconfdata/aarch64-virt-machine-pci.aarch64-latest.args b/tests/qemuxmlconfdata/aarch64-virt-machine-pci.aarch64-latest.args new file mode 100644 index 000000000000..7ab4e8bd624f --- /dev/null +++ b/tests/qemuxmlconfdata/aarch64-virt-machine-pci.aarch64-latest.args @@ -0,0 +1,31 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-aarch64-virt-machine \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-aarch64-virt-machine/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-aarch64-virt-machine/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-aarch64-virt-machine/.config \ +/usr/bin/qemu-system-aarch64 \ +-name guest=aarch64-virt-machine-pci,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-aarch64-virt-machine/master-key.aes"}' \ +-machine virt,usb=off,gic-version=2,highmem-mmio-size=512G,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \ +-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/aarch64-virt-machine-pci.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-virt-machine-pci.aarch64-latest.xml new file mode 100644 index 000000000000..d19a23b17b70 --- /dev/null +++ b/tests/qemuxmlconfdata/aarch64-virt-machine-pci.aarch64-latest.xml @@ -0,0 +1,30 @@ +<domain type='qemu'> + <name>aarch64-virt-machine-pci</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'/> + <pci> + <highmem-mmio-size unit='G'>512</highmem-mmio-size> + </pci> + </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'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/aarch64-virt-machine-pci.xml b/tests/qemuxmlconfdata/aarch64-virt-machine-pci.xml new file mode 100644 index 000000000000..42ebb4b304b5 --- /dev/null +++ b/tests/qemuxmlconfdata/aarch64-virt-machine-pci.xml @@ -0,0 +1,20 @@ +<domain type='qemu'> + <name>aarch64-virt-machine-pci</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> + <features> + <pci> + <highmem-mmio-size unit='G'>512</highmem-mmio-size> + </pci> + </features> + <devices> + <emulator>/usr/bin/qemu-system-aarch64</emulator> + <controller type='pci' index='0' model='pcie-root'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 1279b08c9627..5f1f6a7bb3c5 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2665,6 +2665,8 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("clock-timer-armvtimer", "aarch64"); + DO_TEST_CAPS_ARCH_LATEST("aarch64-virt-machine-pci", "aarch64"); + qemuTestSetHostArch(&driver, VIR_ARCH_NONE); DO_TEST_CAPS_LATEST("kvm-pit-delay"); -- 2.46.0