* atb_string can be either: * 'lowest' * 'highest' * a list of nodeids */
| 692 | * a list of nodeids |
| 693 | */ |
| 694 | static void parse_atb_string(char *atb_string) |
| 695 | { |
| 696 | char *ptr; |
| 697 | long num; |
| 698 | |
| 699 | ENTER(); |
| 700 | auto_tie_breaker = ATB_NONE; |
| 701 | |
| 702 | if (!strcmp(atb_string, "lowest")) |
| 703 | auto_tie_breaker = ATB_LOWEST; |
| 704 | |
| 705 | if (!strcmp(atb_string, "highest")) |
| 706 | auto_tie_breaker = ATB_HIGHEST; |
| 707 | |
| 708 | if (atoi(atb_string)) { |
| 709 | |
| 710 | atb_nodelist_entries = 0; |
| 711 | ptr = atb_string; |
| 712 | do { |
| 713 | num = strtol(ptr, &ptr, 10); |
| 714 | if (num) { |
| 715 | log_printf(LOGSYS_LEVEL_DEBUG, "ATB nodelist[%d] = %d", atb_nodelist_entries, num); |
| 716 | atb_nodelist[atb_nodelist_entries++] = num; |
| 717 | } |
| 718 | } while (num); |
| 719 | |
| 720 | if (atb_nodelist_entries) { |
| 721 | auto_tie_breaker = ATB_LIST; |
| 722 | } |
| 723 | } |
| 724 | icmap_set_uint32("runtime.votequorum.atb_type", auto_tie_breaker); |
| 725 | log_printf(LOGSYS_LEVEL_DEBUG, "ATB type = %d", auto_tie_breaker); |
| 726 | |
| 727 | /* Make sure we got something */ |
| 728 | if (auto_tie_breaker == ATB_NONE) { |
| 729 | log_printf(LOGSYS_LEVEL_WARNING, "auto_tie_breaker_nodes is not valid. It must be 'lowest', 'highest' or a space-separated list of node IDs. auto_tie_breaker is disabled"); |
| 730 | auto_tie_breaker = ATB_NONE; |
| 731 | } |
| 732 | LEAVE(); |
| 733 | } |
| 734 | |
| 735 | static int check_qdevice_master(void) |
| 736 | { |
no test coverage detected