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

Function cib_process_request

cib/callbacks.c:626–820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

624}
625
626void
627cib_process_request(xmlNode * request, gboolean force_synchronous, gboolean privileged,
628 gboolean from_peer, cib_client_t * cib_client)
629{
630 int call_type = 0;
631 int call_options = 0;
632
633 gboolean process = TRUE;
634 gboolean is_update = TRUE;
635 gboolean needs_reply = TRUE;
636 gboolean local_notify = FALSE;
637 gboolean needs_forward = FALSE;
638 gboolean global_update = crm_is_true(crm_element_value(request, F_CIB_GLOBAL_UPDATE));
639
640 xmlNode *op_reply = NULL;
641 xmlNode *result_diff = NULL;
642
643 int rc = pcmk_ok;
644 const char *op = crm_element_value(request, F_CIB_OPERATION);
645 const char *originator = crm_element_value(request, F_ORIG);
646 const char *host = crm_element_value(request, F_CIB_HOST);
647 const char *client_id = crm_element_value(request, F_CIB_CLIENTID);
648
649 crm_trace("%s Processing msg %s", cib_our_uname, crm_element_value(request, F_SEQ));
650
651 cib_num_ops++;
652 if (cib_num_ops == 0) {
653 cib_num_fail = 0;
654 cib_num_local = 0;
655 cib_num_updates = 0;
656 crm_info("Stats wrapped around");
657 }
658
659 if (host != NULL && strlen(host) == 0) {
660 host = NULL;
661 }
662
663 crm_element_value_int(request, F_CIB_CALLOPTS, &call_options);
664 if (force_synchronous) {
665 call_options |= cib_sync_call;
666 }
667
668 crm_trace("Processing %s message (%s) for %s...",
669 from_peer ? "peer" : "local",
670 from_peer ? originator : cib_our_uname, host ? host : "master");
671
672 rc = cib_get_operation_id(op, &call_type);
673 if (rc != pcmk_ok) {
674 /* TODO: construct error reply? */
675 crm_err("Pre-processing of command failed: %s", pcmk_strerror(rc));
676 return;
677 }
678
679 is_update = cib_op_modifies(call_type);
680 if (is_update) {
681 cib_num_updates++;
682 }
683

Callers 2

cib_peer_callbackFunction · 0.85

Calls 15

crm_is_trueFunction · 0.85
crm_element_valueFunction · 0.85
crm_element_value_intFunction · 0.85
cib_get_operation_idFunction · 0.85
pcmk_strerrorFunction · 0.85
cib_op_modifiesFunction · 0.85
parse_local_optionsFunction · 0.85
parse_peer_optionsFunction · 0.85
forward_requestFunction · 0.85
cib_construct_replyFunction · 0.85
cib_process_commandFunction · 0.85
crm_xml_add_intFunction · 0.85

Tested by

no test coverage detected