MCPcopy Create free account
hub / github.com/corosync/corosync / init_all

Function init_all

tools/corosync-quorumtool.c:825–867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

823 */
824
825static int init_all(void) {
826 cmap_handle = 0;
827 q_handle = 0;
828 v_handle = 0;
829 c_handle = 0;
830
831 if (cmap_initialize(&cmap_handle) != CS_OK) {
832 fprintf(stderr, "Cannot initialize CMAP service\n");
833 cmap_handle = 0;
834 goto out;
835 }
836
837 if (quorum_initialize(&q_handle, &q_callbacks, &q_type) != CS_OK) {
838 fprintf(stderr, "Cannot initialize QUORUM service\n");
839 q_handle = 0;
840 goto out;
841 }
842
843 if (corosync_cfg_initialize(&c_handle, &c_callbacks) != CS_OK) {
844 fprintf(stderr, "Cannot initialise CFG service\n");
845 c_handle = 0;
846 goto out;
847 }
848
849 if (using_votequorum() <= 0) {
850 return 0;
851 }
852
853 if (votequorum_initialize(&v_handle, &v_callbacks) != CS_OK) {
854 fprintf(stderr, "Cannot initialise VOTEQUORUM service\n");
855 v_handle = 0;
856 goto out;
857 }
858
859 if (cmap_get_uint32(cmap_handle, "runtime.votequorum.this_node_id", &our_nodeid) != CS_OK) {
860 fprintf(stderr, "Unable to retrieve this_node_id\n");
861 goto out;
862 }
863
864 return 0;
865out:
866 return -1;
867}
868
869static void close_all(void) {
870 if (cmap_handle) {

Callers 1

mainFunction · 0.85

Calls 6

cmap_initializeFunction · 0.85
quorum_initializeFunction · 0.85
corosync_cfg_initializeFunction · 0.85
using_votequorumFunction · 0.85
votequorum_initializeFunction · 0.85
cmap_get_uint32Function · 0.85

Tested by

no test coverage detected