]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Move setting type for NVRAM source
authorAndrea Bolognani <abologna@redhat.com>
Thu, 16 Jun 2022 15:53:11 +0000 (17:53 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 1 Jul 2022 13:10:19 +0000 (15:10 +0200)
When the 'type' attribute is present we'd end up overwriting
this value via virDomainStorageSourceParse(). Moving this
assignment makes the current code clearer and will also help
with upcoming changes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c

index 1cb162f67c702b3009fec4d4711b5a60430dbc99..f19f6eb63cec0ff8a3504751714502004426c406 100644 (file)
@@ -18001,7 +18001,6 @@ virDomainLoaderDefParseXMLNvram(virDomainLoaderDef *loader,
     g_autofree char *nvramType = virXPathString("string(./os/nvram/@type)", ctxt);
     g_autoptr(virStorageSource) src = virStorageSourceNew();
 
-    src->type = VIR_STORAGE_TYPE_FILE;
     src->format = VIR_STORAGE_FILE_RAW;
 
     if (!nvramType) {
@@ -18011,6 +18010,7 @@ virDomainLoaderDefParseXMLNvram(virDomainLoaderDef *loader,
             return 0; /* no nvram */
 
         src->path = nvramPath;
+        src->type = VIR_STORAGE_TYPE_FILE;
     } else {
         xmlNodePtr sourceNode;