MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / check_actions

Function check_actions

pengine/allocate.c:488–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488static void
489check_actions(pe_working_set_t * data_set)
490{
491 const char *id = NULL;
492 node_t *node = NULL;
493 xmlNode *lrm_rscs = NULL;
494 xmlNode *status = get_object_root(XML_CIB_TAG_STATUS, data_set->input);
495
496 xmlNode *node_state = NULL;
497
498 for (node_state = __xml_first_child(status); node_state != NULL;
499 node_state = __xml_next(node_state)) {
500 if (crm_str_eq((const char *)node_state->name, XML_CIB_TAG_STATE, TRUE)) {
501 id = crm_element_value(node_state, XML_ATTR_ID);
502 lrm_rscs = find_xml_node(node_state, XML_CIB_TAG_LRM, FALSE);
503 lrm_rscs = find_xml_node(lrm_rscs, XML_LRM_TAG_RESOURCES, FALSE);
504
505 node = pe_find_node_id(data_set->nodes, id);
506
507 if (node == NULL) {
508 continue;
509
510 } else if (can_run_resources(node) == FALSE) {
511 crm_trace("Skipping param check for %s: cant run resources",
512 node->details->uname);
513 continue;
514 }
515
516 crm_trace("Processing node %s", node->details->uname);
517 if (node->details->online || is_set(data_set->flags, pe_flag_stonith_enabled)) {
518 xmlNode *rsc_entry = NULL;
519
520 for (rsc_entry = __xml_first_child(lrm_rscs); rsc_entry != NULL;
521 rsc_entry = __xml_next(rsc_entry)) {
522 if (crm_str_eq((const char *)rsc_entry->name, XML_LRM_TAG_RESOURCE, TRUE)) {
523
524 if (xml_has_children(rsc_entry)) {
525 GListPtr gIter = NULL;
526 GListPtr result = NULL;
527 const char *rsc_id = ID(rsc_entry);
528
529 CRM_CHECK(rsc_id != NULL, return);
530
531 result = find_rsc_list(NULL, NULL, rsc_id, TRUE, FALSE, data_set);
532 for (gIter = result; gIter != NULL; gIter = gIter->next) {
533 resource_t *rsc = (resource_t *) gIter->data;
534
535 check_actions_for(rsc_entry, rsc, node, data_set);
536 }
537 g_list_free(result);
538 }
539 }
540 }
541 }
542 }
543 }
544}
545

Callers 1

stage4Function · 0.85

Calls 12

get_object_rootFunction · 0.85
__xml_first_childFunction · 0.85
__xml_nextFunction · 0.85
crm_str_eqFunction · 0.85
crm_element_valueFunction · 0.85
find_xml_nodeFunction · 0.85
pe_find_node_idFunction · 0.85
can_run_resourcesFunction · 0.85
is_setFunction · 0.85
xml_has_childrenFunction · 0.85
find_rsc_listFunction · 0.85
check_actions_forFunction · 0.85

Tested by

no test coverage detected