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>
if (!loader->format)
loader->format = VIR_STORAGE_FILE_RAW;
+ if (loader->nvramTemplate &&
+ !loader->nvramTemplateFormat) {
+ loader->nvramTemplateFormat = loader->format;
+ }
+
return;
}
<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>
<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>