domain_validate: Reject ROMs with format other than raw

The combination doesn't make sense.

After this change the firmware-auto-efi-format-loader-qcow2-rom
test case starts failing, as it should have in the first place.

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 5bae6e3640
commit c74adb33e4
5 files changed
+12 -74

No files matched your search

+10
View File
@@ -1811,6 +1811,16 @@ virDomainDefOSValidate(const virDomainDef *def,
}
}
if (loader->type == VIR_DOMAIN_LOADER_TYPE_ROM) {
if (loader->format &&
loader->format != VIR_STORAGE_FILE_RAW) {
virReportError(VIR_ERR_XML_DETAIL,
_("Invalid format '%1$s' for ROM loader type"),
virStorageFileFormatTypeToString(loader->format));
return -1;
}
}
if (def->os.shim && !def->os.kernel) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("shim only allowed with kernel option"));