mirror of https://gitee.com/openkylin/libvirt.git
tests: don't use auto-generated NVRAM path in tests
By using the auto-generated NVRAM path in test data files, we won't see
bugs where a user specified path gets accidentally overwritten by a
post-parse callback, or VM startup. For example, this caused us to miss
the bug fixed by:
commit 24adb6c7a6
Author: Michal Prívozník <mprivozn@redhat.com>
Date: Wed Feb 23 08:50:44 2022 +0100
qemu: Don't regenerate NVRAM path if parsed from domain XML
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
e5804d4cbf
commit
392292cd99
|
@ -15,7 +15,7 @@ QEMU_AUDIO_DRV=none \
|
|||
-accel tcg \
|
||||
-cpu cortex-a57 \
|
||||
-drive file=/usr/share/AAVMF/AAVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \
|
||||
-drive file=/var/lib/libvirt/qemu/nvram/guest_VARS.fd,if=pflash,format=raw,unit=1 \
|
||||
-drive file=/some/user/nvram/path/guest_VARS.fd,if=pflash,format=raw,unit=1 \
|
||||
-m 1024 \
|
||||
-realtime mlock=off \
|
||||
-smp 1,sockets=1,cores=1,threads=1 \
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<os>
|
||||
<type arch='aarch64' machine='virt'>hvm</type>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
|
|
|
@ -15,7 +15,7 @@ QEMU_AUDIO_DRV=none \
|
|||
-accel tcg \
|
||||
-cpu cortex-a57 \
|
||||
-drive file=/usr/share/AAVMF/AAVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \
|
||||
-drive file=/var/lib/libvirt/qemu/nvram/guest_VARS.fd,if=pflash,format=raw,unit=1 \
|
||||
-drive file=/some/user/nvram/path/guest_VARS.fd,if=pflash,format=raw,unit=1 \
|
||||
-m 1024 \
|
||||
-realtime mlock=off \
|
||||
-smp 1,sockets=1,cores=1,threads=1 \
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<os>
|
||||
<type arch='aarch64' machine='virt'>hvm</type>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
</os>
|
||||
<cpu mode='custom'>
|
||||
<model>cortex-a57</model>
|
||||
|
|
|
@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
|
|||
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}' \
|
||||
-blockdev '{"driver":"file","filename":"/usr/share/AAVMF/AAVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
|
||||
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"driver":"file","filename":"/some/user/nvram/path/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
|
||||
-machine virt,usb=off,dump-guest-core=off,gic-version=2,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,memory-backend=mach-virt.ram \
|
||||
-accel tcg \
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<os>
|
||||
<type arch='aarch64' machine='virt'>hvm</type>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<features>
|
||||
|
|
|
@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
|
|||
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-guest/master-key.aes"}' \
|
||||
-blockdev '{"driver":"file","filename":"/usr/share/AAVMF/AAVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
|
||||
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"driver":"file","filename":"/some/user/nvram/path/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
|
||||
-machine virt,usb=off,dump-guest-core=off,gic-version=2,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,memory-backend=mach-virt.ram \
|
||||
-accel tcg \
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<os>
|
||||
<type arch='aarch64' machine='virt'>hvm</type>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<features>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<vcpu placement='static'>1</vcpu>
|
||||
<os>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
|
||||
<nvram>/usr/share/OVMF/OVMF_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<type arch='x86_64' machine='pc'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
<bootmenu enable='yes'/>
|
||||
|
|
|
@ -15,7 +15,7 @@ QEMU_AUDIO_DRV=none \
|
|||
-accel tcg \
|
||||
-global driver=cfi.pflash01,property=secure,value=on \
|
||||
-drive file=/usr/share/OVMF/OVMF_CODE.secboot.fd,if=pflash,format=raw,unit=0,readonly=on \
|
||||
-drive file=/usr/share/OVMF/OVMF_VARS.fd,if=pflash,format=raw,unit=1 \
|
||||
-drive file=/some/user/nvram/path/guest_VARS.fd,if=pflash,format=raw,unit=1 \
|
||||
-m 1024 \
|
||||
-realtime mlock=off \
|
||||
-smp 1,sockets=1,cores=1,threads=1 \
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<os>
|
||||
<type arch='x86_64' machine='q35'>hvm</type>
|
||||
<loader readonly='yes' secure='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.secboot.fd</loader>
|
||||
<nvram>/usr/share/OVMF/OVMF_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
<bootmenu enable='yes'/>
|
||||
</os>
|
||||
|
|
|
@ -14,7 +14,7 @@ QEMU_AUDIO_DRV=none \
|
|||
-machine pc,usb=off,dump-guest-core=off \
|
||||
-accel tcg \
|
||||
-drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \
|
||||
-drive file=/usr/share/OVMF/OVMF_VARS.fd,if=pflash,format=raw,unit=1 \
|
||||
-drive file=/some/user/nvram/path/guest_VARS.fd,if=pflash,format=raw,unit=1 \
|
||||
-m 1024 \
|
||||
-realtime mlock=off \
|
||||
-smp 1,sockets=1,cores=1,threads=1 \
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<os>
|
||||
<type arch='x86_64' machine='pc'>hvm</type>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
|
||||
<nvram>/usr/share/OVMF/OVMF_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
<bootmenu enable='yes'/>
|
||||
</os>
|
||||
|
|
|
@ -14,7 +14,7 @@ QEMU_AUDIO_DRV=none \
|
|||
-machine virt,usb=off,dump-guest-core=off,gic-version=2 \
|
||||
-accel hvf \
|
||||
-drive file=/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw,if=pflash,format=raw,unit=0,readonly=on \
|
||||
-drive file=/var/lib/libvirt/qemu/nvram/test_VARS.fd,if=pflash,format=raw,unit=1 \
|
||||
-drive file=/some/user/nvram/path/guest_VARS.fd,if=pflash,format=raw,unit=1 \
|
||||
-m 4096 \
|
||||
-realtime mlock=off \
|
||||
-smp 2,sockets=2,cores=1,threads=1 \
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<os>
|
||||
<type arch='aarch64' machine='virt'>hvm</type>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw</loader>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/test_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<features>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<os firmware='bios'>
|
||||
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
|
||||
<loader secure='no'/>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/fedora_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
<bootmenu enable='yes'/>
|
||||
</os>
|
||||
|
|
|
@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-fedora/.config \
|
|||
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-fedora/master-key.aes"}' \
|
||||
-blockdev '{"driver":"file","filename":"/usr/share/OVMF/OVMF_CODE.secboot.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
|
||||
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/fedora_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"driver":"file","filename":"/some/user/nvram/path/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
|
||||
-machine pc-q35-4.0,usb=off,smm=on,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,memory-backend=pc.ram \
|
||||
-accel kvm \
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<os firmware='efi'>
|
||||
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
|
||||
<loader secure='yes'/>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/fedora_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
<bootmenu enable='yes'/>
|
||||
</os>
|
||||
|
|
|
@ -12,7 +12,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-fedora/.config \
|
|||
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-fedora/master-key.aes"}' \
|
||||
-blockdev '{"driver":"file","filename":"/usr/share/OVMF/OVMF_CODE.secboot.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
|
||||
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/fedora_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"driver":"file","filename":"/some/user/nvram/path/guest_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
|
||||
-machine pc-q35-4.0,usb=off,smm=on,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,memory-backend=pc.ram \
|
||||
-accel kvm \
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<os firmware='efi'>
|
||||
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
|
||||
<loader secure='no'/>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/fedora_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
<bootmenu enable='yes'/>
|
||||
</os>
|
||||
|
|
|
@ -15,7 +15,7 @@ QEMU_AUDIO_DRV=none \
|
|||
-accel tcg \
|
||||
-cpu Haswell \
|
||||
-drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \
|
||||
-drive file=/var/lib/libvirt/qemu/nvram/guest_VARS.fd,if=pflash,format=raw,unit=1 \
|
||||
-drive file=/some/user/nvram/path/guest_VARS.fd,if=pflash,format=raw,unit=1 \
|
||||
-m 1024 \
|
||||
-realtime mlock=off \
|
||||
-smp 1,sockets=1,cores=1,threads=1 \
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<os>
|
||||
<type arch='x86_64' machine='q35'>hvm</type>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<os>
|
||||
<type arch='x86_64' machine='q35'>hvm</type>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
</os>
|
||||
<cpu mode='custom'>
|
||||
<model>Haswell</model>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<os>
|
||||
<type arch='aarch64' machine='virt'>hvm</type>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<features>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<os>
|
||||
<type arch='aarch64' machine='virt'>hvm</type>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<features>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<os>
|
||||
<type arch='x86_64' machine='pc'>hvm</type>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
|
||||
<nvram>/usr/share/OVMF/OVMF_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
<bootmenu enable='yes'/>
|
||||
</os>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<os>
|
||||
<type arch='x86_64' machine='pc'>hvm</type>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
|
||||
<nvram>/usr/share/OVMF/OVMF_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
<bootmenu enable='yes'/>
|
||||
</os>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<os>
|
||||
<type arch='aarch64' machine='virt'>hvm</type>
|
||||
<loader readonly='yes' type='pflash'>/usr/share/edk2/aarch64/QEMU_EFI-silent-pflash.raw</loader>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/test_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<features>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<os firmware='bios'>
|
||||
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
|
||||
<loader secure='no'/>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/fedora_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
<bootmenu enable='yes'/>
|
||||
</os>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<os firmware='efi'>
|
||||
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
|
||||
<loader secure='yes'/>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/fedora_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
<bootmenu enable='yes'/>
|
||||
</os>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<os firmware='efi'>
|
||||
<type arch='x86_64' machine='pc-q35-4.0'>hvm</type>
|
||||
<loader secure='no'/>
|
||||
<nvram>/var/lib/libvirt/qemu/nvram/fedora_VARS.fd</nvram>
|
||||
<nvram>/some/user/nvram/path/guest_VARS.fd</nvram>
|
||||
<boot dev='hd'/>
|
||||
<bootmenu enable='yes'/>
|
||||
</os>
|
||||
|
|
Loading…
Reference in New Issue