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

Function main

tools/crm_node.c:740–865  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

738int set_cluster_type(enum cluster_type_e type);
739
740int
741main(int argc, char **argv)
742{
743 int flag = 0;
744 int argerr = 0;
745 uint32_t nodeid = 0;
746 gboolean force_flag = FALSE;
747 gboolean dangerous_cmd = FALSE;
748 enum cluster_type_e try_stack = pcmk_cluster_unknown;
749
750 int option_index = 0;
751
752 crm_peer_init();
753 crm_log_cli_init("crm_node");
754 crm_set_options(NULL, "command [options]", long_options,
755 "Tool for displaying low-level node information");
756
757 while (flag >= 0) {
758 flag = crm_get_option(argc, argv, &option_index);
759 switch (flag) {
760 case -1:
761 break;
762 case 'V':
763 crm_bump_log_level(argc, argv);
764 break;
765 case '$':
766 case '?':
767 crm_help(flag, EX_OK);
768 break;
769 case 'Q':
770 do_quiet = TRUE;
771 break;
772 case 'H':
773 set_cluster_type(pcmk_cluster_heartbeat);
774 break;
775 case 'A':
776 set_cluster_type(pcmk_cluster_classic_ais);
777 break;
778 case 'C':
779 set_cluster_type(pcmk_cluster_corosync);
780 break;
781 case 'c':
782 set_cluster_type(pcmk_cluster_cman);
783 break;
784 case 'f':
785 force_flag = TRUE;
786 break;
787 case 'R':
788 dangerous_cmd = TRUE;
789 command = flag;
790 target_uname = optarg;
791 break;
792 case 'N':
793 command = flag;
794 nodeid = crm_parse_int(optarg, NULL);
795 break;
796 case 'p':
797 case 'e':

Callers

nothing calls this directly

Calls 15

crm_peer_initFunction · 0.85
crm_log_cli_initFunction · 0.85
crm_set_optionsFunction · 0.85
crm_get_optionFunction · 0.85
crm_bump_log_levelFunction · 0.85
crm_helpFunction · 0.85
set_cluster_typeFunction · 0.85
crm_parse_intFunction · 0.85
get_local_node_nameFunction · 0.85
crm_exitFunction · 0.85
get_node_nameFunction · 0.85
get_cluster_typeFunction · 0.85

Tested by

no test coverage detected