qemu_firmware: Drop fallback for absent nvramTemplateFormat

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>
This commit is contained in:
Andrea Bolognani committed 2026-01-09 00:26:16 +01:00
1 parent 3463e543fe
commit 876a5d34d4
1 file changed
+1 -7
+1 -7
View 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);
}
}