]> xenbits.xensource.com Git - libvirt.git/commit
util: XML: Introduce automatic reset of XPath's current node
authorPeter Krempa <pkrempa@redhat.com>
Tue, 26 Feb 2019 16:34:57 +0000 (17:34 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 4 Mar 2019 12:04:20 +0000 (13:04 +0100)
commit23ab20927220a4f2f70552f70dc14c8407863870
tree9db29e2f5f3eebb250274aab422a9cfd2ccdeb34
parent786f47414d7631031b3575c9570cdd6fbe4af8e9
util: XML: Introduce automatic reset of XPath's current node

Quite a few parts modify the XPath context current node to shift the
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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/libvirt_private.syms
src/util/virxml.c
src/util/virxml.h