]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: rename struct field for NVRAM template
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 8 Feb 2022 16:38:56 +0000 (16:38 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 22 Feb 2022 14:56:26 +0000 (14:56 +0000)
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>
src/conf/domain_conf.c
src/conf/domain_conf.h
src/qemu/qemu_firmware.c
src/qemu/qemu_process.c

index 093b719b2ca4ee17f0a77da0c694707a52a8862b..34fec887a3c7a36cf80e08f4f5fa51704b27989d 100644 (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
index b2922e8cff2b34d2382db7100297787c26e9ecee..9fcf842ee7498fe5ea60624ebaf53731ba34406f 100644 (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);
index 209cc0046a61b89c7b25e0808af412946b48139d..4b02cb280258438c05ee7ce5c19c7a2b543f7b90 100644 (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;
 
index 6fa47badd98e9d76183aa7488bfec44439ca983a..5af925e5217a38eacb2139e56efa183b761dd4a8 100644 (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)) {