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

Function contains_stonith

pengine/constraints.c:179–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177};
178
179static enum contains_stonith_res
180contains_stonith(resource_t * rsc)
181{
182 enum contains_stonith_res res = contains_stonith_unknown;
183 GListPtr gIter = rsc->children;
184
185 if (gIter == FALSE) {
186 const char *class = crm_element_value(rsc->xml, XML_AGENT_ATTR_CLASS);
187
188 if (safe_str_eq(class, "stonith")) {
189 return contains_stonith_true;
190 }
191 return contains_stonith_false;
192 }
193
194 for (; gIter != NULL; gIter = gIter->next) {
195 resource_t *child = (resource_t *) gIter->data;
196 enum contains_stonith_res tmp = contains_stonith(child);
197
198 if (tmp != contains_stonith_unknown) {
199 switch (res) {
200 case contains_stonith_unknown:
201 res = tmp;
202 break;
203 case contains_stonith_false:
204 case contains_stonith_true:
205 if(tmp != res) {
206 return contains_stonith_mixed;
207 }
208 break;
209 case contains_stonith_mixed:
210 return contains_stonith_mixed;
211 }
212 }
213 }
214
215 return res;
216}
217
218static gboolean
219unpack_simple_rsc_order(xmlNode * xml_obj, pe_working_set_t * data_set)

Callers 1

validate_order_resourcesFunction · 0.85

Calls 1

crm_element_valueFunction · 0.85

Tested by

no test coverage detected