From: Daniel P. Berrangé Date: Tue, 8 Feb 2022 16:38:56 +0000 (+0000) Subject: conf: rename struct field for NVRAM template X-Git-Tag: v8.1.0-rc1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e76dfd2e63a466596e5ea4386dfba245cc9d1a9;p=thirdparty%2Flibvirt.git conf: rename struct field for NVRAM template This is to make it explicit that the template only applies to the NVRAM store, not the main loader binary, even if the loader is writable. Reviewed-by: Michal Privoznik Signed-off-by: Daniel P. Berrangé --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 093b719b2c..34fec887a3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3528,7 +3528,7 @@ virDomainLoaderDefFree(virDomainLoaderDef *loader) g_free(loader->path); g_free(loader->nvram); - g_free(loader->templt); + g_free(loader->nvramTemplate); g_free(loader); } @@ -18225,7 +18225,7 @@ virDomainDefParseBootLoaderOptions(virDomainDef *def, def->os.loader->nvram = virXPathString("string(./os/nvram[1])", ctxt); if (!fwAutoSelect) - def->os.loader->templt = virXPathString("string(./os/nvram[1]/@template)", ctxt); + def->os.loader->nvramTemplate = virXPathString("string(./os/nvram[1]/@template)", ctxt); return 0; } @@ -26912,9 +26912,9 @@ virDomainLoaderDefFormat(virBuffer *buf, else virBufferAddLit(buf, "/>\n"); - if (loader->nvram || loader->templt) { + if (loader->nvram || loader->nvramTemplate) { virBufferAddLit(buf, "templt); + virBufferEscapeString(buf, " template='%s'", loader->nvramTemplate); if (loader->nvram) virBufferEscapeString(buf, ">%s\n", loader->nvram); else diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index b2922e8cff..9fcf842ee7 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2220,7 +2220,7 @@ struct _virDomainLoaderDef { virDomainLoader type; virTristateBool secure; char *nvram; /* path to non-volatile RAM */ - char *templt; /* user override of path to master nvram */ + char *nvramTemplate; /* user override of path to master nvram */ }; void virDomainLoaderDefFree(virDomainLoaderDef *loader); diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index 209cc0046a..4b02cb2802 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -1136,14 +1136,14 @@ qemuFirmwareEnableFeatures(virQEMUDriver *driver, return -1; } - VIR_FREE(def->os.loader->templt); - def->os.loader->templt = g_strdup(flash->nvram_template.filename); + VIR_FREE(def->os.loader->nvramTemplate); + def->os.loader->nvramTemplate = g_strdup(flash->nvram_template.filename); qemuDomainNVRAMPathFormat(cfg, def, &def->os.loader->nvram); VIR_DEBUG("decided on firmware '%s' template '%s' NVRAM '%s'", def->os.loader->path, - def->os.loader->templt, + def->os.loader->nvramTemplate, def->os.loader->nvram); break; @@ -1310,7 +1310,7 @@ qemuFirmwareFillDomain(virQEMUDriver *driver, * its path in domain XML) but no template for NVRAM was * specified and the varstore doesn't exist ... */ if (!virDomainDefHasOldStyleROUEFI(def) || - def->os.loader->templt || + def->os.loader->nvramTemplate || (!reset_nvram && virFileExists(def->os.loader->nvram))) return 0; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 6fa47badd9..5af925e521 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4478,8 +4478,8 @@ qemuPrepareNVRAM(virQEMUDriver *driver, (virFileExists(loader->nvram) && !reset_nvram)) return 0; - master_nvram_path = loader->templt; - if (!loader->templt) { + master_nvram_path = loader->nvramTemplate; + if (!loader->nvramTemplate) { size_t i; for (i = 0; i < cfg->nfirmwares; i++) { if (STREQ(cfg->firmwares[i]->name, loader->path)) {