root/include/crm/common/scheduler_internal.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright 2004-2024 the Pacemaker project contributors
   3  *
   4  * The version control history for this file may have further details.
   5  *
   6  * This source code is licensed under the GNU Lesser General Public License
   7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
   8  */
   9 
  10 #ifndef PCMK__CRM_COMMON_SCHEDULER_INTERNAL__H
  11 #define PCMK__CRM_COMMON_SCHEDULER_INTERNAL__H
  12 
  13 #include <crm/common/action_relation_internal.h>
  14 #include <crm/common/actions_internal.h>
  15 #include <crm/common/attrs_internal.h>
  16 #include <crm/common/bundles_internal.h>
  17 #include <crm/common/clone_internal.h>
  18 #include <crm/common/digests_internal.h>
  19 #include <crm/common/failcounts_internal.h>
  20 #include <crm/common/group_internal.h>
  21 #include <crm/common/history_internal.h>
  22 #include <crm/common/location_internal.h>
  23 #include <crm/common/nodes_internal.h>
  24 #include <crm/common/primitive_internal.h>
  25 #include <crm/common/remote_internal.h>
  26 #include <crm/common/resources_internal.h>
  27 #include <crm/common/roles_internal.h>
  28 #include <crm/common/rules_internal.h>
  29 
  30 #ifdef __cplusplus
  31 extern "C" {
  32 #endif
  33 
  34 enum pcmk__check_parameters {
  35     /* Clear fail count if parameters changed for un-expired start or monitor
  36      * last_failure.
  37      */
  38     pcmk__check_last_failure,
  39 
  40     /* Clear fail count if parameters changed for start, monitor, promote, or
  41      * migrate_from actions for active resources.
  42      */
  43     pcmk__check_active,
  44 };
  45 
  46 // Group of enum pcmk__warnings flags for warnings we want to log once
  47 extern uint32_t pcmk__warnings;
  48 
  49 /*!
  50  * \internal
  51  * \brief Log a resource-tagged message at info severity
  52  *
  53  * \param[in] rsc       Tag message with this resource's ID
  54  * \param[in] fmt...    printf(3)-style format and arguments
  55  */
  56 #define pcmk__rsc_info(rsc, fmt, args...)   \
  57     crm_log_tag(LOG_INFO, ((rsc) == NULL)? "<NULL>" : (rsc)->id, (fmt), ##args)
  58 
  59 /*!
  60  * \internal
  61  * \brief Log a resource-tagged message at debug severity
  62  *
  63  * \param[in] rsc       Tag message with this resource's ID
  64  * \param[in] fmt...    printf(3)-style format and arguments
  65  */
  66 #define pcmk__rsc_debug(rsc, fmt, args...)  \
  67     crm_log_tag(LOG_DEBUG, ((rsc) == NULL)? "<NULL>" : (rsc)->id, (fmt), ##args)
  68 
  69 /*!
  70  * \internal
  71  * \brief Log a resource-tagged message at trace severity
  72  *
  73  * \param[in] rsc       Tag message with this resource's ID
  74  * \param[in] fmt...    printf(3)-style format and arguments
  75  */
  76 #define pcmk__rsc_trace(rsc, fmt, args...)  \
  77     crm_log_tag(LOG_TRACE, ((rsc) == NULL)? "<NULL>" : (rsc)->id, (fmt), ##args)
  78 
  79 /*!
  80  * \internal
  81  * \brief Log an error and remember that current scheduler input has errors
  82  *
  83  * \param[in] fmt...  printf(3)-style format and arguments
  84  */
  85 #define pcmk__sched_err(fmt...) do {    \
  86         was_processing_error = TRUE;    \
  87         crm_err(fmt);                   \
  88     } while (0)
  89 
  90 /*!
  91  * \internal
  92  * \brief Log a warning and remember that current scheduler input has warnings
  93  *
  94  * \param[in] fmt...  printf(3)-style format and arguments
  95  */
  96 #define pcmk__sched_warn(fmt...) do {   \
  97         was_processing_warning = TRUE;  \
  98         crm_warn(fmt);                  \
  99     } while (0)
 100 
 101 /*!
 102  * \internal
 103  * \brief Set scheduler flags
 104  *
 105  * \param[in,out] scheduler     Scheduler data
 106  * \param[in]     flags_to_set  Group of enum pcmk_scheduler_flags to set
 107  */
 108 #define pcmk__set_scheduler_flags(scheduler, flags_to_set) do {             \
 109         (scheduler)->flags = pcmk__set_flags_as(__func__, __LINE__,         \
 110             LOG_TRACE, "Scheduler", crm_system_name,                        \
 111             (scheduler)->flags, (flags_to_set), #flags_to_set);             \
 112     } while (0)
 113 
 114 /*!
 115  * \internal
 116  * \brief Clear scheduler flags
 117  *
 118  * \param[in,out] scheduler       Scheduler data
 119  * \param[in]     flags_to_clear  Group of enum pcmk_scheduler_flags to clear
 120  */
 121 #define pcmk__clear_scheduler_flags(scheduler, flags_to_clear) do {         \
 122         (scheduler)->flags = pcmk__clear_flags_as(__func__, __LINE__,       \
 123             LOG_TRACE, "Scheduler", crm_system_name,                        \
 124             (scheduler)->flags, (flags_to_clear), #flags_to_clear);         \
 125     } while (0)
 126 
 127 #ifdef __cplusplus
 128 }
 129 #endif
 130 
 131 #endif // PCMK__CRM_COMMON_SCHEDULER_INTERNAL__H

/* [previous][next][first][last][top][bottom][index][help] */