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 <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani 2022-06-16 17:53:11 +02:00
parent 040ebb9d1b
commit cec35f4a52

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