diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:39:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:39:28 +0000 |
commit | 924f5ea83e48277e014ebf0d19a27187cb93e2f7 (patch) | |
tree | 75920a275bba045f6d108204562c218a9a26ea15 /include/crm/pengine/status_compat.h | |
parent | Adding upstream version 2.1.7. (diff) | |
download | pacemaker-924f5ea83e48277e014ebf0d19a27187cb93e2f7.tar.xz pacemaker-924f5ea83e48277e014ebf0d19a27187cb93e2f7.zip |
Adding upstream version 2.1.8~rc1.upstream/2.1.8_rc1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/crm/pengine/status_compat.h')
-rw-r--r-- | include/crm/pengine/status_compat.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/include/crm/pengine/status_compat.h b/include/crm/pengine/status_compat.h new file mode 100644 index 0000000..1ff5506 --- /dev/null +++ b/include/crm/pengine/status_compat.h @@ -0,0 +1,72 @@ +/* + * Copyright 2004-2024 the Pacemaker project contributors + * + * The version control history for this file may have further details. + * + * This source code is licensed under the GNU Lesser General Public License + * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY. + */ + +#ifndef PCMK__CRM_PENGINE_STATUS_COMPAT__H +#define PCMK__CRM_PENGINE_STATUS_COMPAT__H + +#include <stdbool.h> // bool +#include <crm/common/util.h> // pcmk_is_set() +#include <crm/common/scheduler.h> // pcmk_resource_t, pcmk_rsc_unique, etc. + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file + * \brief Deprecated Pacemaker scheduler utilities + * \ingroup pengine + * \deprecated Do not include this header directly. The utilities in this + * header, and the header itself, will be removed in a future + * release. + */ + +// NOTE: sbd (as of at least 1.5.2) uses this +//! \deprecated Use pcmk_find_node() with scheduler object instead +pcmk_node_t *pe_find_node(const GList *node_list, const char *node_name); + +//! \deprecated Compare variant directly instead +static inline bool +pe_rsc_is_clone(const pcmk_resource_t *rsc) +{ + return (rsc != NULL) && (rsc->variant == pcmk_rsc_variant_clone); +} + +//! \deprecated Compare variant and flags directly +static inline bool +pe_rsc_is_unique_clone(const pcmk_resource_t *rsc) +{ + return pe_rsc_is_clone(rsc) && pcmk_is_set(rsc->flags, pcmk_rsc_unique); +} + +//! \deprecated Compare variant and flags directly +static inline bool +pe_rsc_is_anon_clone(const pcmk_resource_t *rsc) +{ + return pe_rsc_is_clone(rsc) && !pcmk_is_set(rsc->flags, pcmk_rsc_unique); +} + +//! \deprecated Compare ancestor variants directly +static inline bool +pe_rsc_is_bundled(const pcmk_resource_t *rsc) +{ + if (rsc == NULL) { + return false; + } + while (rsc->parent != NULL) { + rsc = rsc->parent; + } + return rsc->variant == pcmk_rsc_variant_bundle; +} + +#ifdef __cplusplus +} +#endif + +#endif // PCMK__CRM_PENGINE_STATUS_COMPAT__H |