[libvirt] [PATCH v3 14/20] conf: introduce a virNWFilterBindingObjPtr struct
John Ferlan
jferlan at redhat.com
Mon Jun 18 14:08:00 UTC 2018
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 at 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
More information about the libvir-list
mailing list