From 04568019c6568ada281d70b4fb35573fd759781e Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Wed, 15 Mar 2023 17:32:43 +0100 Subject: [PATCH] qemu: Always go through firmware autoselection Right now there are a few scenarios in which we skip ahead, and removing these exceptions will make for more consistent and predictable behavior. Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- src/qemu/qemu_firmware.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 1b0f4bc299..250261f23a 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -1635,7 +1635,6 @@ int qemuFirmwareFillDomain(virQEMUDriver *driver, virDomainDef *def) { - 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); @@ -1677,33 +1676,6 @@ qemuFirmwareFillDomain(virQEMUDriver *driver, return 0; } - /* For UEFI with firmware autoselection disabled, even if some of - * the information is missing we might still be able to avoid - * having to look at firmware descriptors */ - if (!autoSelection && - virDomainDefHasOldStyleROUEFI(def) && - loader->path) { - - /* For stateless firmwares, the firmware path is all we need */ - if (loader->stateless == VIR_TRISTATE_BOOL_YES) - return 0; - - /* If the path to the NVRAM file is already provided and it - * points to a non-local source, we don't need to look up any - * other information */ - if (loader->nvram && !virStorageSourceIsLocalStorage(loader->nvram)) - return 0; - - /* If we have the path to both the firmware itself and the - * corresponding NVRAM template we might still need to - * generate a path to the domain-specific NVRAM file, but - * otherwise we're good to go */ - if (loader->nvramTemplate) { - qemuFirmwareEnsureNVRAM(def, cfg, loader->format); - return 0; - } - } - /* Look for the information we need in firmware descriptors */ if ((ret = qemuFirmwareFillDomainModern(driver, def)) < 0) return -1;