| 177 | }; |
| 178 | |
| 179 | static enum contains_stonith_res |
| 180 | contains_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 | |
| 218 | static gboolean |
| 219 | unpack_simple_rsc_order(xmlNode * xml_obj, pe_working_set_t * data_set) |
no test coverage detected