1
2
3
4
5
6
7
8
9
10 #ifndef PE_STATUS_PRIVATE__H
11 # define PE_STATUS_PRIVATE__H
12
13
14
15
16
17 #if defined(PCMK__UNIT_TESTING)
18 #undef G_GNUC_INTERNAL
19 #define G_GNUC_INTERNAL
20 #endif
21
22 #include <glib.h>
23 #include <libxml/tree.h>
24
25 #include <crm/pengine/status.h>
26
27
28
29
30
31 # define status_print(fmt, args...) \
32 if(options & pe_print_html) { \
33 FILE *stream = print_data; \
34 fprintf(stream, fmt, ##args); \
35 } else if(options & pe_print_printf || options & pe_print_ncurses) { \
36 FILE *stream = print_data; \
37 fprintf(stream, fmt, ##args); \
38 } else if(options & pe_print_xml) { \
39 FILE *stream = print_data; \
40 fprintf(stream, fmt, ##args); \
41 } else if(options & pe_print_log) { \
42 int log_level = *(int*)print_data; \
43 do_crm_log(log_level, fmt, ##args); \
44 }
45
46 typedef struct notify_data_s {
47 GSList *keys;
48
49 const char *action;
50
51 pcmk_action_t *pre;
52 pcmk_action_t *post;
53 pcmk_action_t *pre_done;
54 pcmk_action_t *post_done;
55
56 GList *active;
57 GList *inactive;
58 GList *start;
59 GList *stop;
60 GList *demote;
61 GList *promote;
62 GList *promoted;
63 GList *unpromoted;
64 GHashTable *allowed_nodes;
65 } notify_data_t;
66
67 G_GNUC_INTERNAL
68 pcmk_resource_t *pe__create_clone_child(pcmk_resource_t *rsc,
69 pcmk_scheduler_t *scheduler);
70
71 G_GNUC_INTERNAL
72 void pe__create_action_notifications(pcmk_resource_t *rsc,
73 notify_data_t *n_data);
74
75 G_GNUC_INTERNAL
76 void pe__free_action_notification_data(notify_data_t *n_data);
77
78 G_GNUC_INTERNAL
79 notify_data_t *pe__action_notif_pseudo_ops(pcmk_resource_t *rsc,
80 const char *task,
81 pcmk_action_t *action,
82 pcmk_action_t *complete);
83
84 G_GNUC_INTERNAL
85 void pe__force_anon(const char *standard, pcmk_resource_t *rsc, const char *rid,
86 pcmk_scheduler_t *scheduler);
87
88 G_GNUC_INTERNAL
89 gint pe__cmp_rsc_priority(gconstpointer a, gconstpointer b);
90
91 G_GNUC_INTERNAL
92 gboolean pe__unpack_resource(xmlNode *xml_obj, pcmk_resource_t **rsc,
93 pcmk_resource_t *parent,
94 pcmk_scheduler_t *scheduler);
95
96 G_GNUC_INTERNAL
97 gboolean unpack_remote_nodes(xmlNode *xml_resources,
98 pcmk_scheduler_t *scheduler);
99
100 G_GNUC_INTERNAL
101 gboolean unpack_resources(const xmlNode *xml_resources,
102 pcmk_scheduler_t *scheduler);
103
104 G_GNUC_INTERNAL
105 void pcmk__unpack_fencing_topology(const xmlNode *xml_fencing_topology,
106 pcmk_scheduler_t *scheduler);
107
108 G_GNUC_INTERNAL
109 gboolean unpack_config(xmlNode *config, pcmk_scheduler_t *scheduler);
110
111 G_GNUC_INTERNAL
112 gboolean unpack_nodes(xmlNode *xml_nodes, pcmk_scheduler_t *scheduler);
113
114 G_GNUC_INTERNAL
115 gboolean unpack_tags(xmlNode *xml_tags, pcmk_scheduler_t *scheduler);
116
117 G_GNUC_INTERNAL
118 gboolean unpack_status(xmlNode *status, pcmk_scheduler_t *scheduler);
119
120 G_GNUC_INTERNAL
121 pcmk__op_digest_t *pe__compare_fencing_digest(pcmk_resource_t *rsc,
122 const char *agent,
123 pcmk_node_t *node,
124 pcmk_scheduler_t *scheduler);
125
126 G_GNUC_INTERNAL
127 void pe__unpack_node_health_scores(pcmk_scheduler_t *scheduler);
128
129
130
131 G_GNUC_INTERNAL
132 unsigned int pe__primitive_max_per_node(const pcmk_resource_t *rsc);
133
134
135
136 G_GNUC_INTERNAL
137 unsigned int pe__group_max_per_node(const pcmk_resource_t *rsc);
138
139
140
141 G_GNUC_INTERNAL
142 unsigned int pe__clone_max_per_node(const pcmk_resource_t *rsc);
143
144
145
146 G_GNUC_INTERNAL
147 pcmk_node_t *pe__bundle_active_node(const pcmk_resource_t *rsc,
148 unsigned int *count_all,
149 unsigned int *count_clean);
150
151 G_GNUC_INTERNAL
152 unsigned int pe__bundle_max_per_node(const pcmk_resource_t *rsc);
153
154 #endif