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 <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2022-02-08 16:38:56 +00:00
parent 08101bde5d
commit 4e76dfd2e6
4 changed files with 11 additions and 11 deletions

View File

@ -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, "<nvram");
virBufferEscapeString(buf, " template='%s'", loader->templt);
virBufferEscapeString(buf, " template='%s'", loader->nvramTemplate);
if (loader->nvram)
virBufferEscapeString(buf, ">%s</nvram>\n", loader->nvram);
else

View File

@ -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);

View File

@ -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;

View File

@ -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)) {