pacemaker  1.1.18-36d2962a86
Scalable High-Availability cluster resource manager
transition.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This software is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 #ifndef CRM_TRANSITION__H
19 # define CRM_TRANSITION__H
20 
21 #include <crm/crm.h>
22 #include <crm/msg_xml.h>
23 #include <crm/common/xml.h>
24 
25 typedef enum {
30 
32 typedef struct crm_graph_s crm_graph_t;
33 
34 typedef struct synapse_s {
35  int id;
36  int priority;
37 
38  gboolean ready;
39  gboolean failed;
40  gboolean executed;
41  gboolean confirmed;
42 
43  GListPtr actions; /* crm_action_t* */
44  GListPtr inputs; /* crm_action_t* */
45 
47 } synapse_t;
48 
49 typedef struct crm_action_s {
50  int id;
51  int timeout;
52  int interval;
53  GHashTable *params;
55 
58 
59  gboolean sent_update; /* sent to the CIB */
60  gboolean executed; /* sent to the CRM */
61  gboolean confirmed;
62 
63  gboolean failed;
64  gboolean can_fail;
65 
66  xmlNode *xml;
67 
68  char *task;
69 
71 
72 } crm_action_t;
73 
74 /* @COMPAT: This enum has deprecated. It has apparently never been used in a
75  * Pacemaker release, but it is kept for API backward compatibility.
76  */
81 };
82 
83 struct te_timer_s {
84  int source_id;
85  int timeout;
86  enum timer_reason reason; /* @COMPAT: unused, API backward compatibility */
88 };
89 
90 /* order matters here */
96 };
97 
98 struct crm_graph_s {
99  int id;
100  char *source;
102 
103  gboolean complete;
104  const char *abort_reason;
105  enum transition_action completion_action;
106 
109 
114 
115  int fired;
116  int pending;
117  int skipped;
120 
121  GListPtr synapses; /* synpase_t* */
122 
124 
126 
127 };
128 
129 typedef struct crm_graph_functions_s {
130  gboolean(*pseudo) (crm_graph_t * graph, crm_action_t * action);
131  gboolean(*rsc) (crm_graph_t * graph, crm_action_t * action);
132  gboolean(*crmd) (crm_graph_t * graph, crm_action_t * action);
133  gboolean(*stonith) (crm_graph_t * graph, crm_action_t * action);
134  gboolean(*allowed) (crm_graph_t * graph, crm_action_t * action);
136 
139  transition_pending, /* active but no actions performed this time */
145 };
146 
147 void set_default_graph_functions(void);
149 crm_graph_t *unpack_graph(xmlNode * xml_graph, const char *reference);
151 gboolean update_graph(crm_graph_t * graph, crm_action_t * action);
153 const char *transition_status(enum transition_status state);
154 void print_graph(unsigned int log_level, crm_graph_t * graph);
155 void print_action(int log_level, const char *prefix, crm_action_t * action);
157  enum transition_action action, const char *abort_reason);
158 const char *actiontype2text(action_type_e type);
159 lrmd_event_data_t *convert_graph_action(xmlNode * resource, crm_action_t * action, int status,
160  int rc);
161 
162 #endif
GListPtr actions
Definition: transition.h:43
gboolean sent_update
Definition: transition.h:59
gboolean confirmed
Definition: transition.h:41
A dumping ground.
action_type_e type
Definition: transition.h:54
bool update_abort_priority(crm_graph_t *graph, int priority, enum transition_action action, const char *abort_reason)
Definition: utils.c:263
lrmd_rsc_info_t * rsc_info
Definition: transition.h:70
xmlNode * xml
Definition: transition.h:66
void destroy_graph(crm_graph_t *graph)
Definition: unpack.c:308
void print_action(int log_level, const char *prefix, crm_action_t *action)
Definition: utils.c:217
lrmd_event_data_t * convert_graph_action(xmlNode *resource, crm_action_t *action, int status, int rc)
Definition: unpack.c:325
struct synapse_s synapse_t
gboolean can_fail
Definition: transition.h:64
const char * actiontype2text(action_type_e type)
Definition: utils.c:105
void set_graph_functions(crm_graph_functions_t *fns)
Definition: utils.c:70
int num_synapses
Definition: transition.h:108
transition_action
Definition: transition.h:91
GHashTable * params
Definition: transition.h:53
crm_action_timer_t * timer
Definition: transition.h:56
gboolean ready
Definition: transition.h:38
int transition_timeout
Definition: transition.h:113
crm_graph_t * graph
Definition: transition.h:46
int incomplete
Definition: transition.h:119
int priority
Definition: transition.h:36
char * task
Definition: transition.h:68
void set_default_graph_functions(void)
Definition: utils.c:64
void print_graph(unsigned int log_level, crm_graph_t *graph)
Definition: utils.c:223
gboolean executed
Definition: transition.h:60
Wrappers for and extensions to libxml2.
timer_reason
Definition: transition.h:77
transition_status
Definition: transition.h:137
GListPtr synapses
Definition: transition.h:121
gboolean complete
Definition: transition.h:103
gboolean update_graph(crm_graph_t *graph, crm_action_t *action)
Definition: graph.c:102
struct crm_action_s crm_action_t
int stonith_timeout
Definition: transition.h:112
int batch_limit
Definition: transition.h:110
GListPtr inputs
Definition: transition.h:44
gboolean failed
Definition: transition.h:39
crm_graph_t * unpack_graph(xmlNode *xml_graph, const char *reference)
Definition: unpack.c:197
char * source
Definition: transition.h:100
int network_delay
Definition: transition.h:111
int num_actions
Definition: transition.h:107
gboolean failed
Definition: transition.h:63
int migration_limit
Definition: transition.h:123
int run_graph(crm_graph_t *graph)
Definition: graph.c:247
int timeout
Definition: transition.h:85
int abort_priority
Definition: transition.h:101
struct crm_graph_functions_s crm_graph_functions_t
int source_id
Definition: transition.h:84
int max_action_id
Definition: transition.h:125
gboolean confirmed
Definition: transition.h:61
crm_action_t * action
Definition: transition.h:87
action_type_e
Definition: transition.h:25
GList * GListPtr
Definition: crm.h:218
gboolean executed
Definition: transition.h:40
synapse_t * synapse
Definition: transition.h:57
const char * abort_reason
Definition: transition.h:104
enum crm_ais_msg_types type
Definition: internal.h:51