| 622 | } |
| 623 | |
| 624 | static void |
| 625 | clone_update_pseudo_status(resource_t * rsc, gboolean * stopping, gboolean * starting, |
| 626 | gboolean * active) |
| 627 | { |
| 628 | GListPtr gIter = NULL; |
| 629 | |
| 630 | if (rsc->children) { |
| 631 | |
| 632 | gIter = rsc->children; |
| 633 | for (; gIter != NULL; gIter = gIter->next) { |
| 634 | resource_t *child = (resource_t *) gIter->data; |
| 635 | |
| 636 | clone_update_pseudo_status(child, stopping, starting, active); |
| 637 | } |
| 638 | |
| 639 | return; |
| 640 | } |
| 641 | |
| 642 | CRM_ASSERT(active != NULL); |
| 643 | CRM_ASSERT(starting != NULL); |
| 644 | CRM_ASSERT(stopping != NULL); |
| 645 | |
| 646 | if (rsc->running_on) { |
| 647 | *active = TRUE; |
| 648 | } |
| 649 | |
| 650 | gIter = rsc->actions; |
| 651 | for (; gIter != NULL; gIter = gIter->next) { |
| 652 | action_t *action = (action_t *) gIter->data; |
| 653 | |
| 654 | if (*starting && *stopping) { |
| 655 | return; |
| 656 | |
| 657 | } else if (is_set(action->flags, pe_action_optional)) { |
| 658 | pe_rsc_trace(rsc, "Skipping optional: %s", action->uuid); |
| 659 | continue; |
| 660 | |
| 661 | } else if (is_set(action->flags, pe_action_pseudo) == FALSE |
| 662 | && is_set(action->flags, pe_action_runnable) == FALSE) { |
| 663 | pe_rsc_trace(rsc, "Skipping unrunnable: %s", action->uuid); |
| 664 | continue; |
| 665 | |
| 666 | } else if (safe_str_eq(RSC_STOP, action->task)) { |
| 667 | pe_rsc_trace(rsc, "Stopping due to: %s", action->uuid); |
| 668 | *stopping = TRUE; |
| 669 | |
| 670 | } else if (safe_str_eq(RSC_START, action->task)) { |
| 671 | if (is_set(action->flags, pe_action_runnable) == FALSE) { |
| 672 | pe_rsc_trace(rsc, "Skipping pseudo-op: %s run=%d, pseudo=%d", |
| 673 | action->uuid, is_set(action->flags, pe_action_runnable), |
| 674 | is_set(action->flags, pe_action_pseudo)); |
| 675 | } else { |
| 676 | pe_rsc_trace(rsc, "Starting due to: %s", action->uuid); |
| 677 | pe_rsc_trace(rsc, "%s run=%d, pseudo=%d", |
| 678 | action->uuid, is_set(action->flags, pe_action_runnable), |
| 679 | is_set(action->flags, pe_action_pseudo)); |
| 680 | *starting = TRUE; |
| 681 | } |
no test coverage detected