From 924f5ea83e48277e014ebf0d19a27187cb93e2f7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 3 Jun 2024 15:39:28 +0200 Subject: Adding upstream version 2.1.8~rc1. Signed-off-by: Daniel Baumann --- include/crm/common/actions_internal.h | 71 ++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) (limited to 'include/crm/common/actions_internal.h') diff --git a/include/crm/common/actions_internal.h b/include/crm/common/actions_internal.h index 7e794e6..4a148f0 100644 --- a/include/crm/common/actions_internal.h +++ b/include/crm/common/actions_internal.h @@ -1,5 +1,5 @@ /* - * Copyright 2004-2023 the Pacemaker project contributors + * Copyright 2004-2024 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -21,9 +21,78 @@ extern "C" { #endif +// Action names as strings + +// @COMPAT Deprecated since 2.0.0 +#define PCMK__ACTION_POWEROFF "poweroff" + + //! printf-style format to create operation key from resource, action, interval #define PCMK__OP_FMT "%s_%s_%u" +/*! + * \internal + * \brief Set action flags for an action + * + * \param[in,out] action Action to set flags for + * \param[in] flags_to_set Group of enum pe_action_flags to set + */ +#define pcmk__set_action_flags(action, flags_to_set) do { \ + (action)->flags = pcmk__set_flags_as(__func__, __LINE__, \ + LOG_TRACE, \ + "Action", (action)->uuid, \ + (action)->flags, \ + (flags_to_set), \ + #flags_to_set); \ + } while (0) + +/*! + * \internal + * \brief Clear action flags for an action + * + * \param[in,out] action Action to clear flags for + * \param[in] flags_to_clear Group of enum pe_action_flags to clear + */ +#define pcmk__clear_action_flags(action, flags_to_clear) do { \ + (action)->flags = pcmk__clear_flags_as(__func__, __LINE__, \ + LOG_TRACE, \ + "Action", (action)->uuid, \ + (action)->flags, \ + (flags_to_clear), \ + #flags_to_clear); \ + } while (0) + +/*! + * \internal + * \brief Set action flags for a flag group + * + * \param[in,out] action_flags Flag group to set flags for + * \param[in] action_name Name of action being modified (for logging) + * \param[in] to_set Group of enum pe_action_flags to set + */ +#define pcmk__set_raw_action_flags(action_flags, action_name, to_set) do { \ + action_flags = pcmk__set_flags_as(__func__, __LINE__, \ + LOG_TRACE, "Action", action_name, \ + (action_flags), \ + (to_set), #to_set); \ + } while (0) + +/*! + * \internal + * \brief Clear action flags for a flag group + * + * \param[in,out] action_flags Flag group to clear flags for + * \param[in] action_name Name of action being modified (for logging) + * \param[in] to_clear Group of enum pe_action_flags to clear + */ +#define pcmk__clear_raw_action_flags(action_flags, action_name, to_clear) \ + do { \ + action_flags = pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, \ + "Action", action_name, \ + (action_flags), \ + (to_clear), #to_clear); \ + } while (0) + char *pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms); char *pcmk__notify_key(const char *rsc_id, const char *notify_type, const char *op_type); -- cgit v1.2.3