if (!def->os.loader)
def->os.loader = virDomainLoaderDefNew();
+ if (def->os.loader->format != VIR_STORAGE_FILE_RAW) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported loader format '%s'"),
+ virStorageFileFormatTypeToString(def->os.loader->format));
+ return -1;
+ }
+
def->os.loader->type = VIR_DOMAIN_LOADER_TYPE_PFLASH;
def->os.loader->readonly = VIR_TRISTATE_BOOL_YES;
b_info->u.hvm.bios = LIBXL_BIOS_TYPE_OVMF;
}
+ if (def->os.loader && def->os.loader->format != VIR_STORAGE_FILE_RAW) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported loader format '%s'"),
+ virStorageFileFormatTypeToString(def->os.loader->format));
+ return -1;
+ }
+
if (def->emulator) {
if (!virFileExists(def->emulator)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
{
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
virDomainLoaderDef *loader = def->os.loader;
+ virStorageSource *nvram = loader ? loader->nvram : NULL;
bool autoSelection = (def->os.firmware != VIR_DOMAIN_OS_DEF_FIRMWARE_NONE);
int ret;
if (virDomainDefOSValidate(def, NULL) < 0)
return -1;
+ if (loader &&
+ loader->format != VIR_STORAGE_FILE_RAW) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported loader format '%s'"),
+ virStorageFileFormatTypeToString(loader->format));
+ return -1;
+ }
+ if (nvram &&
+ nvram->format != VIR_STORAGE_FILE_RAW) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Unsupported nvram format '%s'"),
+ virStorageFileFormatTypeToString(nvram->format));
+ return -1;
+ }
+
/* If firmware autoselection is disabled and the loader is a ROM
* instead of a PFLASH device, then we're using BIOS and we don't
* need any information at all */