[PATCH 42/43] test_driver: Make callers of testOpenParse ensure the root element name

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

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/test/test_driver.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 373e5f7846..8675f8ad07 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1306,12 +1306,6 @@ testOpenParse(testDriver *privconn,
               const char *file,
               xmlXPathContextPtr ctxt)
 {
-    if (!virXMLNodeNameEqual(ctxt->node, "node")) {
-        virReportError(VIR_ERR_XML_ERROR, "%s",
-                       _("Root element is not 'node'"));
-        return -1;
-    }
-
     if (testParseNodeInfo(&privconn->nodeInfo, ctxt) < 0)
         return -1;
     if (testParseDomains(privconn, file, ctxt) < 0)
@@ -1348,7 +1342,7 @@ testOpenFromFile(virConnectPtr conn, const char *file)
     if (!(privconn->caps = testBuildCapabilities(conn)))
         goto error;

-    if (!(doc = virXMLParseFileCtxt(file, &ctxt)))
+    if (!(doc = virXMLParse(file, NULL, NULL, "node", &ctxt, NULL, false)))
         goto error;

     privconn->numCells = 0;
@@ -1411,8 +1405,8 @@ testOpenDefault(virConnectPtr conn)
     if (!(privconn->caps = testBuildCapabilities(conn)))
         goto error;

-    if (!(doc = virXMLParseStringCtxt(defaultConnXML,
-                                      _("(test driver)"), &ctxt)))
+    if (!(doc = virXMLParse(NULL, defaultConnXML, _("(test driver)"),
+                            "node", &ctxt, NULL, false)))
         goto error;

     if (testOpenParse(privconn, NULL, ctxt) < 0)
-- 
2.37.3




[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