1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #ifndef PENGINE_AUTILS__H
19 # define PENGINE_AUTILS__H
20
21
22 extern rsc_colocation_t *invert_constraint(rsc_colocation_t * constraint);
23
24 extern rsc_to_node_t *copy_constraint(rsc_to_node_t * constraint);
25
26 extern rsc_to_node_t *rsc2node_new(const char *id, resource_t * rsc, int weight,
27 const char *discovery_mode, node_t * node,
28 pe_working_set_t * data_set);
29
30 extern void pe_free_rsc_to_node(GListPtr constraints);
31 extern void pe_free_ordering(GListPtr constraints);
32
33 extern gboolean rsc_colocation_new(const char *id, const char *node_attr, int score,
34 resource_t * rsc_lh, resource_t * rsc_rh,
35 const char *state_lh, const char *state_rh,
36 pe_working_set_t * data_set);
37
38 extern gboolean rsc_ticket_new(const char *id, resource_t * rsc_lh, ticket_t * ticket,
39 const char *state_lh, const char *loss_policy,
40 pe_working_set_t * data_set);
41
42 extern gint sort_node_weight(gconstpointer a, gconstpointer b, gpointer data_set);
43
44 extern gboolean can_run_resources(const node_t * node);
45 extern gboolean native_assign_node(resource_t * rsc, GListPtr candidates, node_t * chosen,
46 gboolean force);
47 void native_deallocate(resource_t * rsc);
48
49 extern void log_action(unsigned int log_level, const char *pre_text,
50 action_t * action, gboolean details);
51
52 gboolean can_run_any(GHashTable * nodes);
53 bool can_interleave_actions(pe_action_t *first, pe_action_t *then);
54 resource_t *find_compatible_child(resource_t * local_child, resource_t * rsc, enum rsc_role_e filter, gboolean current);
55 resource_t *find_compatible_child_by_node(resource_t * local_child, node_t * local_node, resource_t * rsc,
56 enum rsc_role_e filter, gboolean current);
57 gboolean is_child_compatible(resource_t *child_rsc, node_t * local_node, enum rsc_role_e filter, gboolean current);
58 bool assign_node(resource_t * rsc, node_t * node, gboolean force);
59 enum pe_action_flags summary_action_flags(action_t * action, GListPtr children, node_t * node);
60 enum action_tasks clone_child_action(action_t * action);
61 int copies_per_node(resource_t * rsc);
62
63 enum filter_colocation_res {
64 influence_nothing = 0,
65 influence_rsc_location,
66 influence_rsc_priority,
67 };
68
69 extern enum filter_colocation_res
70 filter_colocation_constraint(resource_t * rsc_lh, resource_t * rsc_rh,
71 rsc_colocation_t * constraint, gboolean preview);
72
73 extern int compare_capacity(const node_t * node1, const node_t * node2);
74 extern void calculate_utilization(GHashTable * current_utilization,
75 GHashTable * utilization, gboolean plus);
76
77 extern void process_utilization(resource_t * rsc, node_t ** prefer, pe_working_set_t * data_set);
78 pe_action_t *create_pseudo_resource_op(resource_t * rsc, const char *task, bool optional, bool runnable, pe_working_set_t *data_set);
79
80 # define STONITH_UP "stonith_up"
81 # define STONITH_DONE "stonith_complete"
82 # define ALL_STOPPED "all_stopped"
83 # define LOAD_STOPPED "load_stopped"
84
85 #endif