[libvirt PATCH 08/15] qemu: Always go through firmware autoselection

Andrea Bolognani abologna at redhat.com
Fri Mar 17 19:27:40 UTC 2023


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 <abologna at redhat.com>
---
 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 f7d7f78578..e2c371d8a2 100644
--- a/src/qemu/qemu_firmware.c
+++ b/src/qemu/qemu_firmware.c
@@ -1631,7 +1631,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);
@@ -1673,33 +1672,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;
-- 
2.39.2



More information about the libvir-list mailing list