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

[libvirt] [PATCH 19/21] conf: network: use virXMLNamespaceRegister



Signed-off-by: Ján Tomko <jtomko redhat com>
---
 src/conf/network_conf.c     |  2 ++
 src/network/bridge_driver.c | 10 ----------
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 7eba9eacbf..8db041bd2c 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -2051,6 +2051,8 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt,
     if (xmlopt)
         def->ns = xmlopt->ns;
     if (def->ns.parse) {
+        if (virXMLNamespaceRegister(ctxt, &def->ns) < 0)
+            goto error;
         if ((def->ns.parse)(ctxt, &def->namespaceData) < 0)
             goto error;
     }
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index a3f7ae337a..dd4f111cc0 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -69,8 +69,6 @@
 #include "virjson.h"
 #include "virnetworkportdef.h"
 
-#include <libxml/xpathInternals.h>
-
 #define VIR_FROM_THIS VIR_FROM_NETWORK
 #define MAX_BRIDGE_ID 256
 
@@ -191,14 +189,6 @@ networkDnsmasqDefNamespaceParse(xmlXPathContextPtr ctxt,
     networkDnsmasqXmlNsDefPtr nsdata = NULL;
     int ret = -1;
 
-    if (xmlXPathRegisterNs(ctxt, BAD_CAST "dnsmasq",
-                           BAD_CAST DNSMASQ_NAMESPACE_HREF) < 0) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to register xml namespace '%s'"),
-                       DNSMASQ_NAMESPACE_HREF);
-        return -1;
-    }
-
     if (VIR_ALLOC(nsdata) < 0)
         return -1;
 
-- 
2.19.2


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