HomeClusterLabs Projects

Low: libcrmcommon: pcmk__output_xml_add_node() -> *_copy()

Description

Low: libcrmcommon: pcmk__output_xml_add_node() -> *_copy()

pcmk__output_xml_add_node() has no remaining callers. It's been found
not to work correctly if the added node is not already in the same
document as the parent. Here we create a more flexible version of this
function: we add a copy of the passed-in node as a child of the current
parent (the node at the tail of the parent queue).

Since we only make a copy, the caller retains ownership of the node
argument. The copy will be freed when the output object is freed.

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

Details

Provenance
nrwahl2Authored on Dec 5 2022, 5:20 PM
Parents
rPb8769e881a01: Low: libcrmcommon: Assert on failed copy in copy_xml()
Branches
Unknown
Tags
Unknown