From: Andrea Bolognani Date: Thu, 16 Jun 2022 15:53:11 +0000 (+0200) Subject: conf: Move setting type for NVRAM source X-Git-Tag: v8.6.0-rc1~165 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cec35f4a5225d9188a6c201d03531cb9562dabfe;p=thirdparty%2Flibvirt.git conf: Move setting type for NVRAM source 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 Reviewed-by: Michal Privoznik --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1cb162f67c..f19f6eb63c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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;