All the data in the <nvram> element ends up in the same struct as that coming from the <loader> element, so it makes sense to have a single entry point for parsing an XML document into a virDomainLoaderDef instance. Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx> --- src/conf/domain_conf.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fcb468b465..d6a33a0f81 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18042,8 +18042,11 @@ virDomainLoaderDefParseXMLNvram(virDomainLoaderDef *loader, static int -virDomainLoaderDefParseXML(xmlNodePtr node, - virDomainLoaderDef *loader, +virDomainLoaderDefParseXML(virDomainLoaderDef *loader, + xmlNodePtr node, + xmlXPathContextPtr ctxt, + virDomainXMLOption *xmlopt, + unsigned int flags, bool fwAutoSelect) { if (!fwAutoSelect) { @@ -18066,6 +18069,11 @@ virDomainLoaderDefParseXML(xmlNodePtr node, &loader->secure) < 0) return -1; + if (virDomainLoaderDefParseXMLNvram(loader, + ctxt, xmlopt, flags, + fwAutoSelect) < 0) + return -1; + return 0; } @@ -18467,16 +18475,12 @@ virDomainDefParseBootLoaderOptions(virDomainDef *def, def->os.loader = g_new0(virDomainLoaderDef, 1); - if (virDomainLoaderDefParseXML(loader_node, - def->os.loader, + if (virDomainLoaderDefParseXML(def->os.loader, + loader_node, + ctxt, xmlopt, flags, fwAutoSelect) < 0) return -1; - if (virDomainLoaderDefParseXMLNvram(def->os.loader, - ctxt, xmlopt, flags, - fwAutoSelect) < 0) - return -1; - return 0; } -- 2.35.3