HomeClusterLabs Projects

Refactor: libcrmcommon: Avoid xmlCopyNode() and xmlDocCopyNode()

Description

Refactor: libcrmcommon: Avoid xmlCopyNode() and xmlDocCopyNode()

To facilitate refactoring private data allocation/deallocation.

It would make sense to add a doc argument to pcmkxml_copy(), where
NULL means to use the parent's doc if parent is non-NULL. However, since
there's only one other caller of xmlDocCopyNode(), it's easier to hack
around the issue by calling pcmk
xml_copy() using the parent argument
to set the doc, and then immediately unlinking and relinking the new
node.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Fri, Sep 6, 8:49 PM
Parents
rP81ae818ea1dc: Test: cts-cli: Improve a couple of replacements
Branches
Unknown
Tags
Unknown