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

Function do_pe_control

crmd/pengine.c:135–183  ·  view source on GitHub ↗

A_PE_START, A_PE_STOP, A_TE_RESTART */

Source from the content-addressed store, hash-verified

133
134/* A_PE_START, A_PE_STOP, A_TE_RESTART */
135void
136do_pe_control(long long action,
137 enum crmd_fsa_cause cause,
138 enum crmd_fsa_state cur_state,
139 enum crmd_fsa_input current_input, fsa_data_t * msg_data)
140{
141 struct crm_subsystem_s *this_subsys = pe_subsystem;
142
143 long long stop_actions = A_PE_STOP;
144 long long start_actions = A_PE_START;
145
146 static struct ipc_client_callbacks pe_callbacks =
147 {
148 .dispatch = pe_ipc_dispatch,
149 .destroy = pe_ipc_destroy
150 };
151
152 if (action & stop_actions) {
153 clear_bit(fsa_input_register, pe_subsystem->flag_required);
154
155 mainloop_del_ipc_client(pe_subsystem->source);
156 pe_subsystem->source = NULL;
157
158 clear_bit(fsa_input_register, pe_subsystem->flag_connected);
159 }
160
161 if ((action & start_actions) && (is_set(fsa_input_register, R_PE_CONNECTED) == FALSE)) {
162 if (cur_state != S_STOPPING) {
163 set_bit(fsa_input_register, pe_subsystem->flag_required);
164
165 pe_subsystem->source = mainloop_add_ipc_client(CRM_SYSTEM_PENGINE, G_PRIORITY_DEFAULT, 5*1024*1024/* 5Mb */, NULL, &pe_callbacks);
166
167 if (pe_subsystem->source == NULL) {
168 crm_warn("Setup of client connection failed, not adding channel to mainloop");
169 register_fsa_error(C_FSA_INTERNAL, I_FAIL, NULL);
170 return;
171 }
172
173 /* if (is_openais_cluster()) { */
174 /* pe_subsystem->pid = pe_subsystem->ipc->farside_pid; */
175 /* } */
176
177 set_bit(fsa_input_register, pe_subsystem->flag_connected);
178
179 } else {
180 crm_info("Ignoring request to start %s while shutting down", this_subsys->name);
181 }
182 }
183}
184
185int fsa_pe_query = 0;
186char *fsa_pe_ref = NULL;

Callers

nothing calls this directly

Calls 3

mainloop_del_ipc_clientFunction · 0.85
is_setFunction · 0.85
mainloop_add_ipc_clientFunction · 0.85

Tested by

no test coverage detected