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

Function check_actions_for

pengine/allocate.c:341–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339 pe_working_set_t * data_set);
340
341static void
342check_actions_for(xmlNode * rsc_entry, resource_t * rsc, node_t * node, pe_working_set_t * data_set)
343{
344 GListPtr gIter = NULL;
345 int offset = -1;
346 int interval = 0;
347 int stop_index = 0;
348 int start_index = 0;
349
350 const char *task = NULL;
351 const char *interval_s = NULL;
352
353 xmlNode *rsc_op = NULL;
354 GListPtr op_list = NULL;
355 GListPtr sorted_op_list = NULL;
356 gboolean is_probe = FALSE;
357 gboolean did_change = FALSE;
358
359 CRM_CHECK(node != NULL, return);
360
361 if (is_set(rsc->flags, pe_rsc_orphan)) {
362 pe_rsc_trace(rsc, "Skipping param check for %s: orphan", rsc->id);
363 return;
364
365 } else if (pe_find_node_id(rsc->running_on, node->details->id) == NULL) {
366 pe_rsc_trace(rsc, "Skipping param check for %s: no longer active on %s",
367 rsc->id, node->details->uname);
368 return;
369 }
370
371 pe_rsc_trace(rsc, "Processing %s on %s", rsc->id, node->details->uname);
372
373 if (check_rsc_parameters(rsc, node, rsc_entry, data_set)) {
374 DeleteRsc(rsc, node, FALSE, data_set);
375 }
376
377 for (rsc_op = __xml_first_child(rsc_entry); rsc_op != NULL; rsc_op = __xml_next(rsc_op)) {
378 if (crm_str_eq((const char *)rsc_op->name, XML_LRM_TAG_RSC_OP, TRUE)) {
379 op_list = g_list_prepend(op_list, rsc_op);
380 }
381 }
382
383 sorted_op_list = g_list_sort(op_list, sort_op_by_callid);
384 calculate_active_ops(sorted_op_list, &start_index, &stop_index);
385
386 for (gIter = sorted_op_list; gIter != NULL; gIter = gIter->next) {
387 xmlNode *rsc_op = (xmlNode *) gIter->data;
388
389 offset++;
390
391 if (start_index < stop_index) {
392 /* stopped */
393 continue;
394 } else if (offset < start_index) {
395 /* action occurred prior to a start */
396 continue;
397 }
398

Callers 1

check_actionsFunction · 0.85

Calls 15

is_setFunction · 0.85
pe_find_node_idFunction · 0.85
check_rsc_parametersFunction · 0.85
DeleteRscFunction · 0.85
__xml_first_childFunction · 0.85
__xml_nextFunction · 0.85
crm_str_eqFunction · 0.85
calculate_active_opsFunction · 0.85
crm_element_valueFunction · 0.85
crm_parse_intFunction · 0.85
CancelXmlOpFunction · 0.85
check_action_definitionFunction · 0.85

Tested by

no test coverage detected