[libvirt] [PATCH 15/34] util: xml: Introduce VIR_AUTOPTR functions for xmlDoc and xmlXPathContext

Peter Krempa posted 34 patches 6 years, 10 months ago
There is a newer version of this series
[libvirt] [PATCH 15/34] util: xml: Introduce VIR_AUTOPTR functions for xmlDoc and xmlXPathContext
Posted by Peter Krempa 6 years, 10 months ago
We can use our VIR_AUTOPTR machinery also for libxml2's xmlDoc and
xmlXPathContext.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/util/virxml.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util/virxml.h b/src/util/virxml.h
index b91fedde82..4875e88f2e 100644
--- a/src/util/virxml.h
+++ b/src/util/virxml.h
@@ -244,4 +244,7 @@ VIR_DEFINE_AUTOCLEAN_FUNC(virXPathContextNodeSave, virXPathContextNodeRestore);
                                                                  .node = _ctxt->node}; \
     ignore_value(&_ctxt ## CtxtSave)

+VIR_DEFINE_AUTOPTR_FUNC(xmlDoc, xmlFreeDoc);
+VIR_DEFINE_AUTOPTR_FUNC(xmlXPathContext, xmlXPathFreeContext);
+
 #endif /* LIBVIRT_VIRXML_H */
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 15/34] util: xml: Introduce VIR_AUTOPTR functions for xmlDoc and xmlXPathContext
Posted by Ján Tomko 6 years, 10 months ago
On Mon, Mar 18, 2019 at 04:55:04PM +0100, Peter Krempa wrote:
>We can use our VIR_AUTOPTR machinery also for libxml2's xmlDoc and
>xmlXPathContext.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/util/virxml.h | 3 +++
> 1 file changed, 3 insertions(+)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list