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

Function main

pengine/ptest.c:145–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143/* *INDENT-ON* */
144
145int
146main(int argc, char **argv)
147{
148 GListPtr lpc = NULL;
149 gboolean process = TRUE;
150 gboolean all_good = TRUE;
151 enum transition_status graph_rc = -1;
152 crm_graph_t *transition = NULL;
153 crm_time_t *a_date = NULL;
154 cib_t *cib_conn = NULL;
155
156 xmlNode *cib_object = NULL;
157 int argerr = 0;
158 int flag;
159
160 char *msg_buffer = NULL;
161 gboolean optional = FALSE;
162 pe_working_set_t data_set;
163
164 const char *source = NULL;
165 const char *xml_file = NULL;
166 const char *dot_file = NULL;
167 const char *graph_file = NULL;
168 const char *input_file = NULL;
169 const char *input_xml = NULL;
170
171 /* disable glib's fancy allocators that can't be free'd */
172 GMemVTable vtable;
173
174 vtable.malloc = malloc;
175 vtable.realloc = realloc;
176 vtable.free = free;
177 vtable.calloc = calloc;
178 vtable.try_malloc = malloc;
179 vtable.try_realloc = realloc;
180
181 g_mem_set_vtable(&vtable);
182
183 crm_log_cli_init("ptest");
184 crm_set_options(NULL, "[-?Vv] -[Xxp] {other options}", long_options,
185 "Calculate the cluster's response to the supplied cluster state\n"
186 "\nSuperceeded by crm_simulate and likely to be removed in a future release\n\n");
187
188 while (1) {
189 int option_index = 0;
190
191 flag = crm_get_option(argc, argv, &option_index);
192 if (flag == -1)
193 break;
194
195 switch (flag) {
196 case 'S':
197 do_simulation = TRUE;
198 break;
199 case 'a':
200 all_actions = TRUE;
201 break;
202 case 'w':

Callers

nothing calls this directly

Calls 15

crm_log_cli_initFunction · 0.85
crm_set_optionsFunction · 0.85
crm_get_optionFunction · 0.85
crm_bump_log_levelFunction · 0.85
crm_helpFunction · 0.85
cib_newFunction · 0.85
get_cib_copyFunction · 0.85
pcmk_strerrorFunction · 0.85
filename2xmlFunction · 0.85
string2xmlFunction · 0.85
get_object_rootFunction · 0.85
create_xml_nodeFunction · 0.85

Tested by

no test coverage detected