pacemaker  1.1.18-7fdfbbe
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
utils.c File Reference
#include <crm_internal.h>
#include <crm/crm.h>
#include <crm/msg_xml.h>
#include <crm/common/xml.h>
#include <crm/common/util.h>
#include <glib.h>
#include <crm/pengine/rules.h>
#include <crm/pengine/internal.h>
#include <unpack.h>
Include dependency graph for utils.c:

Go to the source code of this file.

Macros

#define sort_return(an_int, why)
 
#define STONITH_DIGEST_TASK   "stonith-on"
 

Functions

xmlNode * get_object_root (const char *object_type, xmlNode *the_root)
 
void print_str_str (gpointer key, gpointer value, gpointer user_data)
 
gboolean ghash_free_str_str (gpointer key, gpointer value, gpointer user_data)
 
void unpack_operation (action_t *action, xmlNode *xml_obj, resource_t *container, pe_working_set_t *data_set)
 
bool pe_can_fence (pe_working_set_t *data_set, node_t *node)
 
node_tnode_copy (const node_t *this_node)
 
void node_list_exclude (GHashTable *hash, GListPtr list, gboolean merge_scores)
 
GHashTable * node_hash_from_list (GListPtr list)
 
GListPtr node_list_dup (GListPtr list1, gboolean reset, gboolean filter)
 
gint sort_node_uname (gconstpointer a, gconstpointer b)
 
void dump_node_scores_worker (int level, const char *file, const char *function, int line, resource_t *rsc, const char *comment, GHashTable *nodes)
 
void dump_node_capacity (int level, const char *comment, node_t *node)
 
void dump_rsc_utilization (int level, const char *comment, resource_t *rsc, node_t *node)
 
gint sort_rsc_index (gconstpointer a, gconstpointer b)
 
gint sort_rsc_priority (gconstpointer a, gconstpointer b)
 
action_tcustom_action (resource_t *rsc, char *key, const char *task, node_t *on_node, gboolean optional, gboolean save_action, pe_working_set_t *data_set)
 
int pe_get_configured_timeout (resource_t *rsc, const char *action, pe_working_set_t *data_set)
 
xmlNode * find_rsc_op_entry (resource_t *rsc, const char *key)
 
void print_node (const char *pre_text, node_t *node, gboolean details)
 
void print_resource (int log_level, const char *pre_text, resource_t *rsc, gboolean details)
 
void pe_free_action (action_t *action)
 
GListPtr find_recurring_actions (GListPtr input, node_t *not_on_node)
 
enum action_tasks get_complex_task (resource_t *rsc, const char *name, gboolean allow_non_atomic)
 
action_tfind_first_action (GListPtr input, const char *uuid, const char *task, node_t *on_node)
 
GListPtr find_actions (GListPtr input, const char *key, const node_t *on_node)
 
GListPtr find_actions_exact (GListPtr input, const char *key, node_t *on_node)
 
void resource_location (resource_t *rsc, node_t *node, int score, const char *tag, 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)
 
gboolean get_target_role (resource_t *rsc, enum rsc_role_e *role)
 
gboolean order_actions (action_t *lh_action, action_t *rh_action, enum pe_ordering order)
 
action_tget_pseudo_op (const char *name, pe_working_set_t *data_set)
 
void destroy_ticket (gpointer data)
 
ticket_tticket_new (const char *ticket_id, pe_working_set_t *data_set)
 
op_digest_cache_trsc_action_digest_cmp (resource_t *rsc, xmlNode *xml_op, node_t *node, pe_working_set_t *data_set)
 
const char * rsc_printable_id (resource_t *rsc)
 
void clear_bit_recursive (resource_t *rsc, unsigned long long flag)
 
void set_bit_recursive (resource_t *rsc, unsigned long long flag)
 
action_tpe_fence_op (node_t *node, const char *op, bool optional, const char *reason, pe_working_set_t *data_set)
 
void trigger_unfencing (resource_t *rsc, node_t *node, const char *reason, action_t *dependency, pe_working_set_t *data_set)
 
gboolean add_tag_ref (GHashTable *tags, const char *tag_name, const char *obj_ref)
 
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 pe_action_set_reason (pe_action_t *action, const char *reason, bool overwrite)
 

Variables

pe_working_set_tpe_dataset = NULL
 

Macro Definition Documentation

#define sort_return (   an_int,
  why 
)
Value:
do { \
free(a_uuid); \
free(b_uuid); \
crm_trace("%s (%d) %c %s (%d) : %s", \
a_xml_id, a_call_id, an_int>0?'>':an_int<0?'<':'=', \
b_xml_id, b_call_id, why); \
return an_int; \
} while(0)
#define crm_trace(fmt, args...)
Definition: logging.h:254

Definition at line 1550 of file utils.c.

#define STONITH_DIGEST_TASK   "stonith-on"

Definition at line 2030 of file utils.c.

Function Documentation

gboolean add_tag_ref ( GHashTable *  tags,
const char *  tag_name,
const char *  obj_ref 
)

Definition at line 2255 of file utils.c.

void clear_bit_recursive ( resource_t rsc,
unsigned long long  flag 
)

Definition at line 2092 of file utils.c.

action_t* custom_action ( resource_t rsc,
char *  key,
const char *  task,
node_t on_node,
gboolean  optional,
gboolean  save_action,
pe_working_set_t data_set 
)

Definition at line 419 of file utils.c.

void destroy_ticket ( gpointer  data)

Definition at line 1795 of file utils.c.

