diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index a65c92a262e8894a40329a28a7b4a4e0e10a58a9..6f44cbf4e62dde240d888570dfb587342b408090 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -125,12 +125,13 @@ void qemuDomainCmdlineDefFree(qemuDomainCmdlineDefPtr def) } -#define VIR_QEMU_OVMF_LOADER_PATH "/usr/share/OVMF/OVMF_CODE.fd" -#define VIR_QEMU_OVMF_NVRAM_PATH "/usr/share/OVMF/OVMF_VARS.fd" -#define VIR_QEMU_OVMF_SEC_LOADER_PATH "/usr/share/OVMF/OVMF_CODE.secboot.fd" -#define VIR_QEMU_OVMF_SEC_NVRAM_PATH "/usr/share/OVMF/OVMF_VARS.fd" -#define VIR_QEMU_AAVMF_LOADER_PATH "/usr/share/AAVMF/AAVMF_CODE.fd" -#define VIR_QEMU_AAVMF_NVRAM_PATH "/usr/share/AAVMF/AAVMF_VARS.fd" +#ifndef DEFAULT_LOADER_NVRAM +# define DEFAULT_LOADER_NVRAM \ + "/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd:" \ + "/usr/share/OVMF/OVMF_CODE.secboot.fd:/usr/share/OVMF/OVMF_VARS.fd:" \ + "/usr/share/AAVMF/AAVMF_CODE.fd:/usr/share/AAVMF/AAVMF_VARS.fd" +#endif + virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged) { @@ -328,29 +329,11 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged) virBitmapSetBit(cfg->namespaces, QEMU_DOMAIN_NS_MOUNT) < 0) goto error; -#ifdef DEFAULT_LOADER_NVRAM if (virFirmwareParseList(DEFAULT_LOADER_NVRAM, &cfg->firmwares, &cfg->nfirmwares) < 0) goto error; -#else - if (VIR_ALLOC_N(cfg->firmwares, 3) < 0) - goto error; - cfg->nfirmwares = 3; - if (VIR_ALLOC(cfg->firmwares[0]) < 0 || VIR_ALLOC(cfg->firmwares[1]) < 0 || - VIR_ALLOC(cfg->firmwares[2]) < 0) - goto error; - - if (VIR_STRDUP(cfg->firmwares[0]->name, VIR_QEMU_AAVMF_LOADER_PATH) < 0 || - VIR_STRDUP(cfg->firmwares[0]->nvram, VIR_QEMU_AAVMF_NVRAM_PATH) < 0 || - VIR_STRDUP(cfg->firmwares[1]->name, VIR_QEMU_OVMF_LOADER_PATH) < 0 || - VIR_STRDUP(cfg->firmwares[1]->nvram, VIR_QEMU_OVMF_NVRAM_PATH) < 0 || - VIR_STRDUP(cfg->firmwares[2]->name, VIR_QEMU_OVMF_SEC_LOADER_PATH) < 0 || - VIR_STRDUP(cfg->firmwares[2]->nvram, VIR_QEMU_OVMF_SEC_NVRAM_PATH) < 0) - goto error; -#endif - return cfg; error: