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

Function unpack_order_set

pengine/constraints.c:860–1031  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858}
859
860static gboolean
861unpack_order_set(xmlNode * set, enum pe_order_kind kind, resource_t ** rsc,
862 action_t ** begin, action_t ** end, action_t ** inv_begin, action_t ** inv_end,
863 const char *symmetrical, pe_working_set_t * data_set)
864{
865 xmlNode *xml_rsc = NULL;
866 GListPtr set_iter = NULL;
867 GListPtr resources = NULL;
868
869 resource_t *last = NULL;
870 resource_t *resource = NULL;
871
872 int local_kind = kind;
873 gboolean sequential = FALSE;
874 enum pe_ordering flags = pe_order_optional;
875
876 char *key = NULL;
877 const char *id = ID(set);
878 const char *action = crm_element_value(set, "action");
879 const char *sequential_s = crm_element_value(set, "sequential");
880 const char *kind_s = crm_element_value(set, XML_ORDER_ATTR_KIND);
881
882 /*
883 char *pseudo_id = NULL;
884 char *end_id = NULL;
885 char *begin_id = NULL;
886 */
887
888 if (action == NULL) {
889 action = RSC_START;
890 }
891
892 if (kind_s) {
893 local_kind = get_ordering_type(set);
894 }
895 if (sequential_s == NULL) {
896 sequential_s = "1";
897 }
898
899 sequential = crm_is_true(sequential_s);
900 if (crm_is_true(symmetrical)) {
901 flags = get_flags(id, local_kind, action, action, FALSE);
902 } else {
903 flags = get_asymmetrical_flags(local_kind);
904 }
905
906 for (xml_rsc = __xml_first_child(set); xml_rsc != NULL; xml_rsc = __xml_next(xml_rsc)) {
907 if (crm_str_eq((const char *)xml_rsc->name, XML_TAG_RESOURCE_REF, TRUE)) {
908 EXPAND_CONSTRAINT_IDREF(id, resource, ID(xml_rsc));
909 resources = g_list_append(resources, resource);
910 }
911 }
912
913 if (g_list_length(resources) == 1) {
914 crm_trace("Single set: %s", id);
915 *rsc = resource;
916 *end = NULL;
917 *begin = NULL;

Callers 1

unpack_rsc_orderFunction · 0.85

Calls 12

crm_element_valueFunction · 0.85
get_ordering_typeFunction · 0.85
crm_is_trueFunction · 0.85
get_flagsFunction · 0.85
get_asymmetrical_flagsFunction · 0.85
__xml_first_childFunction · 0.85
__xml_nextFunction · 0.85
crm_str_eqFunction · 0.85
generate_op_keyFunction · 0.85
custom_action_orderFunction · 0.85
new_rsc_orderFunction · 0.85
invert_actionFunction · 0.85

Tested by

no test coverage detected