14 #define VARIANT_GROUP 1
23 group_variant_data_t *group_data = NULL;
25 get_group_variant_data(group_data, rsc);
32 pe_rsc_debug(rsc,
"Dependency loop detected involving %s", rsc->
id);
36 if (group_data->first_child == NULL) {
43 rsc->
role = group_data->first_child->role;
45 group_data->first_child->rsc_cons =
46 g_list_concat(group_data->first_child->rsc_cons, rsc->
rsc_cons);
49 group_data->last_child->rsc_cons_lhs =
50 g_list_concat(group_data->last_child->rsc_cons_lhs, rsc->
rsc_cons_lhs);
57 for (; gIter != NULL; gIter = gIter->next) {
60 node = child_rsc->
cmds->
allocate(child_rsc, prefer, data_set);
61 if (group_node == NULL) {
66 rsc->
next_role = group_data->first_child->next_role;
70 if (group_data->colocated) {
82 const char *value = NULL;
87 for (; gIter != NULL; gIter = gIter->next) {
130 group_variant_data_t *group_data = NULL;
132 get_group_variant_data(group_data, parent);
134 if (group_data->ordered == FALSE) {
139 if (group_data->child_stopping && group_data->child_starting) {
143 for (; gIter != NULL; gIter = gIter->next) {
150 group_data->child_stopping = TRUE;
155 group_data->child_starting = TRUE;
168 group_variant_data_t *group_data = NULL;
170 get_group_variant_data(group_data, rsc);
176 for (; gIter != NULL; gIter = gIter->next) {
186 if (last_rsc == NULL) {
187 if (group_data->ordered) {
192 }
else if (group_data->colocated) {
194 child_rsc, last_rsc, NULL, NULL, data_set);
217 if (group_data->ordered == FALSE) {
224 }
else if (last_rsc != NULL) {
256 if (group_data->ordered
261 last_active = child_rsc;
264 last_rsc = child_rsc;
267 if (group_data->ordered && last_rsc != NULL) {
287 group_variant_data_t *group_data = NULL;
289 if (rsc_lh == NULL) {
290 pe_err(
"rsc_lh was NULL for %s", constraint->
id);
293 }
else if (rsc_rh == NULL) {
294 pe_err(
"rsc_rh was NULL for %s", constraint->
id);
299 pe_rsc_trace(rsc_lh,
"Processing constraints from %s", rsc_lh->
id);
301 get_group_variant_data(group_data, rsc_lh);
303 if (group_data->colocated) {
304 group_data->first_child->cmds->rsc_colocation_lh(group_data->first_child,
311 " between non-colocated group and %s", rsc_lh->
id, rsc_rh->
id);
315 for (; gIter != NULL; gIter = gIter->next) {
329 group_variant_data_t *group_data = NULL;
331 get_group_variant_data(group_data, rsc_rh);
334 pe_rsc_trace(rsc_rh,
"Processing RH of constraint %s", constraint->
id);
340 }
else if (group_data->colocated && group_data->first_child) {
343 group_data->last_child->cmds->rsc_colocation_rh(rsc_lh,
344 group_data->last_child,
349 group_data->first_child->cmds->rsc_colocation_rh(rsc_lh,
350 group_data->first_child,
359 " non-colocated group: %s", rsc_lh->
id, rsc_rh->
id);
363 for (; gIter != NULL; gIter = gIter->next) {
377 for (gIter = action->
rsc->
children; gIter != NULL; gIter = gIter->next) {
403 pe_rsc_trace(action->
rsc,
"%s is not runnable because of %s (not found in %s)",
404 action->
uuid, task_s, child->
id);
424 for (; gIter != NULL; gIter = gIter->next) {
444 gboolean reset_scores = TRUE;
445 group_variant_data_t *group_data = NULL;
447 get_group_variant_data(group_data, rsc);
449 pe_rsc_debug(rsc,
"Processing rsc_location %s for %s", constraint->
id, rsc->
id);
453 for (; gIter != NULL; gIter = gIter->next) {
457 if (group_data->colocated && reset_scores) {
458 reset_scores = FALSE;
464 g_list_free_full(zero, free);
487 group_variant_data_t *group_data = NULL;
489 get_group_variant_data(group_data, rsc);
492 pe_rsc_info(rsc,
"Breaking dependency loop with %s at %s", rsc->
id, rhs);
499 group_data->first_child->cmds->merge_weights(group_data->first_child, rhs, nodes, attr,
502 for (; gIter != NULL; gIter = gIter->next) {
#define CRM_CHECK(expr, failure_action)
node_t * group_color(resource_t *rsc, node_t *preferred, pe_working_set_t *data_set)
void group_internal_constraints(resource_t *rsc, pe_working_set_t *data_set)
const char * task2text(enum action_tasks task)
enum pe_action_flags(* action_flags)(action_t *, node_t *)
void native_expand(resource_t *rsc, pe_working_set_t *data_set)
#define pe_rsc_debug(rsc, fmt, args...)
gboolean safe_str_neq(const char *a, const char *b)
void group_update_pseudo_status(resource_t *parent, resource_t *child)
GListPtr node_list_dup(GListPtr list, gboolean reset, gboolean filter)
#define stop_action(rsc, node, optional)
void group_expand(resource_t *rsc, pe_working_set_t *data_set)
void(* expand)(resource_t *, pe_working_set_t *)
resource_alloc_functions_t * cmds
#define crm_config_err(fmt...)
enum action_tasks get_complex_task(resource_t *rsc, const char *name, gboolean allow_non_atomic)
enum rsc_role_e next_role
void(* rsc_colocation_lh)(pe_resource_t *, pe_resource_t *, rsc_colocation_t *, pe_working_set_t *)
enum pe_graph_flags(* update_actions)(pe_action_t *, pe_action_t *, pe_node_t *, enum pe_action_flags, enum pe_action_flags, enum pe_ordering, pe_working_set_t *data_set)
void group_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
void(* create_actions)(resource_t *, pe_working_set_t *)
enum pe_graph_flags native_update_actions(pe_action_t *first, pe_action_t *then, pe_node_t *node, enum pe_action_flags flags, enum pe_action_flags filter, enum pe_ordering type, pe_working_set_t *data_set)
#define clear_bit(word, bit)
void native_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
void(* rsc_colocation_rh)(pe_resource_t *, pe_resource_t *, rsc_colocation_t *, pe_working_set_t *)
void group_rsc_colocation_lh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
#define pe_rsc_provisional
#define XML_RSC_ATTR_PROMOTABLE
gboolean rsc_colocation_new(const char *id, const char *node_attr, int score, resource_t *rsc_lh, resource_t *rsc_rh, const char *state_lh, const char *state_rh, pe_working_set_t *data_set)
GHashTable * group_merge_weights(resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, enum pe_weights flags)
#define set_bit(word, bit)
#define order_stop_stop(rsc1, rsc2, type)
pe_resource_t * uber_parent(pe_resource_t *rsc)
const char * node_attribute
enum pe_graph_flags group_update_actions(pe_action_t *first, pe_action_t *then, pe_node_t *node, enum pe_action_flags flags, enum pe_action_flags filter, enum pe_ordering type, pe_working_set_t *data_set)
void group_rsc_colocation_rh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
action_t * find_first_action(GListPtr input, const char *uuid, const char *task, node_t *on_node)
#define pe_rsc_promotable
enum pe_restart restart_type
action_t * custom_action(resource_t *rsc, char *key, const char *task, node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set)
#define pe_rsc_allocating
enum pe_obj_types variant
void(* rsc_location)(pe_resource_t *, pe__location_t *)
enum pe_action_flags group_action_flags(action_t *action, node_t *node)
#define promoted_key(rsc)
void(* internal_constraints)(resource_t *, pe_working_set_t *)
#define start_action(rsc, node, optional)
void group_create_actions(resource_t *rsc, pe_working_set_t *data_set)
#define pe_clear_action_bit(action, bit)
GHashTable * native_merge_weights(resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, enum pe_weights flags)
enum pe_action_flags flags
void group_append_meta(resource_t *rsc, xmlNode *xml)
#define order_start_start(rsc1, rsc2, type)
gboolean crm_is_true(const char *s)
#define pe_rsc_trace(rsc, fmt, args...)
#define dump_node_scores(level, rsc, text, nodes)
void print_resource(int log_level, const char *pre_text, resource_t *rsc, gboolean details)
#define safe_str_eq(a, b)
node_t *(* allocate)(resource_t *, node_t *, pe_working_set_t *)
enum crm_ais_msg_types type
#define pe_rsc_info(rsc, fmt, args...)
GHashTable * allowed_nodes
int new_rsc_order(resource_t *lh_rsc, const char *lh_task, resource_t *rh_rsc, const char *rh_task, enum pe_ordering type, pe_working_set_t *data_set)