From 4fc84496914eedadd7020ce278f3e758c648e64f Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 24 Jun 2019 18:12:48 +0200 Subject: [PATCH] conf: domain: Restore XPath context after virSecurityDeviceLabelDefParseXML MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The function modifies the context but did not care to restore it back. If a was used on a disk, the would not be parsed. Use VIR_XPATH_NODE_AUTORESTORE and add a test case to validate that everything works. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- src/conf/domain_conf.c | 1 + tests/qemustatusxml2xmldata/modern-in.xml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 33253edfdd..3323c9a5b1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8872,6 +8872,7 @@ virSecurityDeviceLabelDefParseXML(virSecurityDeviceLabelDefPtr **seclabels_rtn, xmlXPathContextPtr ctxt, unsigned int flags) { + VIR_XPATH_NODE_AUTORESTORE(ctxt); virSecurityDeviceLabelDefPtr *seclabels = NULL; size_t nseclabels = 0; int n; diff --git a/tests/qemustatusxml2xmldata/modern-in.xml b/tests/qemustatusxml2xmldata/modern-in.xml index 08f7f40761..f7104efa01 100644 --- a/tests/qemustatusxml2xmldata/modern-in.xml +++ b/tests/qemustatusxml2xmldata/modern-in.xml @@ -311,6 +311,9 @@ + + + -- 2.47.2