]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuPrepareNVRAM: Refuse conversion of NVRAM backing file format
authorPeter Krempa <pkrempa@redhat.com>
Mon, 4 Nov 2024 17:04:29 +0000 (18:04 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 15 Nov 2024 08:42:04 +0000 (09:42 +0100)
Refuse situations where the user configures a different format for a
file-backed nvram than the template file has.

At this point it's still required that the NVRAM and firmware share
format, but that is going to be relaxed, thus we need to refuse
configurations that the code can't handle.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_process.c

index 7a40e09d47d58fab15b837a4d68c00546dfe331a..d134de532cbc2cf4a764b6f46753fc3e5aedcf04 100644 (file)
@@ -4624,6 +4624,12 @@ qemuPrepareNVRAM(virQEMUDriver *driver,
         return -1;
     }
 
+    if (loader->nvram->format != loader->nvramTemplateFormat) {
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                       _("conversion of the nvram template to another target format is not supported"));
+        return -1;
+    }
+
     if ((srcFD = virFileOpenAs(loader->nvramTemplate, O_RDONLY,
                                0, -1, -1, 0)) < 0) {
         virReportSystemError(-srcFD,