[PATCH v2 2/8] virSysinfoParseXML: Mangle ctxt inside virSysinfoParseXML()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There's no need to set ctxt->node outside of the function. The
function can set it itself - it has all the info needed.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e84fbe1e21..57a5b7befe 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -15714,10 +15714,13 @@ virSysinfoParseXML(xmlNodePtr node,
                   unsigned char *domUUID,
                   bool uuid_generated)
 {
+    VIR_XPATH_NODE_AUTORESTORE(ctxt);
     virSysinfoDefPtr def;
     xmlNodePtr tmpnode;
     g_autofree char *type = NULL;
 
+    ctxt->node = node;
+
     if (!virXMLNodeNameEqual(node, "sysinfo")) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
                        _("XML does not contain expected 'sysinfo' element"));
@@ -22179,8 +22182,6 @@ virDomainDefParseXML(xmlDocPtr xml,
     }
 
     if ((node = virXPathNode("./sysinfo[1]", ctxt)) != NULL) {
-        VIR_XPATH_NODE_AUTORESTORE(ctxt);
-        ctxt->node = node;
         def->sysinfo = virSysinfoParseXML(node, ctxt,
                                           def->uuid, uuid_generated);
 
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux