]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_firmware: Drop fallback for absent nvramTemplateFormat
authorAndrea Bolognani <abologna@redhat.com>
Mon, 24 Nov 2025 16:57:25 +0000 (17:57 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 8 Jan 2026 23:26:16 +0000 (00:26 +0100)
If this information is missing, the parsing code will consider
the firmware descriptor to be invalid and matching against it will
not even be attempted. So we can safely drop this redundant
fallback.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_firmware.c

index 47a3987b64b1049411473b1bd1b532944ffa1b07..9dff3828a298932f01422a47e10532671b91a57d 100644 (file)
@@ -1421,14 +1421,8 @@ qemuFirmwareEnableFeaturesModern(virDomainDef *def,
             loader->nvramTemplateFormat = VIR_STORAGE_FILE_NONE;
 
             if (!loader->nvram || virStorageSourceIsLocalStorage(loader->nvram)) {
-                /* validation when parsing the JSON files ensures that we get
-                 * only 'raw' and 'qcow2' here. Fall back to sharing format with loader */
-                if (flash->nvram_template.format)
-                    loader->nvramTemplateFormat = virStorageFileFormatTypeFromString(flash->nvram_template.format);
-                else
-                    loader->nvramTemplateFormat = loader->format;
-
                 loader->nvramTemplate = g_strdup(flash->nvram_template.filename);
+                loader->nvramTemplateFormat = virStorageFileFormatTypeFromString(flash->nvram_template.format);
             }
         }