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

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


The only caller passes 'node' argument originating from an XPath lookup
for the 'system' 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 8e9f415070..d9b77eddb4 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -12189,12 +12189,6 @@ virSysinfoSystemParseXML(xmlNodePtr node,

     ctxt->node = node;

-    if (!virXMLNodeNameEqual(node, "system")) {
-        virReportError(VIR_ERR_XML_ERROR, "%s",
-                       _("XML does not contain expected 'system' element"));
-        return -1;
-    }
-
     def->manufacturer = virXPathString("string(entry[@name='manufacturer'])", ctxt);
     def->product = virXPathString("string(entry[@name='product'])", ctxt);
     def->version = virXPathString("string(entry[@name='version'])", ctxt);
-- 
2.37.3



More information about the libvir-list mailing list