void dump_node_capacity ( int  level,
const char *  comment,
node_t node 
)

Definition at line 322 of file utils.c.

void dump_node_scores_worker ( int  level,
const char *  file,
const char *  function,
int  line,
resource_t rsc,
const char *  comment,
GHashTable *  nodes 
)

Definition at line 234 of file utils.c.

void dump_rsc_utilization ( int  level,
const char *  comment,
resource_t rsc,
node_t node 
)

Definition at line 343 of file utils.c.

GListPtr find_actions ( GListPtr  input,
const char *  key,
const node_t on_node 
)

Definition at line 1415 of file utils.c.

GListPtr find_actions_exact ( GListPtr  input,
const char *  key,
node_t on_node 
)

Definition at line 1455 of file utils.c.

action_t* find_first_action ( GListPtr  input,
const char *  uuid,
const char *  task,
node_t on_node 
)

Definition at line 1385 of file utils.c.

GListPtr find_recurring_actions ( GListPtr  input,
node_t not_on_node 
)

Definition at line 1327 of file utils.c.

xmlNode* find_rsc_op_entry ( resource_t rsc,
const char *  key 
)

Definition at line 1234 of file utils.c.

enum action_tasks get_complex_task ( resource_t rsc,
const char *  name,
gboolean  allow_non_atomic 
)

Definition at line 1361 of file utils.c.

time_t get_effective_time ( pe_working_set_t data_set)

Definition at line 1675 of file utils.c.

xmlNode* get_object_root ( const char *  object_type,
xmlNode *  the_root 
)

Definition at line 230 of file cib_utils.c.

action_t* get_pseudo_op ( const char *  name,
pe_working_set_t data_set 
)

Definition at line 1778 of file utils.c.

gboolean get_target_role ( resource_t rsc,
enum rsc_role_e role 
)

Definition at line 1690 of file utils.c.

gboolean ghash_free_str_str ( gpointer  key,
gpointer  value,
gpointer  user_data 
)
node_t* node_copy ( const node_t this_node)

Definition at line 127 of file utils.c.

GHashTable* node_hash_from_list ( GListPtr  list)

Definition at line 183 of file utils.c.

GListPtr node_list_dup ( GListPtr  list1,
gboolean  reset,
gboolean  filter 
)

Definition at line 199 of file utils.c.

void node_list_exclude ( GHashTable *  hash,
GListPtr  list,
gboolean  merge_scores 
)

Definition at line 148 of file utils.c.

gboolean order_actions ( action_t lh_action,
action_t rh_action,
enum pe_ordering  order 
)

Definition at line 1726 of file utils.c.

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 
)

Definition at line 2291 of file utils.c.

void pe_action_set_reason ( pe_action_t action,
const char *  reason,
bool  overwrite 
)

Definition at line 2351 of file utils.c.

bool pe_can_fence ( pe_working_set_t data_set,
node_t node 
)

Definition at line 100 of file utils.c.

action_t* pe_fence_op ( node_t node,
const char *  op,
bool  optional,
const char *  reason,
pe_working_set_t data_set 
)

Definition at line 2139 of file utils.c.

void pe_free_action ( action_t action)

Definition at line 1300 of file utils.c.

int pe_get_configured_timeout ( resource_t rsc,
const char *  action,
pe_working_set_t data_set 
)

Definition at line 845 of file utils.c.

void print_node ( const char *  pre_text,
node_t node,
gboolean  details 
)

Definition at line 1240 of file utils.c.

void print_resource ( int  log_level,
const char *  pre_text,
resource_t rsc,
gboolean  details 
)

Definition at line 1284 of file utils.c.

void print_str_str ( gpointer  key,
gpointer  value,
gpointer  user_data 
)

Definition at line 1276 of file utils.c.

void resource_location ( resource_t rsc,
node_t node,
int  score,
const char *  tag,
pe_working_set_t data_set 
)

Definition at line 1516 of file utils.c.

op_digest_cache_t* rsc_action_digest_cmp ( resource_t rsc,
xmlNode *  xml_op,
node_t node,
pe_working_set_t data_set 
)

Definition at line 1980 of file utils.c.

const char* rsc_printable_id ( resource_t rsc)

Definition at line 2083 of file utils.c.

void set_bit_recursive ( resource_t rsc,
unsigned long long  flag 
)

Definition at line 2105 of file utils.c.

gint sort_node_uname ( gconstpointer  a,
gconstpointer  b 
)

Definition at line 225 of file utils.c.

gint sort_op_by_callid ( gconstpointer  a,
gconstpointer  b 
)

Definition at line 1560 of file utils.c.

gint sort_rsc_index ( gconstpointer  a,
gconstpointer  b 
)

Definition at line 365 of file utils.c.

gint sort_rsc_priority ( gconstpointer  a,
gconstpointer  b 
)

Definition at line 392 of file utils.c.

ticket_t* ticket_new ( const char *  ticket_id,
pe_working_set_t data_set 
)

Definition at line 1807 of file utils.c.

void trigger_unfencing ( resource_t rsc,
node_t node,
const char *  reason,
action_t dependency,
pe_working_set_t data_set 
)

Definition at line 2221 of file utils.c.

void unpack_operation ( action_t action,
xmlNode *  xml_obj,
resource_t container,
pe_working_set_t data_set 
)

Definition at line 914 of file utils.c.

Variable Documentation

pe_working_set_t* pe_dataset = NULL

Definition at line 31 of file utils.c.