pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
internal.h File Reference
#include <unistd.h>
#include <stdbool.h>
#include <stdint.h>
#include <inttypes.h>
#include <glib.h>
#include <libxml/tree.h>
#include <crm/common/logging.h>
#include <crm/common/mainloop.h>
#include <crm/common/strings.h>
#include <crm/common/actions_internal.h>
#include <crm/common/digest_internal.h>
#include <crm/common/health_internal.h>
#include <crm/common/io_internal.h>
#include <crm/common/iso8601_internal.h>
#include <crm/common/results_internal.h>
#include <crm/common/messages_internal.h>
#include <crm/common/nvpair_internal.h>
#include <crm/common/scores_internal.h>
#include <crm/common/strings_internal.h>
#include <crm/common/acl_internal.h>
Include dependency graph for internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PCMK__NELEM(a)
 
#define pcmk__assert_alloc(nmemb, size)
 
#define PCMK__FAIL_COUNT_PREFIX   "fail-count"
 
#define PCMK__LAST_FAILURE_PREFIX   "last-failure"
 

Functions

int pcmk__add_mainloop_ipc (crm_ipc_t *ipc, int priority, void *userdata, const struct ipc_client_callbacks *callbacks, mainloop_io_t **source)
 Connect to IPC and add it as a main loop source.
 
guint pcmk__mainloop_timer_get_period (const mainloop_timer_t *timer)
 Get period for mainloop timer.
 
int pcmk__scan_nvpair (const gchar *input, gchar **name, gchar **value)
 
char * pcmk__format_nvpair (const char *name, const char *value, const char *units)
 
pid_t pcmk__procfs_pid_of (const char *name)
 
unsigned int pcmk__procfs_num_cores (void)
 
int pcmk__procfs_pid2path (pid_t pid, char path[], size_t path_size)
 
bool pcmk__procfs_has_pids (void)
 
DIR * pcmk__procfs_fd_dir (void)
 
void pcmk__sysrq_trigger (char t)
 
bool pcmk__throttle_cib_load (const char *server, float *load)
 
bool pcmk__throttle_load_avg (float *load)
 
int pcmk__pid_active (pid_t pid, const char *daemon)
 
int pcmk__read_pidfile (const char *filename, pid_t *pid)
 
int pcmk__pidfile_matches (const char *filename, pid_t expected_pid, const char *expected_name, pid_t *pid)
 
int pcmk__lock_pidfile (const char *filename, const char *name)
 
void pcmk__daemonize (const char *name, const char *pidfile)
 
void pcmk__panic (const char *reason)
 
pid_t pcmk__locate_sbd (void)
 
void pcmk__sleep_ms (unsigned int ms)
 
guint pcmk__create_timer (guint interval_ms, GSourceFunc fn, gpointer data)
 
guint pcmk__timeout_ms2s (guint timeout_ms)
 
int pcmk__effective_rc (int rc)
 

Variables

bool pcmk__is_daemon
 
int pcmk__score_red
 
int pcmk__score_green
 
int pcmk__score_yellow
 

Macro Definition Documentation

◆ pcmk__assert_alloc

#define pcmk__assert_alloc ( nmemb,
size )
Value:
pcmk__assert_alloc_as(__FILE__, __func__, __LINE__, nmemb, size)
uint32_t size
Definition cpg.c:4

Definition at line 246 of file internal.h.

◆ PCMK__FAIL_COUNT_PREFIX

#define PCMK__FAIL_COUNT_PREFIX   "fail-count"

Definition at line 299 of file internal.h.

◆ PCMK__LAST_FAILURE_PREFIX

#define PCMK__LAST_FAILURE_PREFIX   "last-failure"

Definition at line 300 of file internal.h.

◆ PCMK__NELEM

#define PCMK__NELEM ( a)
Value:
((int) (sizeof(a)/sizeof(a[0])) )

Definition at line 50 of file internal.h.

Function Documentation

◆ pcmk__add_mainloop_ipc()

int pcmk__add_mainloop_ipc ( crm_ipc_t * ipc,
int priority,
void * userdata,
const struct ipc_client_callbacks * callbacks,
mainloop_io_t ** source )

Connect to IPC and add it as a main loop source.

