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

Function cib_process_command

cib/callbacks.c:857–1118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

855}
856
857int
858cib_process_command(xmlNode * request, xmlNode ** reply, xmlNode ** cib_diff, gboolean privileged)
859{
860 xmlNode *input = NULL;
861 xmlNode *output = NULL;
862 xmlNode *result_cib = NULL;
863 xmlNode *current_cib = NULL;
864
865#if ENABLE_ACL
866 xmlNode *filtered_current_cib = NULL;
867#endif
868
869 int call_type = 0;
870 int call_options = 0;
871 int log_level = LOG_DEBUG_4;
872
873 const char *op = NULL;
874 const char *section = NULL;
875
876 int rc = pcmk_ok;
877 int rc2 = pcmk_ok;
878
879 gboolean send_r_notify = FALSE;
880 gboolean global_update = FALSE;
881 gboolean config_changed = FALSE;
882 gboolean manage_counters = TRUE;
883
884 CRM_ASSERT(cib_status == pcmk_ok);
885
886 *reply = NULL;
887 *cib_diff = NULL;
888 current_cib = the_cib;
889
890 /* Start processing the request... */
891 op = crm_element_value(request, F_CIB_OPERATION);
892 crm_element_value_int(request, F_CIB_CALLOPTS, &call_options);
893 rc = cib_get_operation_id(op, &call_type);
894
895 if (rc == pcmk_ok && privileged == FALSE) {
896 rc = cib_op_can_run(call_type, call_options, privileged, global_update);
897 }
898
899 rc2 = cib_op_prepare(call_type, request, &input, &section);
900 if (rc == pcmk_ok) {
901 rc = rc2;
902 }
903
904 if (rc != pcmk_ok) {
905 crm_trace("Call setup failed: %s", pcmk_strerror(rc));
906 goto done;
907
908 } else if (cib_op_modifies(call_type) == FALSE) {
909#if ENABLE_ACL
910 if (acl_enabled(config_hash) == FALSE
911 || acl_filter_cib(request, current_cib, current_cib, &filtered_current_cib) == FALSE) {
912 rc = cib_perform_op(op, call_options, cib_op_func(call_type), TRUE,
913 section, request, input, FALSE, &config_changed,
914 current_cib, &result_cib, NULL, &output);

Callers 1

cib_process_requestFunction · 0.85

Calls 15

crm_element_valueFunction · 0.85
crm_element_value_intFunction · 0.85
cib_get_operation_idFunction · 0.85
cib_op_can_runFunction · 0.85
cib_op_prepareFunction · 0.85
pcmk_strerrorFunction · 0.85
cib_op_modifiesFunction · 0.85
acl_enabledFunction · 0.85
acl_filter_cibFunction · 0.85
cib_perform_opFunction · 0.85
cib_op_funcFunction · 0.85
free_xmlFunction · 0.85

Tested by

no test coverage detected