pacemaker  1.1.19-c3c624ea3d
Scalable High-Availability cluster resource manager
clone.c
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2018 Andrew Beekhof <andrew@beekhof.net>
3  *
4  * This source code is licensed under the GNU Lesser General Public License
5  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
6  */
7 
8 #include <crm_internal.h>
9 
10 #include <crm/pengine/rules.h>
11 #include <crm/pengine/status.h>
12 #include <crm/pengine/internal.h>
13 #include <unpack.h>
14 #include <crm/msg_xml.h>
15 
16 #define VARIANT_CLONE 1
17 #include "./variant.h"
18 
19 void force_non_unique_clone(resource_t * rsc, const char *rid, pe_working_set_t * data_set);
20 resource_t *create_child_clone(resource_t * rsc, int sub_id, pe_working_set_t * data_set);
21 
22 static void
23 mark_as_orphan(resource_t * rsc)
24 {
25  GListPtr gIter = rsc->children;
26 
28 
29  for (; gIter != NULL; gIter = gIter->next) {
30  resource_t *child = (resource_t *) gIter->data;
31 
32  mark_as_orphan(child);
33  }
34 }
35 
36 void
37 force_non_unique_clone(resource_t * rsc, const char *rid, pe_working_set_t * data_set)
38 {
39  if (pe_rsc_is_clone(rsc)) {
40  clone_variant_data_t *clone_data = NULL;
41 
42  get_clone_variant_data(clone_data, rsc);
43 
44  crm_config_warn("Clones %s contains non-OCF resource %s and so "
45  "can only be used as an anonymous clone. "
46  "Set the " XML_RSC_ATTR_UNIQUE " meta attribute to false", rsc->id, rid);
47 
48  clone_data->clone_node_max = 1;
49  clone_data->clone_max = g_list_length(data_set->nodes);
51  }
52 }
53 
54 resource_t *
55 find_clone_instance(resource_t * rsc, const char *sub_id, pe_working_set_t * data_set)
56 {
57  char *child_id = NULL;
58  resource_t *child = NULL;
59  const char *child_base = NULL;
60  clone_variant_data_t *clone_data = NULL;
61 
62  get_clone_variant_data(clone_data, rsc);
63 
64  child_base = ID(clone_data->xml_obj_child);
65  child_id = crm_concat(child_base, sub_id, ':');
66  child = pe_find_resource(rsc->children, child_id);
67 
68  free(child_id);
69  return child;
70 }
71 
72 resource_t *
73 create_child_clone(resource_t * rsc, int sub_id, pe_working_set_t * data_set)
74 {
75  gboolean as_orphan = FALSE;
76  char *inc_num = NULL;
77  char *inc_max = NULL;
78  resource_t *child_rsc = NULL;
79  xmlNode *child_copy = NULL;
80  clone_variant_data_t *clone_data = NULL;
81 
82  get_clone_variant_data(clone_data, rsc);
83 
84  CRM_CHECK(clone_data->xml_obj_child != NULL, return FALSE);
85 
86  if (sub_id < 0) {
87  as_orphan = TRUE;
88  sub_id = clone_data->total_clones;
89  }
90  inc_num = crm_itoa(sub_id);
91  inc_max = crm_itoa(clone_data->clone_max);
92 
93  child_copy = copy_xml(clone_data->xml_obj_child);
94 
95  crm_xml_add(child_copy, XML_RSC_ATTR_INCARNATION, inc_num);
96 
97  if (common_unpack(child_copy, &child_rsc, rsc, data_set) == FALSE) {
98  pe_err("Failed unpacking resource %s", crm_element_value(child_copy, XML_ATTR_ID));
99  child_rsc = NULL;
100  goto bail;
101  }
102 /* child_rsc->globally_unique = rsc->globally_unique; */
103 
104  CRM_ASSERT(child_rsc);
105  clone_data->total_clones += 1;
106  pe_rsc_trace(child_rsc, "Setting clone attributes for: %s", child_rsc->id);
107  rsc->children = g_list_append(rsc->children, child_rsc);
108  if (as_orphan) {
109  mark_as_orphan(child_rsc);
110  }
111 
112  add_hash_param(child_rsc->meta, XML_RSC_ATTR_INCARNATION_MAX, inc_max);
113 
114  print_resource(LOG_DEBUG_3, "Added ", child_rsc, FALSE);
115 
116  bail:
117  free(inc_num);
118  free(inc_max);
119 
120  return child_rsc;
121 }
122 
123 gboolean
125 {
126  const char *master_max = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_MASTER_MAX);
127  const char *master_node_max = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_MASTER_NODEMAX);
128 
129  g_hash_table_replace(rsc->meta, strdup("stateful"), strdup(XML_BOOLEAN_TRUE));
130  if (clone_unpack(rsc, data_set)) {
131  clone_variant_data_t *clone_data = NULL;
132 
133  get_clone_variant_data(clone_data, rsc);
134  clone_data->master_max = crm_parse_int(master_max, "1");
135  clone_data->master_node_max = crm_parse_int(master_node_max, "1");
136  return TRUE;
137  }
138  return FALSE;
139 }
140 
141 gboolean
143 {
144  int lpc = 0;
145  xmlNode *a_child = NULL;
146  xmlNode *xml_obj = rsc->xml;
147  clone_variant_data_t *clone_data = NULL;
148 
149  const char *ordered = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_ORDERED);
150  const char *interleave = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_INTERLEAVE);
151  const char *max_clones = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_INCARNATION_MAX);
152  const char *max_clones_node = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_INCARNATION_NODEMAX);
153 
154  pe_rsc_trace(rsc, "Processing resource %s...", rsc->id);
155 
156  clone_data = calloc(1, sizeof(clone_variant_data_t));
157  rsc->variant_opaque = clone_data;
158 
159  clone_data->active_clones = 0;
160  clone_data->xml_obj_child = NULL;
161  clone_data->clone_node_max = crm_parse_int(max_clones_node, "1");
162 
163  if (max_clones) {
164  clone_data->clone_max = crm_parse_int(max_clones, "1");
165 
166  } else if (g_list_length(data_set->nodes) > 0) {
167  clone_data->clone_max = g_list_length(data_set->nodes);
168 
169  } else {
170  clone_data->clone_max = 1; /* Handy during crm_verify */
171  }
172 
173  clone_data->interleave = crm_is_true(interleave);
174  clone_data->ordered = crm_is_true(ordered);
175 
176  if ((rsc->flags & pe_rsc_unique) == 0 && clone_data->clone_node_max > 1) {
177  crm_config_err("Anonymous clones (%s) may only support one copy per node", rsc->id);
178  clone_data->clone_node_max = 1;
179  }
180 
181  pe_rsc_trace(rsc, "Options for %s", rsc->id);
182  pe_rsc_trace(rsc, "\tClone max: %d", clone_data->clone_max);
183  pe_rsc_trace(rsc, "\tClone node max: %d", clone_data->clone_node_max);
184  pe_rsc_trace(rsc, "\tClone is unique: %s",
185  is_set(rsc->flags, pe_rsc_unique) ? "true" : "false");
186 
187  // Clones may contain a single group or primitive
188  for (a_child = __xml_first_child(xml_obj); a_child != NULL;
189  a_child = __xml_next_element(a_child)) {
190 
191  if (crm_str_eq((const char *)a_child->name, XML_CIB_TAG_RESOURCE, TRUE)
192  || crm_str_eq((const char *)a_child->name, XML_CIB_TAG_GROUP, TRUE)) {
193  clone_data->xml_obj_child = a_child;
194  break;
195  }
196  }
197 
198  if (clone_data->xml_obj_child == NULL) {
199  crm_config_err("%s has nothing to clone", rsc->id);
200  return FALSE;
201  }
202 
203  /*
204  * Make clones ever so slightly sticky by default
205  *
206  * This helps ensure clone instances are not shuffled around the cluster
207  * for no benefit in situations when pre-allocation is not appropriate
208  */
209  if (g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_STICKINESS) == NULL) {
211  }
212 
213  pe_rsc_trace(rsc, "\tClone is unique (fixed): %s",
214  is_set(rsc->flags, pe_rsc_unique) ? "true" : "false");
215  clone_data->notify_confirm = is_set(rsc->flags, pe_rsc_notify);
218 
219  for (lpc = 0; lpc < clone_data->clone_max; lpc++) {
220  if (create_child_clone(rsc, lpc, data_set) == NULL) {
221  return FALSE;
222  }
223  }
224 
225  if (clone_data->clone_max == 0) {
226  /* create one so that unpack_find_resource() will hook up
227  * any orphans up to the parent correctly
228  */
229  if (create_child_clone(rsc, -1, data_set) == NULL) {
230  return FALSE;
231  }
232  }
233 
234  pe_rsc_trace(rsc, "Added %d children to resource %s...", clone_data->clone_max, rsc->id);
235  return TRUE;
236 }
237 
238 gboolean
239 clone_active(resource_t * rsc, gboolean all)
240 {
241  GListPtr gIter = rsc->children;
242 
243  for (; gIter != NULL; gIter = gIter->next) {
244  resource_t *child_rsc = (resource_t *) gIter->data;
245  gboolean child_active = child_rsc->fns->active(child_rsc, all);
246 
247  if (all == FALSE && child_active) {
248  return TRUE;
249  } else if (all && child_active == FALSE) {
250  return FALSE;
251  }
252  }
253 
254  if (all) {
255  return TRUE;
256  } else {
257  return FALSE;
258  }
259 }
260 
261 static void
262 short_print(char *list, const char *prefix, const char *type, const char *suffix, long options, void *print_data)
263 {
264  if(suffix == NULL) {
265  suffix = "";
266  }
267 
268  if (list) {
269  if (options & pe_print_html) {
270  status_print("<li>");
271  }
272  status_print("%s%s: [%s ]%s", prefix, type, list, suffix);
273 
274  if (options & pe_print_html) {
275  status_print("</li>\n");
276 
277  } else if (options & pe_print_suppres_nl) {
278  /* nothing */
279  } else if ((options & pe_print_printf) || (options & pe_print_ncurses)) {
280  status_print("\n");
281  }
282 
283  }
284 }
285 
286 static const char *
287 configured_role_str(resource_t * rsc)
288 {
289  const char *target_role = g_hash_table_lookup(rsc->meta,
291 
292  if ((target_role == NULL) && rsc->children && rsc->children->data) {
293  target_role = g_hash_table_lookup(((resource_t*)rsc->children->data)->meta,
295  }
296  return target_role;
297 }
298 
299 static enum rsc_role_e
300 configured_role(resource_t * rsc)
301 {
302  const char *target_role = configured_role_str(rsc);
303 
304  if (target_role) {
305  return text2role(target_role);
306  }
307  return RSC_ROLE_UNKNOWN;
308 }
309 
310 static void
311 clone_print_xml(resource_t * rsc, const char *pre_text, long options, void *print_data)
312 {
313  int is_master_slave = rsc->variant == pe_master ? 1 : 0;
314  char *child_text = crm_concat(pre_text, " ", ' ');
315  const char *target_role = configured_role_str(rsc);
316  GListPtr gIter = rsc->children;
317 
318  status_print("%s<clone ", pre_text);
319  status_print("id=\"%s\" ", rsc->id);
320  status_print("multi_state=\"%s\" ", is_master_slave ? "true" : "false");
321  status_print("unique=\"%s\" ", is_set(rsc->flags, pe_rsc_unique) ? "true" : "false");
322  status_print("managed=\"%s\" ", is_set(rsc->flags, pe_rsc_managed) ? "true" : "false");
323  status_print("failed=\"%s\" ", is_set(rsc->flags, pe_rsc_failed) ? "true" : "false");
324  status_print("failure_ignored=\"%s\" ",
325  is_set(rsc->flags, pe_rsc_failure_ignored) ? "true" : "false");
326  if (target_role) {
327  status_print("target_role=\"%s\" ", target_role);
328  }
329  status_print(">\n");
330 
331  for (; gIter != NULL; gIter = gIter->next) {
332  resource_t *child_rsc = (resource_t *) gIter->data;
333 
334  child_rsc->fns->print(child_rsc, child_text, options, print_data);
335  }
336 
337  status_print("%s</clone>\n", pre_text);
338  free(child_text);
339 }
340 
341 bool is_set_recursive(resource_t * rsc, long long flag, bool any)
342 {
343  GListPtr gIter;
344  bool all = !any;
345 
346  if(is_set(rsc->flags, flag)) {
347  if(any) {
348  return TRUE;
349  }
350  } else if(all) {
351  return FALSE;
352  }
353 
354  for (gIter = rsc->children; gIter != NULL; gIter = gIter->next) {
355  if(is_set_recursive(gIter->data, flag, any)) {
356  if(any) {
357  return TRUE;
358  }
359 
360  } else if(all) {
361  return FALSE;
362  }
363  }
364 
365  if(all) {
366  return TRUE;
367  }
368  return FALSE;
369 }
370 
371 void
372 clone_print(resource_t * rsc, const char *pre_text, long options, void *print_data)
373 {
374  char *list_text = NULL;
375  char *child_text = NULL;
376  char *stopped_list = NULL;
377  const char *type = "Clone";
378 
379  GListPtr master_list = NULL;
380  GListPtr started_list = NULL;
381  GListPtr gIter = rsc->children;
382 
383  clone_variant_data_t *clone_data = NULL;
384  int active_instances = 0;
385 
386  if (pre_text == NULL) {
387  pre_text = " ";
388  }
389 
390  if (options & pe_print_xml) {
391  clone_print_xml(rsc, pre_text, options, print_data);
392  return;
393  }
394 
395  get_clone_variant_data(clone_data, rsc);
396 
397  child_text = crm_concat(pre_text, " ", ' ');
398 
399  if (rsc->variant == pe_master) {
400  type = "Master/Slave";
401  }
402 
403  status_print("%s%s Set: %s [%s]%s%s",
404  pre_text ? pre_text : "", type, rsc->id, ID(clone_data->xml_obj_child),
405  is_set(rsc->flags, pe_rsc_unique) ? " (unique)" : "",
406  is_set(rsc->flags, pe_rsc_managed) ? "" : " (unmanaged)");
407 
408  if (options & pe_print_html) {
409  status_print("\n<ul>\n");
410 
411  } else if ((options & pe_print_log) == 0) {
412  status_print("\n");
413  }
414 
415  for (; gIter != NULL; gIter = gIter->next) {
416  gboolean print_full = FALSE;
417  resource_t *child_rsc = (resource_t *) gIter->data;
418 
419  if (options & pe_print_clone_details) {
420  print_full = TRUE;
421  }
422 
423  if (child_rsc->fns->active(child_rsc, FALSE) == FALSE) {
424  /* Inactive clone */
425  if (is_set(child_rsc->flags, pe_rsc_orphan)) {
426  continue;
427 
428  } else if (is_set(rsc->flags, pe_rsc_unique)) {
429  print_full = TRUE;
430 
431  } else if (is_not_set(options, pe_print_clone_active)) {
432  stopped_list = add_list_element(stopped_list, child_rsc->id);
433  }
434 
435  } else if (is_set_recursive(child_rsc, pe_rsc_unique, TRUE)
436  || is_set_recursive(child_rsc, pe_rsc_orphan, TRUE)
437  || is_set_recursive(child_rsc, pe_rsc_managed, FALSE) == FALSE
438  || is_set_recursive(child_rsc, pe_rsc_failed, TRUE)) {
439 
440  /* Unique, unmanaged or failed clone */
441  print_full = TRUE;
442 
443  } else if (is_set(options, pe_print_pending) && child_rsc->pending_task != NULL) {
444  /* In a pending state */
445  print_full = TRUE;
446 
447  } else if (child_rsc->fns->active(child_rsc, TRUE)) {
448  /* Fully active anonymous clone */
449  node_t *location = child_rsc->fns->location(child_rsc, NULL, TRUE);
450 
451  if (location) {
452  enum rsc_role_e a_role = child_rsc->fns->state(child_rsc, TRUE);
453 
454  if (location->details->online == FALSE && location->details->unclean) {
455  print_full = TRUE;
456 
457  } else if (a_role > RSC_ROLE_SLAVE) {
458  /* And active on a single node as master */
459  master_list = g_list_append(master_list, location);
460 
461  } else {
462  /* And active on a single node as started/slave */
463  started_list = g_list_append(started_list, location);
464  }
465 
466  } else {
467  /* uncolocated group - bleh */
468  print_full = TRUE;
469  }
470 
471  } else {
472  /* Partially active anonymous clone */
473  print_full = TRUE;
474  }
475 
476  if (print_full) {
477  if (options & pe_print_html) {
478  status_print("<li>\n");
479  }
480  child_rsc->fns->print(child_rsc, child_text, options, print_data);
481  if (options & pe_print_html) {
482  status_print("</li>\n");
483  }
484  }
485  }
486 
487  /* Masters */
488  master_list = g_list_sort(master_list, sort_node_uname);
489  for (gIter = master_list; gIter; gIter = gIter->next) {
490  node_t *host = gIter->data;
491 
492  list_text = add_list_element(list_text, host->details->uname);
493  active_instances++;
494  }
495 
496  short_print(list_text, child_text, "Masters", NULL, options, print_data);
497  g_list_free(master_list);
498  free(list_text);
499  list_text = NULL;
500 
501  /* Started/Slaves */
502  started_list = g_list_sort(started_list, sort_node_uname);
503  for (gIter = started_list; gIter; gIter = gIter->next) {
504  node_t *host = gIter->data;
505 
506  list_text = add_list_element(list_text, host->details->uname);
507  active_instances++;
508  }
509 
510  if(rsc->variant == pe_master) {
511  enum rsc_role_e role = configured_role(rsc);
512 
513  if(role == RSC_ROLE_SLAVE) {
514  short_print(list_text, child_text, "Slaves (target-role)", NULL, options, print_data);
515  } else {
516  short_print(list_text, child_text, "Slaves", NULL, options, print_data);
517  }
518 
519  } else {
520  short_print(list_text, child_text, "Started", NULL, options, print_data);
521  }
522 
523  g_list_free(started_list);
524  free(list_text);
525  list_text = NULL;
526 
527  if (is_not_set(options, pe_print_clone_active)) {
528  const char *state = "Stopped";
529  enum rsc_role_e role = configured_role(rsc);
530 
531  if (role == RSC_ROLE_STOPPED) {
532  state = "Stopped (disabled)";
533  }
534 
535  if (is_not_set(rsc->flags, pe_rsc_unique)
536  && (clone_data->clone_max > active_instances)) {
537 
538  GListPtr nIter;
539  GListPtr list = g_hash_table_get_values(rsc->allowed_nodes);
540 
541  /* Custom stopped list for non-unique clones */
542  free(stopped_list); stopped_list = NULL;
543 
544  if (g_list_length(list) == 0) {
545  /* Clusters with symmetrical=false haven't calculated allowed_nodes yet
546  * If we've not probed for them yet, the Stopped list will be empty
547  */
548  list = g_hash_table_get_values(rsc->known_on);
549  }
550 
551  list = g_list_sort(list, sort_node_uname);
552  for (nIter = list; nIter != NULL; nIter = nIter->next) {
553  node_t *node = (node_t *)nIter->data;
554 
555  if (pe_find_node(rsc->running_on, node->details->uname) == NULL) {
556  stopped_list = add_list_element(stopped_list, node->details->uname);
557  }
558  }
559  g_list_free(list);
560  }
561 
562  short_print(stopped_list, child_text, state, NULL, options, print_data);
563  free(stopped_list);
564  }
565 
566  if (options & pe_print_html) {
567  status_print("</ul>\n");
568  }
569 
570  free(child_text);
571 }
572 
573 void
575 {
576  clone_variant_data_t *clone_data = NULL;
577 
578  get_clone_variant_data(clone_data, rsc);
579 
580  pe_rsc_trace(rsc, "Freeing %s", rsc->id);
581 
582  for (GListPtr gIter = rsc->children; gIter != NULL; gIter = gIter->next) {
583  resource_t *child_rsc = (resource_t *) gIter->data;
584 
585  CRM_ASSERT(child_rsc);
586  pe_rsc_trace(child_rsc, "Freeing child %s", child_rsc->id);
587  free_xml(child_rsc->xml);
588  child_rsc->xml = NULL;
589  /* There could be a saved unexpanded xml */
590  free_xml(child_rsc->orig_xml);
591  child_rsc->orig_xml = NULL;
592  child_rsc->fns->free(child_rsc);
593  }
594 
595  g_list_free(rsc->children);
596 
597  if (clone_data) {
598  CRM_ASSERT(clone_data->demote_notify == NULL);
599  CRM_ASSERT(clone_data->stop_notify == NULL);
600  CRM_ASSERT(clone_data->start_notify == NULL);
601  CRM_ASSERT(clone_data->promote_notify == NULL);
602  }
603 
604  common_free(rsc);
605 }
606 
607 enum rsc_role_e
608 clone_resource_state(const resource_t * rsc, gboolean current)
609 {
610  enum rsc_role_e clone_role = RSC_ROLE_UNKNOWN;
611  GListPtr gIter = rsc->children;
612 
613  for (; gIter != NULL; gIter = gIter->next) {
614  resource_t *child_rsc = (resource_t *) gIter->data;
615  enum rsc_role_e a_role = child_rsc->fns->state(child_rsc, current);
616 
617  if (a_role > clone_role) {
618  clone_role = a_role;
619  }
620  }
621 
622  pe_rsc_trace(rsc, "%s role: %s", rsc->id, role2text(clone_role));
623  return clone_role;
624 }
#define CRM_CHECK(expr, failure_action)
Definition: logging.h:164
GListPtr nodes
Definition: status.h:111
const char * uname
Definition: status.h:143
xmlNode * xml
Definition: status.h:263
gboolean clone_unpack(resource_t *rsc, pe_working_set_t *data_set)
Definition: clone.c:142
void(* free)(resource_t *)
Definition: complex.h:51
#define XML_BOOLEAN_FALSE
Definition: msg_xml.h:118
#define crm_config_err(fmt...)
Definition: crm_internal.h:256
#define XML_RSC_ATTR_INCARNATION
Definition: msg_xml.h:212
#define pe_rsc_orphan
Definition: status.h:188
gboolean common_unpack(xmlNode *xml_obj, resource_t **rsc, resource_t *parent, pe_working_set_t *data_set)
Definition: complex.c:454
enum pe_obj_types variant
Definition: status.h:269
void common_free(resource_t *rsc)
Definition: complex.c:908
#define status_print(fmt, args...)
Definition: unpack.h:79
int crm_parse_int(const char *text, const char *default_text)
Definition: strings.c:125
enum rsc_role_e(* state)(const resource_t *, gboolean)
Definition: complex.h:49
node_t * pe_find_node(GListPtr node_list, const char *uname)
Definition: status.c:301
AIS_Host host
Definition: internal.h:52
#define XML_RSC_ATTR_STICKINESS
Definition: msg_xml.h:223
void force_non_unique_clone(resource_t *rsc, const char *rid, pe_working_set_t *data_set)
Definition: clone.c:37
gboolean master_unpack(resource_t *rsc, pe_working_set_t *data_set)
Definition: clone.c:124
xmlNode * orig_xml
Definition: status.h:264
gboolean clone_active(resource_t *rsc, gboolean all)
Definition: clone.c:239
#define XML_RSC_ATTR_MASTER_NODEMAX
Definition: msg_xml.h:217
#define XML_RSC_ATTR_INCARNATION_MAX
Definition: msg_xml.h:213
GListPtr children
Definition: status.h:305
char * id
Definition: status.h:261
xmlNode * copy_xml(xmlNode *src_node)
Definition: xml.c:2745
const char * role2text(enum rsc_role_e role)
Definition: common.c:346
struct node_shared_s * details
Definition: status.h:182
#define set_bit(word, bit)
Definition: crm_internal.h:190
gboolean unclean
Definition: status.h:150
void clone_free(resource_t *rsc)
Definition: clone.c:574
enum rsc_role_e clone_resource_state(const resource_t *rsc, gboolean current)
Definition: clone.c:608
char * add_list_element(char *list, const char *value)
Definition: strings.c:394
#define XML_ATTR_ID
Definition: msg_xml.h:102
char * pending_task
Definition: status.h:314
#define XML_CIB_TAG_RESOURCE
Definition: msg_xml.h:196
#define XML_BOOLEAN_TRUE
Definition: msg_xml.h:117
#define pe_rsc_failed
Definition: status.h:206
resource_object_functions_t * fns
Definition: status.h:270
GHashTable * allowed_nodes
Definition: status.h:296
void * variant_opaque
Definition: status.h:268
#define XML_RSC_ATTR_ORDERED
Definition: msg_xml.h:210
const char * crm_element_value(xmlNode *data, const char *name)
Definition: xml.c:5224
unsigned long long flags
Definition: status.h:285
#define XML_RSC_ATTR_INCARNATION_NODEMAX
Definition: msg_xml.h:215
#define XML_RSC_ATTR_TARGET_ROLE
Definition: msg_xml.h:220
node_t *(* location)(resource_t *, GListPtr *, gboolean)
Definition: complex.h:50
void free_xml(xmlNode *child)
Definition: xml.c:2739
enum rsc_role_e text2role(const char *role)
Definition: common.c:367
gboolean crm_str_eq(const char *a, const char *b, gboolean use_case)
Definition: strings.c:213
#define XML_RSC_ATTR_UNIQUE
Definition: msg_xml.h:221
void clone_print(resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: clone.c:372
gboolean(* active)(resource_t *, gboolean)
Definition: complex.h:48
#define crm_config_warn(fmt...)
Definition: crm_internal.h:257
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Definition: xml.c:2523
#define XML_RSC_ATTR_MASTER_MAX
Definition: msg_xml.h:216
void(* print)(resource_t *, const char *, long, void *)
Definition: complex.h:47
#define pe_rsc_unique
Definition: status.h:194
resource_t * create_child_clone(resource_t *rsc, int sub_id, pe_working_set_t *data_set)
Definition: clone.c:73
GHashTable * meta
Definition: status.h:301
void add_hash_param(GHashTable *hash, const char *name, const char *value)
Definition: common.c:423
gboolean online
Definition: status.h:146
#define pe_rsc_failure_ignored
Definition: status.h:216
resource_t * find_clone_instance(resource_t *rsc, const char *sub_id, pe_working_set_t *data_set)
Definition: clone.c:55
bool is_set_recursive(resource_t *rsc, long long flag, bool any)
Definition: clone.c:341
#define pe_rsc_managed
Definition: status.h:189
#define CRM_ASSERT(expr)
Definition: error.h:35
rsc_role_e
Definition: common.h:81
GHashTable * known_on
Definition: status.h:295
void clear_bit_recursive(resource_t *rsc, unsigned long long flag)
Definition: utils.c:2148
Definition: status.h:178
gboolean crm_is_true(const char *s)
Definition: strings.c:165
#define XML_CIB_TAG_GROUP
Definition: msg_xml.h:197
#define pe_rsc_trace(rsc, fmt, args...)
Definition: internal.h:16
char * crm_concat(const char *prefix, const char *suffix, char join)
Definition: strings.c:32
#define ID(x)
Definition: msg_xml.h:447
#define pe_err(fmt...)
Definition: internal.h:18
void print_resource(int log_level, const char *pre_text, resource_t *rsc, gboolean details)
Definition: utils.c:1339
char * crm_itoa(int an_int)
Definition: strings.c:60
resource_t * pe_find_resource(GListPtr rsc_list, const char *id_rh)
Definition: status.c:249
#define XML_RSC_ATTR_INTERLEAVE
Definition: msg_xml.h:211
#define LOG_DEBUG_3
Definition: logging.h:32
gint sort_node_uname(gconstpointer a, gconstpointer b)
Definition: utils.c:225
GList * GListPtr
Definition: crm.h:210
#define pe_rsc_notify
Definition: status.h:193
enum crm_ais_msg_types type
Definition: internal.h:51
GListPtr running_on
Definition: status.h:294