We already handle the <nvram> element in a separate helper,
which is cleaner than having all the logic in the top-level
virDomainLoaderDefParseXML() function.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/conf/domain_conf.c | 36 ++++++++++++++++++++++++------------
1 file changed, 24 insertions(+), 12 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a5578324b9..74c7889e01 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -16786,19 +16786,9 @@ virDomainLoaderDefParseXMLNvram(virDomainLoaderDef *loader,
static int
-virDomainLoaderDefParseXML(virDomainLoaderDef *loader,
- xmlNodePtr loaderNode,
- xmlNodePtr nvramNode,
- xmlNodePtr nvramSourceNode,
- xmlXPathContextPtr ctxt,
- virDomainXMLOption *xmlopt,
- unsigned int flags)
+virDomainLoaderDefParseXMLLoader(virDomainLoaderDef *loader,
+ xmlNodePtr loaderNode)
{
- if (virDomainLoaderDefParseXMLNvram(loader,
- nvramNode, nvramSourceNode,
- ctxt, xmlopt, flags) < 0)
- return -1;
-
if (!loaderNode)
return 0;
@@ -16828,6 +16818,28 @@ virDomainLoaderDefParseXML(virDomainLoaderDef *loader,
}
+static int
+virDomainLoaderDefParseXML(virDomainLoaderDef *loader,
+ xmlNodePtr loaderNode,
+ xmlNodePtr nvramNode,
+ xmlNodePtr nvramSourceNode,
+ xmlXPathContextPtr ctxt,
+ virDomainXMLOption *xmlopt,
+ unsigned int flags)
+{
+ if (virDomainLoaderDefParseXMLNvram(loader,
+ nvramNode, nvramSourceNode,
+ ctxt, xmlopt, flags) < 0)
+ return -1;
+
+ if (virDomainLoaderDefParseXMLLoader(loader,
+ loaderNode) < 0)
+ return -1;
+
+ return 0;
+}
+
+
static int
virDomainSchedulerParseCommonAttrs(xmlNodePtr node,
virProcessSchedPolicy *policy,
--
2.39.1