HomeClusterLabs Projects

API: libcrmcluster: New pcmk_cluster_new() and pcmk_cluster_free()

Description

API: libcrmcluster: New pcmk_cluster_new() and pcmk_cluster_free()

pcmk_cluster_new() is a simple constructor that allocates a
crm_cluster_t object and asserts non-NULL. The use of a constructor
function will enable extending crm_cluster_t in the future.

pcmk_cluster_free() safely frees a crm_cluster_t object and its
dynamically allocated members.

These will likely be a part of the improvements for T598. That task may
also require functionizing freeing the members of crm_cluster_t, since
there's at least one place where crm_cluster_t is statically allocated
but its members are dynamically allocated.

Ref T598

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

Details

Provenance
nrwahl2Authored on Nov 24 2022, 5:08 PM
Parents
rP7099b9776675: Merge pull request #2950 from nrwahl2/nrwahl2-T106
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task