On 06/14/2018 08:33 AM, Daniel P. Berrangé wrote:
Introduce a new struct to act as the stateful owner of the
virNWFilterBindingDefPtr objects.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/conf/Makefile.inc.am | 2 +
src/conf/virnwfilterbindingobj.c | 299 +++++++++++++++++++++++++++++++
src/conf/virnwfilterbindingobj.h | 69 +++++++
src/libvirt_private.syms | 14 ++
4 files changed, 384 insertions(+)
create mode 100644 src/conf/virnwfilterbindingobj.c
create mode 100644 src/conf/virnwfilterbindingobj.h
While continuing, I tripped across this:
+
+static virNWFilterBindingObjPtr
+virNWFilterBindingObjParseNode(xmlDocPtr doc,
+ xmlNodePtr root)
+{
+ xmlXPathContextPtr ctxt = NULL;
+ virNWFilterBindingObjPtr obj = NULL;
+
+ if (STRNEQ((const char *)root->name, "filterbinding")) {
"filterbindingstatus"
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("unknown root element for filter binding"));
Found by adding the '%s' here to print the root->name...
+ goto cleanup;
+ }
+
+ ctxt = xmlXPathNewContext(doc);
+ if (ctxt == NULL) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ ctxt->node = root;
+ obj = virNWFilterBindingObjParseXML(doc, ctxt);
+
+ cleanup:
+ xmlXPathFreeContext(ctxt);
+ return obj;
+}
+
+
John