| 825 | } |
| 826 | |
| 827 | gboolean |
| 828 | init_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 | |
| 861 | gboolean |
| 862 | check_message_sanity(const AIS_Message * msg, const char *data) |
no test coverage detected