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

Function dump_resource

tools/crm_resource.c:321–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321static int
322dump_resource(const char *rsc, pe_working_set_t * data_set, gboolean expanded)
323{
324 char *rsc_xml = NULL;
325 resource_t *the_rsc = find_rsc_or_clone(rsc, data_set);
326
327 if (the_rsc == NULL) {
328 return -ENXIO;
329 }
330 the_rsc->fns->print(the_rsc, NULL, pe_print_printf, stdout);
331
332 if (expanded) {
333 rsc_xml = dump_xml_formatted(the_rsc->xml);
334 } else {
335 if (the_rsc->orig_xml) {
336 rsc_xml = dump_xml_formatted(the_rsc->orig_xml);
337 } else {
338 rsc_xml = dump_xml_formatted(the_rsc->xml);
339 }
340 }
341
342 fprintf(stdout, "%sxml:\n%s\n", expanded ? "" : "raw ", rsc_xml);
343
344 free(rsc_xml);
345
346 return 0;
347}
348
349static int
350dump_resource_attr(const char *rsc, const char *attr, pe_working_set_t * data_set)

Callers 1

mainFunction · 0.85

Calls 2

dump_xml_formattedFunction · 0.85
find_rsc_or_cloneFunction · 0.70

Tested by

no test coverage detected