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

Function cib_construct_reply

cib/callbacks.c:822–855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

820}
821
822xmlNode *
823cib_construct_reply(xmlNode * request, xmlNode * output, int rc)
824{
825 int lpc = 0;
826 xmlNode *reply = NULL;
827 const char *name = NULL;
828 const char *value = NULL;
829
830 const char *names[] = {
831 F_CIB_OPERATION,
832 F_CIB_CALLID,
833 F_CIB_CLIENTID,
834 F_CIB_CALLOPTS
835 };
836 static int max = DIMOF(names);
837
838 crm_trace("Creating a basic reply");
839 reply = create_xml_node(NULL, "cib-reply");
840 crm_xml_add(reply, F_TYPE, T_CIB);
841
842 for (lpc = 0; lpc < max; lpc++) {
843 name = names[lpc];
844 value = crm_element_value(request, name);
845 crm_xml_add(reply, name, value);
846 }
847
848 crm_xml_add_int(reply, F_CIB_RC, rc);
849
850 if (output != NULL) {
851 crm_trace("Attaching reply output");
852 add_message_xml(reply, F_CIB_CALLDATA, output);
853 }
854 return reply;
855}
856
857int
858cib_process_command(xmlNode * request, xmlNode ** reply, xmlNode ** cib_diff, gboolean privileged)

Callers 2

cib_process_requestFunction · 0.85
cib_process_commandFunction · 0.85

Calls 5

create_xml_nodeFunction · 0.85
crm_xml_addFunction · 0.85
crm_element_valueFunction · 0.85
crm_xml_add_intFunction · 0.85
add_message_xmlFunction · 0.85

Tested by

no test coverage detected