[PATCH 11/11] conf: domain: Remove pointless XML node name validation in virSysinfoParseXML

Peter Krempa pkrempa at redhat.com
Tue Nov 1 15:02:25 UTC 2022


The only caller passes 'node' argument originating from an XPath lookup
for the 'sysinfo' element, so there's no point in checking it once more.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/conf/domain_conf.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 71997e586a..65f8ad20c9 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -12454,12 +12454,6 @@ virSysinfoParseXML(xmlNodePtr node,

     ctxt->node = node;

-    if (!virXMLNodeNameEqual(node, "sysinfo")) {
-        virReportError(VIR_ERR_XML_ERROR, "%s",
-                       _("XML does not contain expected 'sysinfo' element"));
-        return NULL;
-    }
-
     if (virXMLPropEnum(node, "type", virSysinfoTypeFromString,
                        VIR_XML_PROP_REQUIRED, &def->type) < 0)
         return NULL;
-- 
2.37.3



More information about the libvir-list mailing list