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

Function init_cs_connection_once

lib/cluster/corosync.c:827–859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

825}
826
827gboolean
828init_cs_connection_once(crm_cluster_t *cluster)
829{
830 enum cluster_type_e stack = get_cluster_type();
831
832 crm_peer_init();
833
834 /* Here we just initialize comms */
835 if(stack != pcmk_cluster_corosync) {
836 crm_err("Invalid cluster type: %s (%d)", name_for_cluster_type(stack), stack);
837 return FALSE;
838 }
839
840 if (init_cpg_connection(cluster->cs_dispatch, cluster->destroy, &pcmk_nodeid) == FALSE) {
841 return FALSE;
842 }
843 pcmk_uname = get_local_node_name();
844 crm_info("Connection to '%s': established", name_for_cluster_type(stack));
845
846 CRM_ASSERT(pcmk_uname != NULL);
847 pcmk_uname_len = strlen(pcmk_uname);
848
849 if (pcmk_nodeid != 0) {
850 /* Ensure the local node always exists */
851 crm_get_peer(pcmk_nodeid, pcmk_uname);
852 }
853
854 cluster->uuid = get_corosync_uuid(pcmk_nodeid, pcmk_uname);
855 cluster->uname = strdup(pcmk_uname);
856 cluster->nodeid = pcmk_nodeid;
857
858 return TRUE;
859}
860
861gboolean
862check_message_sanity(const AIS_Message * msg, const char *data)

Callers 1

init_cs_connectionFunction · 0.70

Calls 7

get_cluster_typeFunction · 0.85
crm_peer_initFunction · 0.85
name_for_cluster_typeFunction · 0.85
get_local_node_nameFunction · 0.85
crm_get_peerFunction · 0.85
get_corosync_uuidFunction · 0.85
init_cpg_connectionFunction · 0.70

Tested by

no test coverage detected