 |
pacemaker
2.0.3-4b1f869f0f
Scalable High-Availability cluster resource manager
|
Go to the documentation of this file.
10 #ifndef PE_INTERNAL__H
11 # define PE_INTERNAL__H
17 # define pe_rsc_info(rsc, fmt, args...) crm_log_tag(LOG_INFO, rsc ? rsc->id : "<NULL>", fmt, ##args)
18 # define pe_rsc_debug(rsc, fmt, args...) crm_log_tag(LOG_DEBUG, rsc ? rsc->id : "<NULL>", fmt, ##args)
19 # define pe_rsc_trace(rsc, fmt, args...) crm_log_tag(LOG_TRACE, rsc ? rsc->id : "<NULL>", fmt, ##args)
21 # define pe_err(fmt...) { was_processing_error = TRUE; crm_config_error = TRUE; crm_err(fmt); }
22 # define pe_warn(fmt...) { was_processing_warning = TRUE; crm_config_warning = TRUE; crm_warn(fmt); }
23 # define pe_proc_err(fmt...) { was_processing_error = TRUE; crm_err(fmt); }
24 # define pe_proc_warn(fmt...) { was_processing_warning = TRUE; crm_warn(fmt); }
25 # define pe_set_action_bit(action, bit) action->flags = crm_set_bit(__FUNCTION__, __LINE__, action->uuid, action->flags, bit)
26 # define pe_clear_action_bit(action, bit) action->flags = crm_clear_bit(__FUNCTION__, __LINE__, action->uuid, action->flags, bit)
76 void add_hash_param(GHashTable * hash,
const char *name,
const char *value);
108 ,
size_t pairs_count, ...);
154 uint32_t
flags, xmlNode *xml_op,
164 unsigned int *count_all,
165 unsigned int *count_clean);
167 unsigned int *count);
181 static inline gpointer
182 pe_hash_table_lookup(GHashTable * hash, gconstpointer key)
185 return g_hash_table_lookup(hash, key);
196 extern void print_node(
const char *pre_text,
node_t * node, gboolean details);
197 extern void print_str_str(gpointer key, gpointer value, gpointer user_data);
201 resource_t * rsc,
const char *comment, GHashTable * nodes);
206 # define dump_node_scores(level, rsc, text, nodes) do { \
207 dump_node_scores_worker(level, __FILE__, __FUNCTION__, __LINE__, rsc, text, nodes); \
219 # define delete_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_DELETE, 0)
220 # define delete_action(rsc, node, optional) custom_action( \
221 rsc, delete_key(rsc), CRMD_ACTION_DELETE, node, \
222 optional, TRUE, data_set);
224 # define stopped_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_STOPPED, 0)
225 # define stopped_action(rsc, node, optional) custom_action( \
226 rsc, stopped_key(rsc), CRMD_ACTION_STOPPED, node, \
227 optional, TRUE, data_set);
229 # define stop_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_STOP, 0)
230 # define stop_action(rsc, node, optional) custom_action( \
231 rsc, stop_key(rsc), CRMD_ACTION_STOP, node, \
232 optional, TRUE, data_set);
234 # define reload_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_RELOAD, 0)
235 # define start_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_START, 0)
236 # define start_action(rsc, node, optional) custom_action( \
237 rsc, start_key(rsc), CRMD_ACTION_START, node, \
238 optional, TRUE, data_set)
240 # define started_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_STARTED, 0)
241 # define started_action(rsc, node, optional) custom_action( \
242 rsc, started_key(rsc), CRMD_ACTION_STARTED, node, \
243 optional, TRUE, data_set)
245 # define promote_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_PROMOTE, 0)
246 # define promote_action(rsc, node, optional) custom_action( \
247 rsc, promote_key(rsc), CRMD_ACTION_PROMOTE, node, \
248 optional, TRUE, data_set)
250 # define promoted_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_PROMOTED, 0)
251 # define promoted_action(rsc, node, optional) custom_action( \
252 rsc, promoted_key(rsc), CRMD_ACTION_PROMOTED, node, \
253 optional, TRUE, data_set)
255 # define demote_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_DEMOTE, 0)
256 # define demote_action(rsc, node, optional) custom_action( \
257 rsc, demote_key(rsc), CRMD_ACTION_DEMOTE, node, \
258 optional, TRUE, data_set)
260 # define demoted_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_DEMOTED, 0)
261 # define demoted_action(rsc, node, optional) custom_action( \
262 rsc, demoted_key(rsc), CRMD_ACTION_DEMOTED, node, \
263 optional, TRUE, data_set)
271 gboolean allow_non_atomic);
278 const char *task,
bool require_node);
300 pe_base_name_eq(
resource_t *rsc,
const char *
id)
302 if (
id && rsc && rsc->
id) {
306 return (strlen(
id) == base_len) && !strncmp(
id, rsc->
id, base_len);
348 #define pe_action_required(action, reason, text) pe_action_set_flag_reason(__FUNCTION__, __LINE__, action, reason, text, pe_action_optional, FALSE)
349 #define pe_action_implies(action, reason, flag) pe_action_set_flag_reason(__FUNCTION__, __LINE__, action, reason, NULL, flag, FALSE)
354 gboolean
add_tag_ref(GHashTable * tags,
const char * tag_name,
const char * obj_ref);
357 void * print_data, gboolean print_all);
389 #define BOOL2STR(x) ((x) ? "true" : "false")
397 GHashTable *node_hash, GHashTable *hash,
398 const char *always_first, gboolean overwrite,
GList * find_actions_exact(GList *input, const char *key, const pe_node_t *on_node)
gboolean get_target_role(resource_t *rsc, enum rsc_role_e *role)
void pe__unpack_dataset_nvpairs(xmlNode *xml_obj, const char *set_name, GHashTable *node_hash, GHashTable *hash, const char *always_first, gboolean overwrite, pe_working_set_t *data_set)
const char * pe_base_name_end(const char *id)
enum rsc_role_e pe__bundle_resource_state(const pe_resource_t *rsc, gboolean current)
gboolean order_actions(action_t *lh_action, action_t *rh_action, enum pe_ordering order)
int pe__clone_html(pcmk__output_t *out, va_list args)
enum rsc_role_e native_resource_state(const resource_t *rsc, gboolean current)
xmlNode * find_rsc_op_entry(resource_t *rsc, const char *key)
gboolean group_active(resource_t *rsc, gboolean all)
enum rsc_digest_cmp_val rc
char * digest_secure_calc
void pe__count_common(pe_resource_t *rsc)
void pe__rscs_brief_output(pcmk__output_t *out, GListPtr rsc_list, long options, gboolean print_all)
void dump_node_capacity(int level, const char *comment, node_t *node)
void common_update_score(resource_t *rsc, const char *id, int score)
void common_free(resource_t *rsc)
enum rsc_role_e clone_resource_state(const resource_t *rsc, gboolean current)
gint sort_rsc_index(gconstpointer a, gconstpointer b)
gboolean native_unpack(resource_t *rsc, pe_working_set_t *data_set)
void pe__common_output_html(pcmk__output_t *out, resource_t *rsc, const char *name, node_t *node, long options)
int pe__clone_xml(pcmk__output_t *out, va_list args)
resource_t * native_find_rsc(resource_t *rsc, const char *id, const node_t *node, int flags)
gint sort_rsc_priority(gconstpointer a, gconstpointer b)
void print_rscs_brief(GListPtr rsc_list, const char *pre_text, long options, void *print_data, gboolean print_all)
enum action_tasks get_complex_task(resource_t *rsc, const char *name, gboolean allow_non_atomic)
action_t * custom_action(resource_t *rsc, char *key, const char *task, node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set)
struct op_digest_cache_s op_digest_cache_t
resource_t * find_clone_instance(resource_t *rsc, const char *sub_id, pe_working_set_t *data_set)
enum crm_ais_msg_types type
bool pe_can_fence(pe_working_set_t *data_set, node_t *node)
int pe_get_configured_timeout(resource_t *rsc, const char *action, pe_working_set_t *data_set)
void pe__update_recheck_time(time_t recheck, pe_working_set_t *data_set)
pe_node_t * native_location(const pe_resource_t *rsc, GList **list, int current)
void trigger_unfencing(resource_t *rsc, node_t *node, const char *reason, action_t *dependency, pe_working_set_t *data_set)
void pe__count_bundle(pe_resource_t *rsc)
void pe_action_set_flag_reason(const char *function, long line, pe_action_t *action, pe_action_t *reason, const char *text, enum pe_action_flags flags, bool overwrite)
int pe__group_xml(pcmk__output_t *out, va_list args)
struct pe__order_constraint_s pe__ordering_t
int pe__bundle_text(pcmk__output_t *out, va_list args)
gboolean common_unpack(xmlNode *xml_obj, resource_t **rsc, resource_t *parent, pe_working_set_t *data_set)
int pe_get_failcount(node_t *node, resource_t *rsc, time_t *last_failure, uint32_t flags, xmlNode *xml_op, pe_working_set_t *data_set)
int pe__resource_html(pcmk__output_t *out, va_list args)
void native_free(resource_t *rsc)
void clone_print(resource_t *rsc, const char *pre_text, long options, void *print_data)
void common_print(resource_t *rsc, const char *pre_text, const char *name, node_t *node, long options, void *print_data)
void print_node(const char *pre_text, node_t *node, gboolean details)
action_t * get_pseudo_op(const char *name, pe_working_set_t *data_set)
int pe__group_text(pcmk__output_t *out, va_list args)
gboolean pe__unpack_bundle(pe_resource_t *rsc, pe_working_set_t *data_set)
void set_bit_recursive(resource_t *rsc, unsigned long long flag)
bool pe__resource_is_disabled(pe_resource_t *rsc)
void pe_fence_node(pe_working_set_t *data_set, node_t *node, const char *reason)
Schedule a fence action for a node.
GListPtr node_list_dup(GListPtr list, gboolean reset, gboolean filter)
void pe__print_bundle(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
op_digest_cache_t * rsc_action_digest_cmp(resource_t *rsc, xmlNode *xml_op, node_t *node, pe_working_set_t *data_set)
enum rsc_role_e role_filter
void clone_free(resource_t *rsc)
void group_print(resource_t *rsc, const char *pre_text, long options, void *print_data)
int pe__bundle_html(pcmk__output_t *out, va_list args)
bool is_set_recursive(resource_t *rsc, long long flag, bool any)
pe_resource_t * pe__find_bundle_replica(const pe_resource_t *bundle, const pe_node_t *node)
void pe__free_bundle(pe_resource_t *rsc)
void pe_action_set_reason(pe_action_t *action, const char *reason, bool overwrite)
gboolean clone_unpack(resource_t *rsc, pe_working_set_t *data_set)
const char * pe_node_attribute_calculated(const pe_node_t *node, const char *name, const resource_t *rsc)
void pe__register_messages(pcmk__output_t *out)
void pe__foreach_param_check(pe_working_set_t *data_set, void(*cb)(pe_resource_t *, pe_node_t *, xmlNode *, enum pe_check_parameters, pe_working_set_t *))
int pe__resource_xml(pcmk__output_t *out, va_list args)
void native_add_running(resource_t *rsc, node_t *node, pe_working_set_t *data_set)
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
time_t get_effective_time(pe_working_set_t *data_set)
enum pe_discover_e discover_mode
char * clone_strip(const char *last_rsc_id)
int pe__bundle_xml(pcmk__output_t *out, va_list args)
bool pe__shutdown_requested(pe_node_t *node)
int pe__group_html(pcmk__output_t *out, va_list args)
node_t * node_copy(const node_t *this_node)
pe_node_t * pe__find_active_on(const pe_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
void pe__common_output_text(pcmk__output_t *out, resource_t *rsc, const char *name, node_t *node, long options)
GHashTable * node_hash_from_list(GListPtr list)
gboolean clone_active(resource_t *rsc, gboolean all)
char * digest_restart_calc
node_t * pe_create_node(const char *id, const char *uname, const char *type, const char *score, pe_working_set_t *data_set)
gint sort_node_uname(gconstpointer a, gconstpointer b)
ticket_t * ticket_new(const char *ticket_id, pe_working_set_t *data_set)
struct pe__location_constraint_s pe__location_t
void add_hash_param(GHashTable *hash, const char *name, const char *value)
gboolean add_tag_ref(GHashTable *tags, const char *tag_name, const char *obj_ref)
action_t * pe_fence_op(node_t *node, const char *op, bool optional, const char *reason, pe_working_set_t *data_set)
GHashTable * node_hash_dup(GHashTable *hash)
This structure contains everything that makes up a single output formatter.
void resource_location(resource_t *rsc, node_t *node, int score, const char *tag, pe_working_set_t *data_set)
char * native_parameter(resource_t *rsc, node_t *node, gboolean create, const char *name, pe_working_set_t *data_set)
GListPtr find_actions(GListPtr input, const char *key, const node_t *on_node)
bool remote_id_conflict(const char *remote_name, pe_working_set_t *data)
void verify_pe_options(GHashTable *options)
void dump_node_scores_worker(int level, const char *file, const char *function, int line, resource_t *rsc, const char *comment, GHashTable *nodes)
GHashTable * allowed_nodes
void group_free(resource_t *rsc)
void dump_rsc_utilization(int level, const char *comment, resource_t *rsc, node_t *node)
void pe__free_param_checks(pe_working_set_t *data_set)
int pe__clone_text(pcmk__output_t *out, va_list args)
void pe__add_param_check(xmlNode *rsc_op, pe_resource_t *rsc, pe_node_t *node, enum pe_check_parameters, pe_working_set_t *data_set)
int pe__resource_text(pcmk__output_t *out, va_list args)
void native_print(resource_t *rsc, const char *pre_text, long options, void *print_data)
bool pe__bundle_needs_remote_name(pe_resource_t *rsc)
GList * pe__resource_actions(const pe_resource_t *rsc, const pe_node_t *node, const char *task, bool require_node)
Find all actions of given type for a resource.
void print_str_str(gpointer key, gpointer value, gpointer user_data)
pe_action_t * pe__clear_failcount(pe_resource_t *rsc, pe_node_t *node, const char *reason, pe_working_set_t *data_set)
Schedule a controller operation to clear a fail count.
enum rsc_role_e group_resource_state(const resource_t *rsc, gboolean current)
pe_node_t * pe__find_active_requires(const pe_resource_t *rsc, unsigned int *count)
void node_list_exclude(GHashTable *list, GListPtr list2, gboolean merge_scores)
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
gboolean group_unpack(resource_t *rsc, pe_working_set_t *data_set)
int merge_weights(int w1, int w2)
gboolean native_active(resource_t *rsc, gboolean all)
char * clone_zero(const char *last_rsc_id)
void pe__output_node(node_t *node, gboolean details, pcmk__output_t *out)
void pe_free_action(action_t *action)
gboolean pe__bundle_active(pe_resource_t *rsc, gboolean all)
void clear_bit_recursive(resource_t *rsc, unsigned long long flag)
void destroy_ticket(gpointer data)
bool pe__is_universal_clone(pe_resource_t *rsc, pe_working_set_t *data_set)
Cluster status and scheduling.
int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name, size_t pairs_count,...)
const char * pe__add_bundle_remote_name(pe_resource_t *rsc, xmlNode *xml, const char *field)
struct notify_data_s notify_data_t
int pe__target_rc_from_xml(xmlNode *xml_op)
Formatted output for pacemaker tools.
GListPtr find_recurring_actions(GListPtr input, node_t *not_on_node)
action_t * find_first_action(GListPtr input, const char *uuid, const char *task, node_t *on_node)