HomeClusterLabs Projects

Refactor: xml: add&use internal API for external-buffer-free serializing

Description

Refactor: xml: add&use internal API for external-buffer-free serializing

This shall speed the original full-buffer gather-then-print round-trip
up a little bit, sparing also memory (and hence costly reallocation,
perhaps) to some extent.

For cibadmin in particular, this is a preparation for when we use the
same code path to also output generalized XML (e.g. incl. namespaces
that will be used shortly, to annotate ACL permissions as evaluated
for given user).

Note that we now also output sensibly readable XML for cases when
quotes/apostrophes are used since libxml is supposed to serialize
XML in the most optimal way (unlike our reinvented code) -- ACLs
regression test suite reflects that change.

Finally, the internal API only function at hand,
pcmk__xml_serialize_fd_formatted, would be the desired step towards
lowering memory requirements of pacemaker code whenever the XML is
output to a file-like abstraction (a comment is added to that effect).

Original commit by jnpkrn
Minor edits by waltdisgrace

closes T164

Details

Provenance
Jan Pokorný <jpokorny@redhat.com>Authored on Nov 13 2019, 10:56 AM
waltdisgraceCommitted on May 1 2023, 2:53 PM
Parents
rP51544f4ed0ef: Merge pull request #3062 from nrwahl2/nrwahl2-fixes
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task