]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_firmware: Set templateFormat for custom paths
authorAndrea Bolognani <abologna@redhat.com>
Mon, 24 Nov 2025 17:59:03 +0000 (18:59 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 8 Jan 2026 23:26:16 +0000 (00:26 +0100)
If an NVRAM template is used, its format should be set too.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_firmware.c
tests/qemuxmlconfdata/firmware-manual-efi-loader-path-nonstandard.x86_64-latest.xml
tests/qemuxmlconfdata/firmware-manual-efi-nvram-template-nonstandard.x86_64-latest.xml

index 9b6c14701f2277af8b1ea6ba617dfca8448dc3f7..2b16d66818fe733314c9e673188e41fb345f72c2 100644 (file)
@@ -1623,6 +1623,11 @@ qemuFirmwareFillDomainCustom(virDomainDef *def)
     if (!loader->format)
         loader->format = VIR_STORAGE_FILE_RAW;
 
+    if (loader->nvramTemplate &&
+        !loader->nvramTemplateFormat) {
+        loader->nvramTemplateFormat = loader->format;
+    }
+
     return;
 }
 
index c17834b5e60b44e65986a0943089edd4818363d1..7baf6ebd409dcc738e7cc76923e13c98ffd12a11 100644 (file)
@@ -7,7 +7,7 @@
   <os>
     <type arch='x86_64' machine='pc-q35-10.0'>hvm</type>
     <loader readonly='yes' type='pflash' format='raw'>/path/to/OVMF_CODE.fd</loader>
-    <nvram template='/path/to/OVMF_VARS.fd' format='raw'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
+    <nvram template='/path/to/OVMF_VARS.fd' templateFormat='raw' format='raw'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
     <boot dev='hd'/>
   </os>
   <features>
index cbadd0f0c8cb125b5d0518a4aa1809d60c9a4318..beb146d35a07f86689ca8f01da08b2c3c68720ec 100644 (file)
@@ -7,7 +7,7 @@
   <os>
     <type arch='x86_64' machine='pc-q35-10.0'>hvm</type>
     <loader readonly='yes' type='pflash' format='raw'>/usr/share/edk2/ovmf/OVMF_CODE.fd</loader>
-    <nvram template='/path/to/OVMF_VARS.fd' format='raw'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
+    <nvram template='/path/to/OVMF_VARS.fd' templateFormat='raw' format='raw'>/var/lib/libvirt/qemu/nvram/guest_VARS.fd</nvram>
     <boot dev='hd'/>
   </os>
   <features>