summaryrefslogtreecommitdiffstats
path: root/include/crm/common/actions_internal.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:39:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:39:28 +0000
commit924f5ea83e48277e014ebf0d19a27187cb93e2f7 (patch)
tree75920a275bba045f6d108204562c218a9a26ea15 /include/crm/common/actions_internal.h
parentAdding upstream version 2.1.7. (diff)
downloadpacemaker-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/common/actions_internal.h')
-rw-r--r--include/crm/common/actions_internal.h71
1 files changed, 70 insertions, 1 deletions
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);