Parameters
[in,out]ipcIPC connection to add
[in]priorityEvent source priority to use for connection
[in]userdataData to register with callbacks
[in]callbacksDispatch and destroy callbacks for connection
[out]sourceNewly allocated event source
Returns
Standard Pacemaker return code
Note
On failure, the caller is still responsible for ipc. On success, the caller should call mainloop_del_ipc_client() when source is no longer needed, which will lead to the disconnection of the IPC later in the main loop if it is connected. However the IPC disconnects, mainloop_gio_destroy() will free ipc and source after calling the destroy callback.

Definition at line 867 of file mainloop.c.

◆ pcmk__create_timer()

guint pcmk__create_timer ( guint interval_ms,
GSourceFunc fn,
gpointer data )

Definition at line 405 of file utils.c.

◆ pcmk__daemonize()

void pcmk__daemonize ( const char * name,
const char * pidfile )

Definition at line 288 of file utils.c.

◆ pcmk__effective_rc()

int pcmk__effective_rc ( int rc)

Definition at line 63 of file agents.c.

◆ pcmk__format_nvpair()

char * pcmk__format_nvpair ( const char * name,
const char * value,
const char * units )

Definition at line 176 of file nvpair.c.

◆ pcmk__locate_sbd()

pid_t pcmk__locate_sbd ( void )

Definition at line 164 of file watchdog.c.

◆ pcmk__lock_pidfile()

int pcmk__lock_pidfile ( const char * filename,
const char * name )

Definition at line 210 of file pid.c.

◆ pcmk__mainloop_timer_get_period()

guint pcmk__mainloop_timer_get_period ( const mainloop_timer_t * timer)

Get period for mainloop timer.

Parameters
[in]timerTimer
Returns
Period in ms

Definition at line 913 of file mainloop.c.

◆ pcmk__panic()

void pcmk__panic ( const char * reason)

Definition at line 146 of file watchdog.c.

◆ pcmk__pid_active()

int pcmk__pid_active ( pid_t pid,
const char * daemon )

Definition at line 19 of file pid.c.

◆ pcmk__pidfile_matches()

int pcmk__pidfile_matches ( const char * filename,
pid_t expected_pid,
const char * expected_name,
pid_t * pid )

Definition at line 168 of file pid.c.

◆ pcmk__procfs_fd_dir()

DIR * pcmk__procfs_fd_dir ( void )

Definition at line 259 of file procfs.c.

◆ pcmk__procfs_has_pids()

bool pcmk__procfs_has_pids ( void )

Definition at line 235 of file procfs.c.

◆ pcmk__procfs_num_cores()

unsigned int pcmk__procfs_num_cores ( void )

Definition at line 165 of file procfs.c.

◆ pcmk__procfs_pid2path()

int pcmk__procfs_pid2path ( pid_t pid,
char path[],
size_t path_size )

Definition at line 203 of file procfs.c.

◆ pcmk__procfs_pid_of()

pid_t pcmk__procfs_pid_of ( const char * name)

Definition at line 127 of file procfs.c.

◆ pcmk__read_pidfile()

int pcmk__read_pidfile ( const char * filename,
pid_t * pid )

Definition at line 107 of file pid.c.

◆ pcmk__scan_nvpair()

int pcmk__scan_nvpair ( const gchar * input,
gchar ** name,
gchar ** value )

Definition at line 126 of file nvpair.c.

◆ pcmk__sleep_ms()

void pcmk__sleep_ms ( unsigned int ms)

Definition at line 359 of file utils.c.

◆ pcmk__sysrq_trigger()

void pcmk__sysrq_trigger ( char t)

Definition at line 282 of file procfs.c.

◆ pcmk__throttle_cib_load()

bool pcmk__throttle_cib_load ( const char * server,
float * load )

Definition at line 298 of file procfs.c.

◆ pcmk__throttle_load_avg()

bool pcmk__throttle_load_avg ( float * load)

Definition at line 431 of file procfs.c.

◆ pcmk__timeout_ms2s()

guint pcmk__timeout_ms2s ( guint timeout_ms)

Definition at line 429 of file utils.c.

Variable Documentation

◆ pcmk__is_daemon

bool pcmk__is_daemon
extern

Definition at line 47 of file logging.c.

◆ pcmk__score_green

int pcmk__score_green
extern

Definition at line 17 of file scores.c.

◆ pcmk__score_red

int pcmk__score_red
extern

Definition at line 16 of file scores.c.

◆ pcmk__score_yellow

int pcmk__score_yellow
extern

Definition at line 18 of file scores.c.