81#include <sys/socket.h> 
   84#include <sys/resource.h> 
   86#include <netinet/in.h> 
  100#include <systemd/sd-daemon.h> 
  103#include <qb/qbdefs.h> 
  105#include <qb/qbloop.h> 
  106#include <qb/qbutil.h> 
  107#include <qb/qbipcs.h> 
  130#ifdef HAVE_SMALL_MEMORY_FOOTPRINT 
  131#define IPC_LOGSYS_SIZE                 1024*64 
  133#define IPC_LOGSYS_SIZE                 8192*128 
  148#define SERVER_BACKLOG 5 
  150static int sched_priority = 0;
 
  152static unsigned int service_count = 32;
 
  158static int sync_in_process = 1;
 
  160static qb_loop_t *corosync_poll_handle;
 
  166static char corosync_lock_file[PATH_MAX + 1] = 
LOCALSTATEDIR"/run/corosync.pid";
 
  168static char corosync_config_file[PATH_MAX + 1] = 
COROSYSCONFDIR "/corosync.conf";
 
  170static int lockfile_fd = -1;
 
  180        return (corosync_poll_handle);
 
 
  188                int (*dispatch_fn) (
int fd,
 
  192        return qb_loop_poll_add(handle, QB_LOOP_MED, fd, events, data,
 
 
  198        return qb_loop_poll_del(handle, fd);
 
 
  215        return (corosync_config_file);
 
 
  218static void corosync_blackbox_write_to_file (
void)
 
  220        char fname[PATH_MAX];
 
  221        char fdata_fname[PATH_MAX];
 
  222        char time_str[PATH_MAX];
 
  223        struct tm cur_time_tm;
 
  227        cur_time_t = time(NULL);
 
  228        localtime_r(&cur_time_t, &cur_time_tm);
 
  230        strftime(time_str, PATH_MAX, 
"%Y-%m-%dT%H:%M:%S", &cur_time_tm);
 
  231        if (snprintf(fname, PATH_MAX, 
"%s/fdata-%s-%lld",
 
  234            (
long long int)getpid()) >= PATH_MAX) {
 
  239        if ((res = qb_log_blackbox_write_to_file(fname)) < 0) {
 
  243        snprintf(fdata_fname, 
sizeof(fdata_fname), 
"%s/fdata", 
get_state_dir());
 
  245        if (symlink(fname, fdata_fname) == -1) {
 
  251static void unlink_all_completed (
void)
 
  254        qb_loop_stop (corosync_poll_handle);
 
  263static int32_t sig_diag_handler (
int num, 
void *data)
 
  269static int32_t sig_exit_handler (
int num, 
void *data)
 
  276static void sigsegv_handler (
int num)
 
  278        (void)signal (num, SIG_DFL);
 
  279        corosync_blackbox_write_to_file ();
 
  284#define LOCALHOST_IP inet_addr("127.0.0.1") 
  286static void *corosync_group_handle;
 
  293static void serialize_lock (
void)
 
  297static void serialize_unlock (
void)
 
  301static void corosync_sync_completed (
void)
 
  304                "Completed service synchronization, ready to provide service.");
 
  314#ifdef HAVE_LIBSYSTEMD 
  315        sd_notify (0, 
"READY=1");
 
  319static int corosync_sync_callbacks_retrieve (
 
  327        if (callbacks == NULL) {
 
  342static void member_object_joined (
unsigned int nodeid)
 
  349                "runtime.members.%u.ip", 
nodeid);
 
  351                "runtime.members.%u.join_count", 
nodeid);
 
  353                "runtime.members.%u.status", 
nodeid);
 
  368static void member_object_left (
unsigned int nodeid)
 
  373                "runtime.members.%u.status", 
nodeid);
 
  380static void confchg_fn (
 
  382        const unsigned int *member_list, 
size_t member_list_entries,
 
  383        const unsigned int *left_list, 
size_t left_list_entries,
 
  384        const unsigned int *joined_list, 
size_t joined_list_entries,
 
  388        int abort_activate = 0;
 
  390        if (sync_in_process == 1) {
 
  397        for (i = 0; i < left_list_entries; i++) {
 
  398                member_object_left (left_list[i]);
 
  400        for (i = 0; i < joined_list_entries; i++) {
 
  401                member_object_joined (joined_list[i]);
 
  406        for (i = 0; i < service_count; i++) {
 
  409                                member_list, member_list_entries,
 
  410                                left_list, left_list_entries,
 
  411                                joined_list, joined_list_entries, 
ring_id);
 
  415        if (abort_activate) {
 
  426static void priv_drop (
void)
 
  431static void corosync_tty_detach (
void)
 
  459        devnull = open(
"/dev/null", O_RDWR);
 
  464        if (dup2(devnull, 0) < 0 || dup2(devnull, 1) < 0
 
  465            || dup2(devnull, 2) < 0) {
 
  472static void corosync_mlockall (
void)
 
  475        struct rlimit rlimit;
 
  477        rlimit.rlim_cur = RLIM_INFINITY;
 
  478        rlimit.rlim_max = RLIM_INFINITY;
 
  480#ifndef RLIMIT_MEMLOCK 
  481#define RLIMIT_MEMLOCK RLIMIT_VMEM 
  487                        "Could not increase RLIMIT_MEMLOCK, not locking memory");
 
  491        res = mlockall (MCL_CURRENT | MCL_FUTURE);
 
  494                        "Could not lock memory of service to avoid page faults");
 
  499static void corosync_totem_stats_updater (
void *data)
 
  502        uint32_t total_mtt_rx_token;
 
  503        uint32_t total_backlog_calc;
 
  504        uint32_t total_token_holdtime;
 
  519                        cstr = 
"number of multicast sendmsg failures is above threshold";
 
  523                        cstr = 
"totem is continuously in gather state";
 
  527                        "Totem is unable to form a cluster because of an " 
  528                        "operating system or network fault (reason: %s). The most common " 
  529                        "cause of this message is that the local firewall is " 
  530                        "configured improperly.", cstr);
 
  536        total_mtt_rx_token = 0;
 
  537        total_token_holdtime = 0;
 
  538        total_backlog_calc = 0;
 
  570                corosync_totem_stats_updater,
 
  571                &corosync_stats_timer_handle);
 
  574static void corosync_totem_stats_init (
void)
 
  578                corosync_totem_stats_updater,
 
  579                &corosync_stats_timer_handle);
 
  582static void deliver_fn (
 
  585        unsigned int msg_len,
 
  586        int endian_conversion_required)
 
  588        const struct qb_ipc_request_header *
header;
 
  594        if (endian_conversion_required) {
 
  617        if (endian_conversion_required) {
 
  618                assert(
corosync_service[service]->exec_engine[fn_id].exec_endian_convert_fn != NULL);
 
  628        const struct iovec *iovec,
 
  629        unsigned int iov_len,
 
  632        const struct qb_ipc_request_header *req = iovec->iov_base;
 
  636        service = req->id >> 16;
 
  637        fn_id = req->id & 0xffff;
 
 
  646static void corosync_ring_id_create_or_load (
 
  652        char filename[PATH_MAX];
 
  654        snprintf (filename, 
sizeof(filename), 
"%s/ringid_%u",
 
  656        fd = open (filename, O_RDONLY);
 
  667        if ((fd == -1) || (res != 
sizeof (uint64_t))) {
 
  669                fd = creat (filename, 0600);
 
  675                                        "Couldn't write ringid file '%s'", filename);
 
  681                                "Couldn't create ringid file '%s'", filename);
 
  690static void corosync_ring_id_store (
 
  694        char filename[PATH_MAX];
 
  698        snprintf (filename, 
sizeof(filename), 
"%s/ringid_%u",
 
  701        fd = creat (filename, 0600);
 
  722static qb_loop_timer_handle recheck_the_q_level_timer;
 
  738        unsigned int service,
 
  741        void *sending_allowed_private_data)
 
  745        struct iovec reserve_iovec;
 
  746        struct qb_ipc_request_header *
header = (
struct qb_ipc_request_header *)msg;
 
  749        reserve_iovec.iov_base = (
char *)
header;
 
  750        reserve_iovec.iov_len = 
header->size;
 
  753                corosync_group_handle,
 
  764        sending_allowed = QB_FALSE;
 
  770                        sending_allowed = QB_TRUE;
 
  772                        sending_allowed = QB_TRUE;
 
  779                return -EHOSTUNREACH;
 
  782        return (sending_allowed);
 
 
  800        assert (source != NULL);
 
 
  811        assert ((source != NULL) && (conn != NULL));
 
 
  824static void timer_function_scheduler_timeout (
void *data)
 
  827        unsigned long long tv_current;
 
  828        unsigned long long tv_diff;
 
  829        uint64_t schedmiss_event_tstamp;
 
  831        tv_current = qb_util_nano_current_get ();
 
  833        if (timeout_data->
tv_prev == 0) {
 
  837                timeout_data->
tv_prev = tv_current;
 
  841        tv_diff = tv_current - timeout_data->
tv_prev;
 
  842        timeout_data->
tv_prev = tv_current;
 
  845                schedmiss_event_tstamp = qb_util_nano_from_epoch_get() / QB_TIME_NS_IN_MSEC;
 
  848                    "(threshold is %0.4f ms). Consider token timeout increase.",
 
  849                    schedmiss_event_tstamp,
 
  850                    (
float)tv_diff / QB_TIME_NS_IN_MSEC, (
float)timeout_data->
max_tv_diff / QB_TIME_NS_IN_MSEC);
 
  859        qb_loop_timer_add (corosync_poll_handle,
 
  863                timer_function_scheduler_timeout,
 
  873static int corosync_set_rr_scheduler (
int silent)
 
  877#if defined(HAVE_PTHREAD_SETSCHEDPARAM) && defined(HAVE_SCHED_GET_PRIORITY_MAX) && defined(HAVE_SCHED_SETSCHEDULER) 
  880        sched_priority = sched_get_priority_max (SCHED_RR);
 
  881        if (sched_priority != -1) {
 
  887                                        "Could not set SCHED_RR at priority %d",
 
  892#ifdef HAVE_QB_LOG_THREAD_PRIORITY_SET 
  893                        qb_log_thread_priority_set (SCHED_OTHER, 0);
 
  901#ifdef HAVE_QB_LOG_THREAD_PRIORITY_SET 
  902                        res = qb_log_thread_priority_set (SCHED_RR, sched_priority);
 
  908                                            "Could not set logsys thread priority." 
  909                                            " Can't continue because of priority inversions.");
 
  916                                "Could not get maximum scheduler priority");
 
  923                "The Platform is missing process priority setting features.  Leaving at default.");
 
  933static const char *corosync_basename(
const char *file_name)
 
  936        base = strrchr (file_name, 
'/');
 
  945_logsys_log_printf(
int level, 
int subsys,
 
  946                const char *function_name,
 
  947                const char *file_name,
 
  953_logsys_log_printf(
int level, 
int subsys,
 
  954                const 
char *function_name,
 
  955                const 
char *file_name,
 
  957                const 
char *format, ...)
 
  961        va_start(ap, format);
 
  962        qb_log_from_external_source_va(function_name, corosync_basename(file_name),
 
  963                                    format, level, file_line,
 
  968static void fplay_key_change_notify_fn (
 
  970        const char *key_name,
 
  975        if (strcmp(key_name, 
"runtime.blackbox.dump_flight_data") == 0) {
 
  976                fprintf(stderr,
"Writetofile\n");
 
  977                corosync_blackbox_write_to_file ();
 
  979        if (strcmp(key_name, 
"runtime.blackbox.dump_state") == 0) {
 
  980                fprintf(stderr,
"statefump\n");
 
  985static void corosync_fplay_control_init (
void)
 
  994                        fplay_key_change_notify_fn,
 
  998                        fplay_key_change_notify_fn,
 
 1002static void force_gather_notify_fn(
 
 1004        const char *key_name,
 
 1016        if (strcmp(key_name, 
"runtime.force_gather") == 0) {
 
 1025static void corosync_force_gather_init (
void)
 
 1033                        force_gather_notify_fn,
 
 1044static void set_icmap_ro_keys_flag (
void)
 
 1080static void main_service_ready (
void)
 
 1093        corosync_totem_stats_init ();
 
 1094        corosync_fplay_control_init ();
 
 1095        corosync_force_gather_init ();
 
 1098                corosync_sync_callbacks_retrieve,
 
 1099                corosync_sync_completed);
 
 1102static enum e_corosync_done corosync_flock (
const char *lockfile, pid_t pid)
 
 1111        lockfile_fd = open (lockfile, O_WRONLY | O_CREAT, 0640);
 
 1112        if (lockfile_fd == -1) {
 
 1118        lock.l_type = F_WRLCK;
 
 1120        lock.l_whence = SEEK_SET;
 
 1122        if (fcntl (lockfile_fd, F_SETLK, &
lock) == -1) {
 
 1142        if (ftruncate (lockfile_fd, 0) == -1) {
 
 1146                goto error_close_unlink;
 
 1149        memset (pid_s, 0, 
sizeof (pid_s));
 
 1150        snprintf (pid_s, 
sizeof (pid_s) - 1, 
"%u\n", pid);
 
 1153        if (write (lockfile_fd, pid_s, strlen (pid_s)) != strlen (pid_s)) {
 
 1154                if (errno == EINTR) {
 
 1158                                "Error was %s", strerror (errno));
 
 1160                        goto error_close_unlink;
 
 1164        if ((fd_flag = fcntl (lockfile_fd, F_GETFD, 0)) == -1) {
 
 1166                        "Error was %s", strerror (errno));
 
 1168                goto error_close_unlink;
 
 1170        fd_flag |= FD_CLOEXEC;
 
 1171        if (fcntl (lockfile_fd, F_SETFD, fd_flag) == -1) {
 
 1173                        "Error was %s", strerror (errno));
 
 1175                goto error_close_unlink;
 
 1183        close (lockfile_fd);
 
 1188static int corosync_move_to_root_cgroup(
void) {
 
 1191        const char *cgroup_task_fname = NULL;
 
 1200        f = fopen(
"/sys/fs/cgroup/cpu/cpu.rt_runtime_us", 
"rt");
 
 1205                f = fopen(
"/sys/fs/cgroup/cgroup.procs", 
"rt");
 
 1207                        log_printf(LOG_DEBUG, 
"cpu.rt_runtime_us or cgroup.procs doesn't exist -> " 
 1208                            "system without cgroup or with disabled CONFIG_RT_GROUP_SCHED");
 
 1215                        cgroup_task_fname = 
"/sys/fs/cgroup/cgroup.procs";
 
 1220                cgroup_task_fname = 
"/sys/fs/cgroup/cpu/tasks";
 
 1224        f = fopen(cgroup_task_fname, 
"w");
 
 1231        if (fprintf(f, 
"%jd\n", (intmax_t)getpid()) <= 0) {
 
 1234                goto close_and_exit_res;
 
 1238        if (fclose(f) != 0) {
 
 1248static void show_version_info_crypto(
void)
 
 1250        const char *error_string;
 
 1251        const char *list_str;
 
 1254                printf(
"Available crypto models: %s\n", list_str);
 
 1256                perror(error_string);
 
 1260static void show_version_info_compress(
void)
 
 1262        const char *error_string;
 
 1263        const char *list_str;
 
 1266                printf(
"Available compression models: %s\n", list_str);
 
 1268                perror(error_string);
 
 1272static void show_version_info(
void)
 
 1275        printf (
"Corosync Cluster Engine, version '%s'\n", 
VERSION);
 
 1276        printf (
"Copyright (c) 2006-2021 Red Hat, Inc.\n");
 
 1280        show_version_info_crypto();
 
 1281        show_version_info_compress();
 
 1284int main (
int argc, 
char **argv, 
char **envp)
 
 1286        const char *error_string;
 
 1289        int background, sched_rr, prio, testonly;
 
 1292        uint64_t totem_config_warnings;
 
 1297        int log_subsys_id_totem;
 
 1305        while ((ch = getopt (argc, argv, 
"c:l:ftv")) != EOF) {
 
 1309                                res = snprintf(corosync_config_file, 
sizeof(corosync_config_file), 
"%s", optarg);
 
 1310                                if (res >= 
sizeof(corosync_config_file)) {
 
 1311                                        fprintf (stderr, 
"Config file path too long.\n");
 
 1315                                        return EXIT_FAILURE;
 
 1319                                res = snprintf(corosync_lock_file, 
sizeof(corosync_lock_file), 
"%s", optarg);
 
 1320                                if (res >= 
sizeof(corosync_lock_file)) {
 
 1321                                        fprintf (stderr, 
"PID lock file path too long.\n");
 
 1325                                        return EXIT_FAILURE;
 
 1335                                show_version_info();
 
 1337                                return EXIT_SUCCESS;
 
 1343                                        "        -c     : Corosync config file path.\n"\
 
 1344                                        "        -l     : Corosync pid lock file path.\n"\
 
 1345                                        "        -f     : Start application in foreground.\n"\
 
 1346                                        "        -t     : Test configuration and exit.\n"\
 
 1347                                        "        -v     : Display version, git revision and some useful information about Corosync and exit.\n");
 
 1349                                return EXIT_FAILURE;
 
 1357        (void)signal (SIGSEGV, sigsegv_handler);
 
 1358        (void)signal (SIGABRT, sigsegv_handler);
 
 1359#if MSG_NOSIGNAL != 0 
 1360        (void)signal (SIGPIPE, SIG_IGN);
 
 1364                fprintf (stderr, 
"Corosync Executive couldn't initialize configuration component.\n");
 
 1365                syslog (
LOGSYS_LEVEL_ERROR, 
"Corosync Executive couldn't initialize configuration component.");
 
 1368        set_icmap_ro_keys_flag();
 
 1381                fprintf (stderr, 
"%s\n", error_string);
 
 1387                fprintf (stderr, 
"Corosync Executive couldn't initialize statistics component.\n");
 
 1388                syslog (
LOGSYS_LEVEL_ERROR, 
"Corosync Executive couldn't initialize statistics component.");
 
 1402                fprintf(stderr, 
"%s", error_string);
 
 1416                        "totemip.c,totemconfig.c,totemcrypto.c,totemsrp.c," 
 1417                        "totempg.c,totemudp.c,totemudpu.c,totemnet.c,totemknet.c");
 
 1441                    "Nodelist (or autogenerated) nodeid is going to be used.");
 
 1446                    "Nodelist one is going to be used.");
 
 1449        if (totem_config_warnings != 0) {
 
 1469                if (strcmp(tmp_str, 
"yes") == 0) {
 
 1471                } 
else if (strcmp(tmp_str, 
"no") == 0) {
 
 1480                if (strcmp(tmp_str, 
"yes") != 0) {
 
 1488                if (strcmp(tmp_str, 
"max") == 0) {
 
 1490                } 
else if (strcmp(tmp_str, 
"min") == 0) {
 
 1495                        tmpli = strtol(tmp_str, &ep, 10);
 
 1496                        if (errno != 0 || *ep != 
'\0' || tmpli > INT_MAX || tmpli < INT_MIN) {
 
 1512                (void)corosync_move_to_root_cgroup();
 
 1520                res = corosync_set_rr_scheduler (silent);
 
 1526                        (void)corosync_move_to_root_cgroup();
 
 1528                        res = corosync_set_rr_scheduler (0);
 
 1539                if (setpriority(PRIO_PGRP, 0, prio) != 0) {
 
 1541                                "Could not set priority %d", prio);
 
 1567                corosync_tty_detach ();
 
 1578        corosync_mlockall ();
 
 1580        corosync_poll_handle = qb_loop_create ();
 
 1586        qb_loop_signal_add(corosync_poll_handle, QB_LOOP_LOW,
 
 1587                SIGUSR2, NULL, sig_diag_handler, NULL);
 
 1588        qb_loop_signal_add(corosync_poll_handle, QB_LOOP_HIGH,
 
 1589                SIGINT, NULL, sig_exit_handler, NULL);
 
 1590        qb_loop_signal_add(corosync_poll_handle, QB_LOOP_HIGH,
 
 1591                SIGQUIT, NULL, sig_exit_handler, NULL);
 
 1592        qb_loop_signal_add(corosync_poll_handle, QB_LOOP_HIGH,
 
 1593                SIGTERM, NULL, sig_exit_handler, NULL);
 
 1600        if ((flock_err = corosync_flock (corosync_lock_file, getpid ())) != 
COROSYNC_DONE_EXIT) {
 
 1615                corosync_poll_handle,
 
 1623                main_service_ready);
 
 1626                &corosync_group_handle,
 
 1631                corosync_group_handle,
 
 1652        qb_loop_run (corosync_poll_handle);
 
 1662        qb_loop_destroy (corosync_poll_handle);
 
 1671        close (lockfile_fd);
 
 1672        unlink (corosync_lock_file);
 
 1676        return EXIT_SUCCESS;
 
 
struct corosync_api_v1 * apidef_get(void)
totem_configuration_type
The totem_configuration_type enum.
@ TOTEM_CONFIGURATION_REGULAR
@ TOTEM_CONFIGURATION_TRANSITIONAL
qb_loop_timer_handle corosync_timer_handle_t
corosync_timer_handle_t
@ CS_LIB_FLOW_CONTROL_NOT_REQUIRED
#define SERVICES_COUNT_MAX
#define MILLI_2_NANO_SECONDS
int coroparse_configparse(icmap_map_t config_map, const char **error_string)
#define CS_PRI_RING_ID_SEQ
int corosync_quorum_is_quorate(void)
#define corosync_exit_error(err)
@ COROSYNC_DONE_INIT_SERVICES
@ COROSYNC_DONE_ALREADY_RUNNING
@ COROSYNC_DONE_STORE_RINGID
@ COROSYNC_DONE_FATAL_ERR
@ COROSYNC_DONE_LOGCONFIGREAD
@ COROSYNC_DONE_STD_TO_NULL_REDIR
@ COROSYNC_DONE_MAINCONFIGREAD
@ COROSYNC_DONE_ACQUIRE_LOCK
@ COROSYNC_DONE_DIR_NOT_PRESENT
#define ICMAP_TRACK_MODIFY
cs_error_t icmap_set_ro_access(const char *key_name, int prefix, int ro_access)
Set read-only access for given key (key_name) or prefix, If prefix is set.
#define ICMAP_TRACK_DELETE
cs_error_t icmap_track_add(const char *key_name, int32_t track_type, icmap_notify_fn_t notify_fn, void *user_data, icmap_track_t *icmap_track)
Add tracking function for given key_name.
cs_error_t icmap_set_string(const char *key_name, const char *value)
cs_error_t icmap_inc(const char *key_name)
Increase stored value by one.
cs_error_t icmap_fast_inc(const char *key_name)
Increase stored value by one.
icmap_map_t icmap_get_global_map(void)
Return global icmap.
cs_error_t icmap_get(const char *key_name, void *value, size_t *value_len, icmap_value_types_t *type)
Retrieve value of key key_name and store it in user preallocated value pointer.
cs_error_t icmap_init(void)
Initialize global icmap.
#define ICMAP_KEYNAME_MAXLEN
Maximum length of key in icmap.
void icmap_fini(void)
Finalize global icmap.
cs_error_t icmap_set_uint32(const char *key_name, uint32_t value)
cs_error_t icmap_get_string(const char *key_name, char **str)
Shortcut for icmap_get for string type.
void cs_ipcs_sync_state_changed(int32_t sync_in_process)
int32_t cs_ipcs_q_level_get(void)
void cs_ipc_allow_connections(int32_t allow)
int corosync_log_config_read(cmap_handle_t cmap_h, const char *default_logfile, const char **error_string)
#define LOGSYS_LEVEL_ERROR
#define log_printf(level, format, args...)
void logsys_blackbox_prefork(void)
void logsys_system_fini(void)
logsys_system_fini
#define LOGSYS_LEVEL_INFO
#define LOGSYS_MODE_OUTPUT_STDERR
#define LOGSYS_LEVEL_NOTICE
void logsys_config_apply(void)
logsys_config_apply
#define LOGSYS_PERROR(err_num, level, fmt, args...)
The LOGSYS_PERROR macro.
int logsys_thread_start(void)
logsys_thread_start
#define LOGSYS_DECLARE_SUBSYS(subsys)
The LOGSYS_DECLARE_SUBSYS macro.
#define LOGSYS_LEVEL_WARNING
int _logsys_subsys_create(const char *subsys, const char *filename)
_logsys_subsys_create
void logsys_blackbox_postfork(void)
#define LOGSYS_LEVEL_DEBUG
#define LOGSYS_MODE_OUTPUT_SYSLOG
#define LOGSYS_LEVEL_TRACE
#define LOGSYS_DECLARE_SYSTEM(name, mode, syslog_facility, syslog_priority)
The LOGSYS_DECLARE_SYSTEM macro.
void corosync_sending_allowed_release(void *sending_allowed_private_data)
void corosync_state_dump(void)
int cs_poll_dispatch_add(qb_loop_t *handle, int fd, int events, void *data, int(*dispatch_fn)(int fd, int revents, void *data))
@ MOVE_TO_ROOT_CGROUP_MODE_ON
@ MOVE_TO_ROOT_CGROUP_MODE_OFF
@ MOVE_TO_ROOT_CGROUP_MODE_AUTO
struct sched_param global_sched_param
void message_source_set(mar_message_source_t *source, void *conn)
int main(int argc, char **argv, char **envp)
int main_mcast(const struct iovec *iovec, unsigned int iov_len, unsigned int guarantee)
qb_loop_t * cs_poll_handle_get(void)
void corosync_recheck_the_q_level(void *data)
const char * corosync_get_config_file(void)
int message_source_is_local(const mar_message_source_t *source)
int corosync_sending_allowed(unsigned int service, unsigned int id, const void *msg, void *sending_allowed_private_data)
int cs_poll_dispatch_delete(qb_loop_t *handle, int fd)
void corosync_shutdown_request(void)
void schedwrk_init(void(*serialize_lock_fn)(void), void(*serialize_unlock_fn)(void))
unsigned int corosync_service_defaults_link_and_init(struct corosync_api_v1 *corosync_api)
Load all of the default services.
void corosync_service_unlink_all(struct corosync_api_v1 *api, void(*unlink_all_complete)(void))
Unlink and exit all corosync services.
const char * service_stats_rx[SERVICES_COUNT_MAX][SERVICE_HANDLER_MAXIMUM_COUNT]
struct corosync_service_engine * corosync_service[SERVICES_COUNT_MAX]
const char * service_stats_tx[SERVICES_COUNT_MAX][SERVICE_HANDLER_MAXIMUM_COUNT]
void stats_add_schedmiss_event(uint64_t timestamp, float delay)
void stats_trigger_trackers()
cs_error_t stats_map_init(const struct corosync_api_v1 *corosync_api)
The corosync_api_v1 struct.
int(* timer_add_duration)(unsigned long long nanoseconds_in_future, void *data, void(*timer_nf)(void *data), corosync_timer_handle_t *handle)
void(* timer_delete)(corosync_timer_handle_t timer_handle)
const char *(* totem_ifaces_print)(unsigned int nodeid)
void *(* totem_get_stats)(void)
void(* exec_handler_fn)(const void *msg, unsigned int nodeid)
void(* exec_endian_convert_fn)(void *msg)
void(* sync_init)(const unsigned int *trans_list, size_t trans_list_entries, const unsigned int *member_list, size_t member_list_entries, const struct memb_ring_id *ring_id)
void(* sync_activate)(void)
void(* confchg_fn)(enum totem_configuration_type configuration_type, const unsigned int *member_list, size_t member_list_entries, const unsigned int *left_list, size_t left_list_entries, const unsigned int *joined_list, size_t joined_list_entries, const struct memb_ring_id *ring_id)
struct corosync_exec_handler * exec_engine
void(* exec_dump_fn)(void)
int(* sync_process)(void)
Structure passed as new_value and old_value in change callback.
The mar_message_source_t struct.
qb_loop_timer_handle handle
unsigned long long max_tv_diff
struct totem_config * totem_config
unsigned long long tv_prev
void(* sync_init)(const unsigned int *trans_list, size_t trans_list_entries, const unsigned int *member_list, size_t member_list_entries, const struct memb_ring_id *ring_id)
int(* sync_process)(void)
void(* sync_activate)(void)
unsigned int token_timeout
struct totem_logging_configuration totem_logging_configuration
void(* totem_memb_ring_id_create_or_load)(struct memb_ring_id *memb_ring_id, unsigned int nodeid)
void(* totem_memb_ring_id_store)(const struct memb_ring_id *memb_ring_id, unsigned int nodeid)
void(* log_printf)(int level, int subsys, const char *function_name, const char *file_name, int file_line, const char *format,...) __attribute__((format(printf
void(*) in log_level_security)
uint32_t continuous_gather
uint32_t avg_backlog_calc
uint32_t continuous_sendmsg_failures
totemsrp_token_stats_t token[TOTEM_TOKEN_STATS_MAX]
uint8_t firewall_enabled_or_nic_failure
uint32_t avg_token_workload
uint64_t time_since_token_last_received
#define swab32(x)
The swab32 macro.
int sync_init(int(*sync_callbacks_retrieve)(int service_id, struct sync_callbacks *callbacks), void(*synchronization_completed)(void))
void sync_save_transitional(const unsigned int *member_list, size_t member_list_entries, const struct memb_ring_id *ring_id)
void sync_start(const unsigned int *member_list, size_t member_list_entries, const struct memb_ring_id *ring_id)
#define MAX_NO_CONT_SENDMSG_FAILURES
#define MAX_NO_CONT_GATHER
Maximum number of continuous gather states.
int totem_config_read(struct totem_config *totem_config, const char **error_string, uint64_t *warnings)
int totem_config_validate(struct totem_config *totem_config, const char **error_string)
#define TOTEM_CONFIG_BINDNETADDR_NODELIST_SET
#define TOTEM_CONFIG_WARNING_TOTEM_NODEID_SET
#define TOTEM_CONFIG_WARNING_MEMBERS_IGNORED
#define TOTEM_CONFIG_WARNING_MEMBERS_DEPRECATED
Totem Single Ring Protocol.
unsigned int totempg_my_nodeid_get(void)
void totempg_check_q_level(void *instance)
int totempg_groups_mcast_joined(void *instance, const struct iovec *iovec, unsigned int iov_len, int guarantee)
void totempg_trans_ack(void)
void totempg_force_gather(void)
int totempg_initialize(qb_loop_t *poll_handle, struct totem_config *totem_config)
Initialize the totem process groups abstraction.
int totempg_groups_joined_release(int msg_count)
void totempg_service_ready_register(void(*totem_service_ready)(void))
int totempg_groups_joined_reserve(void *instance, const struct iovec *iovec, unsigned int iov_len)
int totempg_groups_join(void *instance, const struct totempg_group *groups, size_t group_cnt)
void totempg_finalize(void)
int totempg_groups_initialize(void **instance, void(*deliver_fn)(unsigned int nodeid, const void *msg, unsigned int msg_len, int endian_conversion_required), void(*confchg_fn)(enum totem_configuration_type configuration_type, const unsigned int *member_list, size_t member_list_entries, const unsigned int *left_list, size_t left_list_entries, const unsigned int *joined_list, size_t joined_list_entries, const struct memb_ring_id *ring_id))
Initialize a groups instance.
struct memb_ring_id ring_id
struct totem_message_header header
Totem Single Ring Protocol.
#define TOTEM_TOKEN_STATS_MAX
int util_is_valid_knet_crypto_model(const char *val, const char **list_str, int machine_parseable_str, const char *error_string_prefix, const char **error_string)
const char * get_state_dir(void)
int util_is_valid_knet_compress_model(const char *val, const char **list_str, int machine_parseable_str, const char *error_string_prefix, const char **error_string)