| 102 | } |
| 103 | |
| 104 | static void |
| 105 | master_update_pseudo_status(resource_t * rsc, gboolean * demoting, gboolean * promoting) |
| 106 | { |
| 107 | GListPtr gIter = NULL; |
| 108 | |
| 109 | if (rsc->children) { |
| 110 | gIter = rsc->children; |
| 111 | for (; gIter != NULL; gIter = gIter->next) { |
| 112 | resource_t *child = (resource_t *) gIter->data; |
| 113 | |
| 114 | master_update_pseudo_status(child, demoting, promoting); |
| 115 | } |
| 116 | return; |
| 117 | } |
| 118 | |
| 119 | CRM_ASSERT(demoting != NULL); |
| 120 | CRM_ASSERT(promoting != NULL); |
| 121 | |
| 122 | gIter = rsc->actions; |
| 123 | for (; gIter != NULL; gIter = gIter->next) { |
| 124 | action_t *action = (action_t *) gIter->data; |
| 125 | |
| 126 | if (*promoting && *demoting) { |
| 127 | return; |
| 128 | |
| 129 | } else if (is_set(action->flags, pe_action_optional)) { |
| 130 | continue; |
| 131 | |
| 132 | } else if (safe_str_eq(RSC_DEMOTE, action->task)) { |
| 133 | *demoting = TRUE; |
| 134 | |
| 135 | } else if (safe_str_eq(RSC_PROMOTE, action->task)) { |
| 136 | *promoting = TRUE; |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | #define apply_master_location(list) do { \ |
| 142 | gIter2 = list; \ |
no test coverage detected