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

Function master_update_pseudo_status

pengine/master.c:104–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104static void
105master_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; \

Callers 1

master_create_actionsFunction · 0.85

Calls 1

is_setFunction · 0.85

Tested by

no test coverage detected