📄 incarnation.c
字号:
);}void incarnation_internal_constraints(resource_t *rsc, GListPtr *ordering_constraints){ resource_t *last_rsc = NULL; incarnation_variant_data_t *incarnation_data = NULL; get_incarnation_variant_data(incarnation_data, rsc); /* global stop before start */ order_new(incarnation_data->self, stop_rsc, NULL, incarnation_data->self, start_rsc, NULL, pecs_startstop, ordering_constraints); slist_iter( child_rsc, resource_t, incarnation_data->child_list, lpc, /* child stop before start */ order_new(child_rsc, stop_rsc, NULL, child_rsc, start_rsc, NULL, pecs_startstop, ordering_constraints); if(incarnation_data->ordered && last_rsc != NULL) { crm_devel("Ordered version"); if(lpc < incarnation_data->active_incarnation) { /* child/child relative start */ order_new(last_rsc, start_rsc, NULL, child_rsc, start_rsc, NULL, pecs_startstop, ordering_constraints); } /* child/child relative stop */ order_new(child_rsc, stop_rsc, NULL, last_rsc, stop_rsc, NULL, pecs_startstop, ordering_constraints); } else if(incarnation_data->ordered) { crm_devel("Ordered version (1st node)"); /* child start before global started */ order_new(child_rsc, start_rsc, NULL, incarnation_data->self, started_rsc, NULL, pecs_startstop, ordering_constraints); /* first child stop before global stopped */ order_new(child_rsc, stop_rsc, NULL, incarnation_data->self, stopped_rsc, NULL, pecs_startstop, ordering_constraints); /* global start before first child start */ order_new(incarnation_data->self, start_rsc, NULL, child_rsc, start_rsc, NULL, pecs_startstop, ordering_constraints); } else { crm_devel("Un-ordered version"); if(lpc < incarnation_data->active_incarnation) { /* child start before global started */ order_new(child_rsc, start_rsc, NULL, incarnation_data->self, started_rsc, NULL, pecs_startstop, ordering_constraints); } /* global start before child start */ order_new(incarnation_data->self, start_rsc, NULL, child_rsc, start_rsc, NULL, pecs_startstop, ordering_constraints); /* child stop before global stopped */ order_new(child_rsc, stop_rsc, NULL, incarnation_data->self, stopped_rsc, NULL, pecs_startstop, ordering_constraints); /* global stop before child stop */ order_new(incarnation_data->self, stop_rsc, NULL, child_rsc, stop_rsc, NULL, pecs_startstop, ordering_constraints); } if(lpc < incarnation_data->active_incarnation) { last_rsc = child_rsc; } ); if(incarnation_data->ordered && last_rsc != NULL) { crm_devel("Ordered version (last node)"); /* last child start before global started */ order_new(last_rsc, start_rsc, NULL, incarnation_data->self, started_rsc, NULL, pecs_startstop, ordering_constraints); /* global stop before first child stop */ order_new(incarnation_data->self, stop_rsc, NULL, last_rsc, stop_rsc, NULL, pecs_startstop, ordering_constraints); } }void incarnation_rsc_dependancy_lh(rsc_dependancy_t *constraint){ resource_t *rsc = constraint->rsc_lh; incarnation_variant_data_t *incarnation_data = NULL; if(rsc == NULL) { crm_err("rsc_lh was NULL for %s", constraint->id); return; } else if(constraint->rsc_rh == NULL) { crm_err("rsc_rh was NULL for %s", constraint->id); return; } else if(constraint->strength != pecs_must_not) { crm_warn("rsc_dependancies other than \"must_not\" " "are not supported for incarnation resources"); return; } else { crm_devel("Processing constraints from %s", rsc->id); } get_incarnation_variant_data(incarnation_data, rsc); slist_iter( child_rsc, resource_t, incarnation_data->child_list, lpc, crm_devel_action(print_resource("LHS", child_rsc, TRUE)); child_rsc->fns->rsc_dependancy_rh(child_rsc, constraint); );}void incarnation_rsc_dependancy_rh(resource_t *rsc, rsc_dependancy_t *constraint){ incarnation_variant_data_t *incarnation_data = NULL; crm_verbose("Processing RH of constraint %s", constraint->id); if(rsc == NULL) { crm_err("rsc_lh was NULL for %s", constraint->id); return; } else if(constraint->rsc_rh == NULL) { crm_err("rsc_rh was NULL for %s", constraint->id); return; } else if(constraint->strength != pecs_must_not) { crm_warn("rsc_dependancies other than \"must_not\" " "are not supported for incarnation resources"); return; } else { crm_devel_action(print_resource("LHS", rsc, FALSE)); } get_incarnation_variant_data(incarnation_data, rsc); slist_iter( child_rsc, resource_t, incarnation_data->child_list, lpc, crm_devel_action(print_resource("RHS", child_rsc, FALSE)); child_rsc->fns->rsc_dependancy_rh(child_rsc, constraint); );}void incarnation_rsc_order_lh(resource_t *rsc, order_constraint_t *order){ incarnation_variant_data_t *incarnation_data = NULL; get_incarnation_variant_data(incarnation_data, rsc); crm_verbose("Processing LH of ordering constraint %d", order->id); if(order->lh_action_task == start_rsc) { order->lh_action_task = started_rsc; } else if(order->lh_action_task == stop_rsc) { order->lh_action_task = stopped_rsc; } incarnation_data->self->fns->rsc_order_lh(incarnation_data->self, order);}void incarnation_rsc_order_rh( action_t *lh_action, resource_t *rsc, order_constraint_t *order){ incarnation_variant_data_t *incarnation_data = NULL; get_incarnation_variant_data(incarnation_data, rsc); crm_verbose("Processing RH of ordering constraint %d", order->id); incarnation_data->self->fns->rsc_order_rh(lh_action, incarnation_data->self, order);}void incarnation_rsc_location(resource_t *rsc, rsc_to_node_t *constraint){ incarnation_variant_data_t *incarnation_data = NULL; get_incarnation_variant_data(incarnation_data, rsc); crm_verbose("Processing actions from %s", rsc->id); incarnation_data->self->fns->rsc_location(incarnation_data->self, constraint); slist_iter( child_rsc, resource_t, incarnation_data->child_list, lpc, child_rsc->fns->rsc_location(child_rsc, constraint); );}void incarnation_expand(resource_t *rsc, crm_data_t * *graph){ incarnation_variant_data_t *incarnation_data = NULL; get_incarnation_variant_data(incarnation_data, rsc); crm_verbose("Processing actions from %s", rsc->id); incarnation_data->self->fns->expand(incarnation_data->self, graph); slist_iter( child_rsc, resource_t, incarnation_data->child_list, lpc, child_rsc->fns->expand(child_rsc, graph); );}void incarnation_dump(resource_t *rsc, const char *pre_text, gboolean details){ incarnation_variant_data_t *incarnation_data = NULL; get_incarnation_variant_data(incarnation_data, rsc); common_dump(rsc, pre_text, details); incarnation_data->self->fns->dump( incarnation_data->self, pre_text, details); slist_iter( child_rsc, resource_t, incarnation_data->child_list, lpc, child_rsc->fns->dump(child_rsc, pre_text, details); );}void incarnation_free(resource_t *rsc){ incarnation_variant_data_t *incarnation_data = NULL; get_incarnation_variant_data(incarnation_data, rsc); crm_verbose("Freeing %s", rsc->id); slist_iter( child_rsc, resource_t, incarnation_data->child_list, lpc, crm_verbose("Freeing child %s", child_rsc->id); child_rsc->fns->free(child_rsc); ); crm_verbose("Freeing child list"); pe_free_shallow_adv(incarnation_data->child_list, FALSE); incarnation_data->self->fns->free(incarnation_data->self); common_free(rsc);}voidincarnation_agent_constraints(resource_t *rsc){ incarnation_variant_data_t *incarnation_data = NULL; get_incarnation_variant_data(incarnation_data, rsc); slist_iter( child_rsc, resource_t, incarnation_data->child_list, lpc, child_rsc->fns->agent_constraints(child_rsc); );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -