18 #ifndef PE_INTERNAL__H 19 # define PE_INTERNAL__H 23 # define pe_rsc_info(rsc, fmt, args...) crm_log_tag(LOG_INFO, rsc ? rsc->id : "<NULL>", fmt, ##args) 24 # define pe_rsc_debug(rsc, fmt, args...) crm_log_tag(LOG_DEBUG, rsc ? rsc->id : "<NULL>", fmt, ##args) 25 # define pe_rsc_trace(rsc, fmt, args...) crm_log_tag(LOG_TRACE, rsc ? rsc->id : "<NULL>", fmt, ##args) 27 # define pe_err(fmt...) { was_processing_error = TRUE; crm_config_error = TRUE; crm_err(fmt); } 28 # define pe_warn(fmt...) { was_processing_warning = TRUE; crm_config_warning = TRUE; crm_warn(fmt); } 29 # define pe_proc_err(fmt...) { was_processing_error = TRUE; crm_err(fmt); } 30 # define pe_proc_warn(fmt...) { was_processing_warning = TRUE; crm_warn(fmt); } 31 # define pe_set_action_bit(action, bit) action->flags = crm_set_bit(__FUNCTION__, __LINE__, action->uuid, action->flags, bit) 32 # define pe_clear_action_bit(action, bit) action->flags = crm_clear_bit(__FUNCTION__, __LINE__, action->uuid, action->flags, bit) 59 void add_hash_param(GHashTable * hash,
const char *name,
const char *value);
128 static inline gpointer
129 pe_hash_table_lookup(GHashTable * hash, gconstpointer key)
132 return g_hash_table_lookup(hash, key);
151 extern void print_node(
const char *pre_text,
node_t * node, gboolean details);
156 resource_t * rsc,
const char *comment, GHashTable * nodes);
161 # define dump_node_scores(level, rsc, text, nodes) do { \ 162 dump_node_scores_worker(level, __FILE__, __FUNCTION__, __LINE__, rsc, text, nodes); \ 174 # define delete_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_DELETE, 0) 175 # define delete_action(rsc, node, optional) custom_action( \ 176 rsc, delete_key(rsc), CRMD_ACTION_DELETE, node, \ 177 optional, TRUE, data_set); 179 # define stopped_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_STOPPED, 0) 180 # define stopped_action(rsc, node, optional) custom_action( \ 181 rsc, stopped_key(rsc), CRMD_ACTION_STOPPED, node, \ 182 optional, TRUE, data_set); 184 # define stop_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_STOP, 0) 185 # define stop_action(rsc, node, optional) custom_action( \ 186 rsc, stop_key(rsc), CRMD_ACTION_STOP, node, \ 187 optional, TRUE, data_set); 189 # define reload_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_RELOAD, 0) 190 # define start_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_START, 0) 191 # define start_action(rsc, node, optional) custom_action( \ 192 rsc, start_key(rsc), CRMD_ACTION_START, node, \ 193 optional, TRUE, data_set) 195 # define started_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_STARTED, 0) 196 # define started_action(rsc, node, optional) custom_action( \ 197 rsc, started_key(rsc), CRMD_ACTION_STARTED, node, \ 198 optional, TRUE, data_set) 200 # define promote_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_PROMOTE, 0) 201 # define promote_action(rsc, node, optional) custom_action( \ 202 rsc, promote_key(rsc), CRMD_ACTION_PROMOTE, node, \ 203 optional, TRUE, data_set) 205 # define promoted_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_PROMOTED, 0) 206 # define promoted_action(rsc, node, optional) custom_action( \ 207 rsc, promoted_key(rsc), CRMD_ACTION_PROMOTED, node, \ 208 optional, TRUE, data_set) 210 # define demote_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_DEMOTE, 0) 211 # define demote_action(rsc, node, optional) custom_action( \ 212 rsc, demote_key(rsc), CRMD_ACTION_DEMOTE, node, \ 213 optional, TRUE, data_set) 215 # define demoted_key(rsc) generate_op_key(rsc->id, CRMD_ACTION_DEMOTED, 0) 216 # define demoted_action(rsc, node, optional) custom_action( \ 217 rsc, demoted_key(rsc), CRMD_ACTION_DEMOTED, node, \ 218 optional, TRUE, data_set) 223 gboolean allow_non_atomic);
283 #define pe_action_required(action, reason, text) pe_action_set_flag_reason(__FUNCTION__, __LINE__, action, reason, text, pe_action_optional, FALSE) 284 #define pe_action_implies(action, reason, flag) pe_action_set_flag_reason(__FUNCTION__, __LINE__, action, reason, NULL, flag, FALSE) 289 gboolean
add_tag_ref(GHashTable * tags,
const char * tag_name,
const char * obj_ref);
292 void * print_data, gboolean print_all);
bool remote_id_conflict(const char *remote_name, pe_working_set_t *data)
void verify_pe_options(GHashTable *options)
void container_free(resource_t *rsc)
void clone_print(resource_t *rsc, const char *pre_text, long options, void *print_data)
void group_free(resource_t *rsc)
void dump_rsc_utilization(int level, const char *comment, resource_t *rsc, node_t *node)
gint sort_rsc_priority(gconstpointer a, gconstpointer b)
gint sort_rsc_index(gconstpointer a, gconstpointer b)
gboolean get_target_role(resource_t *rsc, enum rsc_role_e *role)
node_t * node_copy(const node_t *this_node)
GListPtr node_list_dup(GListPtr list, gboolean reset, gboolean filter)
GHashTable * allowed_nodes
node_t * pe_create_node(const char *id, const char *uname, const char *type, const char *score, pe_working_set_t *data_set)
bool pe_can_fence(pe_working_set_t *data_set, node_t *node)
enum action_tasks get_complex_task(resource_t *rsc, const char *name, gboolean allow_non_atomic)
struct op_digest_cache_s op_digest_cache_t
enum rsc_role_e master_resource_state(const resource_t *rsc, gboolean current)
action_t * pe_fence_op(node_t *node, const char *op, bool optional, const char *reason, 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_exact(GListPtr input, const char *key, node_t *on_node)
bool fix_remote_addr(resource_t *rsc)
GListPtr find_actions(GListPtr input, const char *key, const node_t *on_node)
gboolean common_unpack(xmlNode *xml_obj, resource_t **rsc, resource_t *parent, pe_working_set_t *data_set)
void common_update_score(resource_t *rsc, const char *id, int score)
void common_free(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)
void print_node(const char *pre_text, node_t *node, gboolean details)
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
time_t get_effective_time(pe_working_set_t *data_set)
GListPtr node_list_and(GListPtr list1, GListPtr list2, gboolean filter)
gboolean master_active(resource_t *rsc, gboolean all)
void set_bit_recursive(resource_t *rsc, unsigned long long flag)
action_t * get_pseudo_op(const char *name, pe_working_set_t *data_set)
int get_target_rc(xmlNode *xml_op)
int get_failcount(node_t *node, resource_t *rsc, time_t *last_failure, pe_working_set_t *data_set)
GListPtr node_list_xor(GListPtr list1, GListPtr list2, gboolean filter)
void native_print(resource_t *rsc, const char *pre_text, long options, void *print_data)
void print_rscs_brief(GListPtr rsc_list, const char *pre_text, long options, void *print_data, gboolean print_all)
GListPtr find_recurring_actions(GListPtr input, node_t *not_on_node)
void clone_free(resource_t *rsc)
enum rsc_role_e group_resource_state(const resource_t *rsc, gboolean current)
gboolean container_unpack(resource_t *rsc, pe_working_set_t *data_set)
resource_t * find_container_child(const char *stem, resource_t *rsc, node_t *node)
void pe_action_set_reason(pe_action_t *action, const char *reason, bool overwrite)
void master_free(resource_t *rsc)
void native_add_running(resource_t *rsc, node_t *node, pe_working_set_t *data_set)
void append_hashtable(gpointer key, gpointer value, gpointer user_data)
int get_failcount_full(node_t *node, resource_t *rsc, time_t *last_failure, bool effective, xmlNode *xml_op, pe_working_set_t *data_set)
char * clone_strip(const char *last_rsc_id)
pe_working_set_t * pe_dataset
action_t * find_first_action(GListPtr input, const char *uuid, const char *task, node_t *on_node)
char * digest_secure_calc
void pe_fence_node(pe_working_set_t *data_set, node_t *node, const char *reason)
Schedule a fence action for a node.
gboolean add_tag_ref(GHashTable *tags, const char *tag_name, const char *obj_ref)
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)
void pe_free_shallow_adv(GListPtr alist, gboolean with_data)
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
enum rsc_role_e native_resource_state(const resource_t *rsc, gboolean current)
void group_print(resource_t *rsc, const char *pre_text, long options, void *print_data)
xmlNode * find_rsc_op_entry(resource_t *rsc, const char *key)
gboolean native_active(resource_t *rsc, gboolean all)
GHashTable * node_hash_dup(GHashTable *hash)
node_t * native_location(resource_t *rsc, GListPtr *list, gboolean current)
GListPtr node_list_from_hash(GHashTable *hash, gboolean reset, gboolean filter)
enum rsc_role_e clone_resource_state(const resource_t *rsc, gboolean current)
GListPtr node_list_minus(GListPtr list1, GListPtr list2, gboolean filter)
void common_print(resource_t *rsc, const char *pre_text, const char *name, node_t *node, long options, void *print_data)
const char * pe_node_attribute_calculated(pe_node_t *node, const char *name, resource_t *rsc)
GHashTable * node_hash_from_list(GListPtr list)
gboolean clone_active(resource_t *rsc, gboolean all)
void add_hash_param(GHashTable *hash, const char *name, const char *value)
void resource_location(resource_t *rsc, node_t *node, int score, const char *tag, pe_working_set_t *data_set)
void node_list_exclude(GHashTable *list, GListPtr list2, gboolean merge_scores)
int get_failcount_all(node_t *node, resource_t *rsc, time_t *last_failure, pe_working_set_t *data_set)
ticket_t * ticket_new(const char *ticket_id, pe_working_set_t *data_set)
gboolean group_active(resource_t *rsc, gboolean all)
enum rsc_role_e container_resource_state(const resource_t *rsc, gboolean current)
char * clone_zero(const char *last_rsc_id)
void dump_node_capacity(int level, const char *comment, node_t *node)
int merge_weights(int w1, int w2)
void container_print(resource_t *rsc, const char *pre_text, long options, void *print_data)
gboolean container_active(resource_t *rsc, gboolean all)
void native_free(resource_t *rsc)
void dump_node_scores_worker(int level, const char *file, const char *function, int line, resource_t *rsc, const char *comment, GHashTable *nodes)
gboolean native_unpack(resource_t *rsc, pe_working_set_t *data_set)
void pe_free_action(action_t *action)
void clear_bit_recursive(resource_t *rsc, unsigned long long flag)
void destroy_ticket(gpointer data)
void pe_free_shallow(GListPtr alist)
struct notify_data_s notify_data_t
void print_resource(int log_level, const char *pre_text, resource_t *rsc, gboolean details)
gboolean order_actions(action_t *lh_action, action_t *rh_action, enum pe_ordering order)
op_digest_cache_t * rsc_action_digest_cmp(resource_t *rsc, xmlNode *xml_op, node_t *node, pe_working_set_t *data_set)
resource_t * find_clone_instance(resource_t *rsc, const char *sub_id, pe_working_set_t *data_set)
gboolean group_unpack(resource_t *rsc, pe_working_set_t *data_set)
gint sort_node_uname(gconstpointer a, gconstpointer b)
bool is_set_recursive(resource_t *rsc, long long flag, bool any)
char * digest_restart_calc
node_t * rsc_known_on(resource_t *rsc, GListPtr *list)
void trigger_unfencing(resource_t *rsc, node_t *node, const char *reason, action_t *dependency, pe_working_set_t *data_set)
resource_t * native_find_rsc(resource_t *rsc, const char *id, node_t *node, int flags)
void master_print(resource_t *rsc, const char *pre_text, long options, void *print_data)
enum crm_ais_msg_types type
gboolean clone_unpack(resource_t *rsc, pe_working_set_t *data_set)
gboolean master_unpack(resource_t *rsc, pe_working_set_t *data_set)