[PATCH] conf: Restore ctxt's node in right scope

Zhenzhong Duan posted 1 patch 2 years, 8 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20210722074418.18539-1-zhenzhong.duan@intel.com
src/conf/domain_conf.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] conf: Restore ctxt's node in right scope
Posted by Zhenzhong Duan 2 years, 8 months ago
We just found <qemu:commandline> is ignored in our xml. Further debug
shows that ctxt's node pointer isn't restored in virDomainSecDefParseXML(),
which leads to parsing of remaining elements failed.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
 src/conf/domain_conf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e05ea9ba88..13b7741eb8 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14772,6 +14772,7 @@ static virDomainSecDef *
 virDomainSecDefParseXML(xmlNodePtr lsecNode,
                         xmlXPathContextPtr ctxt)
 {
+    VIR_XPATH_NODE_AUTORESTORE(ctxt)
     g_autoptr(virDomainSecDef) sec = g_new0(virDomainSecDef, 1);
 
     ctxt->node = lsecNode;
-- 
2.25.1

Re: [PATCH] conf: Restore ctxt's node in right scope
Posted by Pavel Hrdina 2 years, 8 months ago
On Thu, Jul 22, 2021 at 03:44:18PM +0800, Zhenzhong Duan wrote:
> We just found <qemu:commandline> is ignored in our xml. Further debug
> shows that ctxt's node pointer isn't restored in virDomainSecDefParseXML(),
> which leads to parsing of remaining elements failed.
> 
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
> ---
>  src/conf/domain_conf.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>