Signed-off-by: Shi Lei <shi_lei(a)massclouds.com>
---
src/conf/network_conf.c | 41 +----------------------------------------
src/conf/network_conf.h | 6 +++---
2 files changed, 4 insertions(+), 43 deletions(-)
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index e1790bc..8610fbc 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -174,13 +174,6 @@ virNetworkIPDefClear(virNetworkIPDefPtr def)
}
-static void
-virNetworkDNSForwarderClear(virNetworkDNSForwarderPtr def)
-{
- VIR_FREE(def->domain);
-}
-
-
static void
virNetworkDNSDefClear(virNetworkDNSDefPtr def)
{
@@ -888,7 +881,7 @@ virNetworkDNSTxtDefParseXMLHook(xmlNodePtr node G_GNUC_UNUSED,
}
-static int
+int
virNetworkDNSForwarderParseXMLHook(xmlNodePtr node G_GNUC_UNUSED,
virNetworkDNSForwarderPtr def,
const char *instname G_GNUC_UNUSED,
@@ -907,38 +900,6 @@ virNetworkDNSForwarderParseXMLHook(xmlNodePtr node G_GNUC_UNUSED,
}
-static int
-virNetworkDNSForwarderParseXML(xmlNodePtr node,
- virNetworkDNSForwarderPtr def,
- const char *networkName,
- void *opaque)
-{
- char *addr = virXMLPropString(node, "addr");
-
- if (addr && virSocketAddrParse(&def->addr,
- addr, AF_UNSPEC) < 0) {
- virReportError(VIR_ERR_XML_ERROR,
- _("Invalid forwarder IP address '%s' "
- "in network '%s'"),
- addr, networkName);
- VIR_FREE(addr);
- goto cleanup;
- }
- def->domain = virXMLPropString(node, "domain");
-
- if (virNetworkDNSForwarderParseXMLHook(node, def, networkName, opaque,
- addr, def->domain) < 0)
- goto cleanup;
-
- VIR_FREE(addr);
-
- return 0;
-
- cleanup:
- return -1;
-}
-
-
static int
virNetworkDNSDefParseXML(const char *networkName,
xmlNodePtr node,
diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h
index a5a4939..f14eef2 100644
--- a/src/conf/network_conf.h
+++ b/src/conf/network_conf.h
@@ -158,9 +158,9 @@ struct _virNetworkDNSHostDef { /* genparse:withhook, genformat */
typedef struct _virNetworkDNSForwarder virNetworkDNSForwarder;
typedef virNetworkDNSForwarder *virNetworkDNSForwarderPtr;
-struct _virNetworkDNSForwarder {
- virSocketAddr addr;
- char *domain;
+struct _virNetworkDNSForwarder { /* genparse:withhook */
+ virSocketAddr addr; /* xmlattr */
+ char *domain; /* xmlattr */
};
typedef struct _virNetworkDNSDef virNetworkDNSDef;
--
2.17.1