HomeClusterLabs Projects

Refactor: based: cib_cleanup_query() frees output if not current CIB

Description

Refactor: based: cib_cleanup_query() frees output if not current CIB

cib_process_command() is the only caller of operation->cleanup() (and
thus the only caller of cib_cleanup_query()). All other cleanup
functions already either free output or ensure that it's NULL.

So it's safe to move this step into cib_cleanup_query(), instead of
checking that cib_op_attr_modifies is unset and output != current_cib in
cib_process_command().

Further:

  • If cib_no_children is set, then cib_process_query() or cib_process_xpath() creates a new output XML object that is not the_cib. So (*output != the_cib) in this case.
  • If the element name is "xpath-query", then surely *output != the_cib.

So both of the original conditions are now redundant.

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

Details

Provenance
nrwahl2Authored on May 18 2023, 4:20 AM
Parents
rPe7147eacf1b1: Refactor: based: cib_process_default() -> cib_process_noop()
Branches
Unknown
Tags
Unknown