On Tue, Feb 26, 2019 at 06:08:11PM +0100, Peter Krempa wrote:
Quite a few parts modify the XPath context current node to shif the
shift
scope and allow easier queries. This also means that the node needs
to be restored afterwards.
Introduce a macro based on 'VIR_AUTOCLEAN' which adds a local structure
on the stack remembering the original node along with a function which
will make sure that the node is reset when the local structure leaves
scope.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/libvirt_private.syms | 1 +
src/util/virxml.c | 10 ++++++++++
src/util/virxml.h | 22 ++++++++++++++++++++++
3 files changed, 33 insertions(+)
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano