-
Notifications
You must be signed in to change notification settings - Fork 0
/
resgroup.h
118 lines (103 loc) · 3.33 KB
/
resgroup.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#ifndef __RESGROUP_H
#define __RESGROUP_H
#include <pthread.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
/* Requests */
#define RG_SUCCESS 0
#define RG_FAIL 1
#define RG_START 2
#define RG_STOP 3
#define RG_STATUS 4
#define RG_DISABLE 5
#define RG_STOP_RECOVER 6
#define RG_START_RECOVER 7
#define RG_RESTART 8
#define RG_EXITING 9
#define RG_INIT 10
#define RG_ENABLE 11
#define RG_STATUS_NODE 12
#define RG_RELOCATE 13
#define RG_CONDSTOP 14
#define RG_CONDSTART 15
#define RG_START_REMOTE 16 /* Part of a relocate */
#define RG_STOP_USER 17 /* User-stop request */
#define RG_STOP_EXITING 18 /* Exiting. */
#define RG_LOCK 19
#define RG_UNLOCK 20
#define RG_QUERY_LOCK 21
#define RG_MIGRATE 22
#define RG_FREEZE 23
#define RG_UNFREEZE 24
#define RG_STATUS_INQUIRY 25
#define RG_CONVALESCE 26
#define RG_NONE 999
/* Resource group states (for now) */
#define RG_STATE_BASE 110
#define RG_STATE_STOPPED 110 /** Resource group is stopped */
#define RG_STATE_STARTING 111 /** Resource is starting */
#define RG_STATE_STARTED 112 /** Resource is started */
#define RG_STATE_STOPPING 113 /** Resource is stopping */
#define RG_STATE_FAILED 114 /** Resource has failed */
#define RG_STATE_UNINITIALIZED 115 /** Thread not running yet */
#define RG_STATE_CHECK 116 /** Checking status */
#define RG_STATE_ERROR 117 /** Recoverable error */
#define RG_STATE_RECOVER 118 /** Pending recovery */
#define RG_STATE_DISABLED 119 /** Resource not allowd to run */
#define RG_STATE_MIGRATE 120 /** Resource migrating */
#define DEFAULT_CHECK_INTERVAL 10
/* Resource group flags (for now) */
#define RG_FLAG_FROZEN (1<<0) /** Resource frozen */
#define RG_FLAG_PARTIAL (1<<1) /** One or more non-critical
resources offline */
/* Return codes */
#define RG_EEXCL -16 /* Service not runnable due to
the fact that it is tagged
exclusive and there are no
empty nodes. */
#define RG_EDOMAIN -15 /* Service not runnable given the
set of nodes and its failover
domain */
#define RG_ESCRIPT -14 /* S/Lang script failed */
#define RG_EFENCE -13 /* Fencing operation pending */
#define RG_ENODE -12 /* Node is dead/nonexistent */
#define RG_EFROZEN -11 /* Forward compat. with -HEAD */
#define RG_ERUN -10 /* Service is already running */
#define RG_EQUORUM -9 /* Operation requires quorum */
#define RG_EINVAL -8 /* Invalid operation for resource */
#define RG_EDEPEND -7 /* Operation violates dependency */
#define RG_EAGAIN -6 /* Try again */
#define RG_EDEADLCK -5 /* Aborted - would deadlock */
#define RG_ENOSERVICE -4 /* Service does not exist */
#define RG_EFORWARD -3 /* Service not mastered locally */
#define RG_EABORT -2 /* Abort; service unrecoverable */
#define RG_EFAIL -1 /* Generic failure */
#define RG_ESUCCESS 0
#define RG_YES 1
#define RG_NO 2
const char *rg_strerror(int val);
/*
* Fail-over domain states
*/
#define FOD_ILLEGAL 0
#define FOD_GOOD 1
#define FOD_BETTER 2
#define FOD_BEST 3
/*
Fail-over domain flags
*/
#define FOD_ORDERED (1<<0)
#define FOD_RESTRICTED (1<<1)
#define FOD_NOFAILBACK (1<<2)
/*
Status tree flags
*/
#define SFL_FAILURE (1<<0)
#define SFL_RECOVERABLE (1<<1)
#define SFL_PARTIAL (1<<2)
#endif