From 2a9e5ad8bd63161f84c71a8b729643b840e2ae14 Mon Sep 17 00:00:00 2001 Message-ID: <2a9e5ad8bd63161f84c71a8b729643b840e2ae14.1772815312.git.jdenemar@redhat.com> From: Andrea Bolognani Date: Fri, 5 Dec 2025 18:39:04 +0100 Subject: [PATCH] tests: Add firmware-manual-efi-rw-nvram This test case demonstrates a flaw in the XML validation process. Read/write firmware images already contain an area dedicated to variable storage, which they use, so attempting to use a separate NVRAM file together with them should have resulted in the domain XML being rejected. The issue will be addressed in an upcoming commit. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik (cherry picked from commit 27313799ba1b50741ed7f67773511de0aa882047) https://issues.redhat.com/browse/RHEL-82645 Signed-off-by: Andrea Bolognani --- ...are-manual-efi-rw-nvram.x86_64-latest.args | 37 +++++++++++++++++ ...ware-manual-efi-rw-nvram.x86_64-latest.xml | 40 +++++++++++++++++++ .../firmware-manual-efi-rw-nvram.xml | 19 +++++++++ tests/qemuxmlconftest.c | 1 + 4 files changed, 97 insertions(+) create mode 100644 tests/qemuxmlconfdata/firmware-manual-efi-rw-nvram.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/firmware-manual-efi-rw-nvram.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/firmware-manual-efi-rw-nvram.xml diff --git a/tests/qemuxmlconfdata/firmware-manual-efi-rw-nvram.x86_64-latest.args b/tests/qemuxmlconfdata/firmware-manual-efi-rw-nvram.x86_64-latest.args new file mode 100644 index 0000000000..6b3eec0a27 --- /dev/null +++ b/tests/qemuxmlconfdata/firmware-manual-efi-rw-nvram.x86_64-latest.args @@ -0,0 +1,37 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-guest \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=guest,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \ +-blockdev '{"driver":"file","filename":"/usr/share/edk2/ovmf/OVMF.combined.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-pflash0-format","read-only":false,"driver":"raw","file":"libvirt-pflash0-storage"}' \ +-blockdev '{"driver":"file","filename":"/path/to/guest_VARS.fd","node-name":"libvirt-pflash1-storage","read-only":false}' \ +-machine pc-q35-10.0,usb=off,smm=on,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-storage,acpi=on \ +-accel kvm \ +-cpu qemu64 \ +-global driver=cfi.pflash01,property=secure,value=on \ +-m size=1048576k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":1073741824}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid 63840878-0deb-4095-97e6-fc444d9bc9fa \ +-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"}' \ +-global ICH9-LPC.noreboot=off \ +-watchdog-action reset \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/firmware-manual-efi-rw-nvram.x86_64-latest.xml b/tests/qemuxmlconfdata/firmware-manual-efi-rw-nvram.x86_64-latest.xml new file mode 100644 index 0000000000..f6436df80f --- /dev/null +++ b/tests/qemuxmlconfdata/firmware-manual-efi-rw-nvram.x86_64-latest.xml @@ -0,0 +1,40 @@ + + guest + 63840878-0deb-4095-97e6-fc444d9bc9fa + 1048576 + 1048576 + 1 + + hvm + + + + /usr/share/edk2/ovmf/OVMF.combined.fd + /path/to/guest_VARS.fd + + + + + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + +
+ + + + +