pacemaker  1.1.16-94ff4df
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
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 
19 #include <crm/crm.h>
20 #include <crm/msg_xml.h>
21 #include <crm/common/xml.h>
22 
23 typedef enum {
28 
30 
31 typedef struct synapse_s {
32  int id;
33  int priority;
34 
35  gboolean ready;
36  gboolean failed;
37  gboolean executed;
38  gboolean confirmed;
39 
40  GListPtr actions; /* crm_action_t* */
41  GListPtr inputs; /* crm_action_t* */
42 } synapse_t;
43 
44 typedef struct crm_action_s {
45  int id;
46  int timeout;
47  int interval;
48  GHashTable *params;
50 
53 
54  gboolean sent_update; /* sent to the CIB */
55  gboolean executed; /* sent to the CRM */
56  gboolean confirmed;
57 
58  gboolean failed;
59  gboolean can_fail;
60 
61  xmlNode *xml;
62 
63 } crm_action_t;
64 
69 };
70 
71 struct te_timer_s {
72  int source_id;
73  int timeout;
76 };
77 
78 /* order matters here */
84 };
85 
86 typedef struct crm_graph_s {
87  int id;
88  char *source;
90 
91  gboolean complete;
92  const char *abort_reason;
94 
97 
102 
103  int fired;
104  int pending;
105  int skipped;
108 
109  GListPtr synapses; /* synpase_t* */
110 
112 
113 } crm_graph_t;
114 
115 typedef struct crm_graph_functions_s {
116  gboolean(*pseudo) (crm_graph_t * graph, crm_action_t * action);
117  gboolean(*rsc) (crm_graph_t * graph, crm_action_t * action);
118  gboolean(*crmd) (crm_graph_t * graph, crm_action_t * action);
119  gboolean(*stonith) (crm_graph_t * graph, crm_action_t * action);
120  gboolean(*allowed) (crm_graph_t * graph, crm_action_t * action);
122 
125  transition_pending, /* active but no actions performed this time */
131 };
132 
133 void set_default_graph_functions(void);
135 crm_graph_t *unpack_graph(xmlNode * xml_graph, const char *reference);
136 int run_graph(crm_graph_t * graph);
137 gboolean update_graph(crm_graph_t * graph, crm_action_t * action);
138 void destroy_graph(crm_graph_t * graph);
139 const char *transition_status(enum transition_status state);
140 void print_graph(unsigned int log_level, crm_graph_t * graph);
141 void print_action(int log_level, const char *prefix, crm_action_t * action);
142 bool update_abort_priority(crm_graph_t * graph, int priority,
143  enum transition_action action, const char *abort_reason);
144 const char *actiontype2text(action_type_e type);
145 lrmd_event_data_t *convert_graph_action(xmlNode * resource, crm_action_t * action, int status,
146  int rc);
gboolean(* pseudo)(crm_graph_t *graph, crm_action_t *action)
Definition: transition.h:116
GListPtr actions
Definition: transition.h:40
gboolean sent_update
Definition: transition.h:54
gboolean confirmed
Definition: transition.h:38
A dumping ground.
action_type_e type
Definition: transition.h:49
bool update_abort_priority(crm_graph_t *graph, int priority, enum transition_action action, const char *abort_reason)
Definition: utils.c:263
enum transition_action completion_action
Definition: transition.h:93
xmlNode * xml
Definition: transition.h:61
void destroy_graph(crm_graph_t *graph)
Definition: unpack.c:276
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:293
struct synapse_s synapse_t
gboolean can_fail
Definition: transition.h:59
gboolean(* rsc)(crm_graph_t *graph, crm_action_t *action)
Definition: transition.h:117
const char * actiontype2text(action_type_e type)
Definition: utils.c:105
void set_graph_functions(crm_graph_functions_t *fns)
Definition: utils.c:70
struct crm_graph_s crm_graph_t
int num_synapses
Definition: transition.h:96
transition_action
Definition: transition.h:79
gboolean(* allowed)(crm_graph_t *graph, crm_action_t *action)
Definition: transition.h:120
GHashTable * params
Definition: transition.h:48
crm_action_timer_t * timer
Definition: transition.h:51
gboolean ready
Definition: transition.h:35
int transition_timeout
Definition: transition.h:101
int incomplete
Definition: transition.h:107
int priority
Definition: transition.h:33
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:55
Wrappers for and extensions to libxml2.
timer_reason
Definition: transition.h:65
gboolean(* crmd)(crm_graph_t *graph, crm_action_t *action)
Definition: transition.h:118
transition_status
Definition: transition.h:123
GListPtr synapses
Definition: transition.h:109
gboolean complete
Definition: transition.h:91
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:100
enum timer_reason reason
Definition: transition.h:74
int batch_limit
Definition: transition.h:98
GListPtr inputs
Definition: transition.h:41
gboolean failed
Definition: transition.h:36
crm_graph_t * unpack_graph(xmlNode *xml_graph, const char *reference)
Definition: unpack.c:168
char * source
Definition: transition.h:88
int network_delay
Definition: transition.h:99
int num_actions
Definition: transition.h:95
gboolean failed
Definition: transition.h:58
int migration_limit
Definition: transition.h:111
gboolean(* stonith)(crm_graph_t *graph, crm_action_t *action)
Definition: transition.h:119
int run_graph(crm_graph_t *graph)
Definition: graph.c:247
int timeout
Definition: transition.h:73
int abort_priority
Definition: transition.h:89
struct crm_graph_functions_s crm_graph_functions_t
int source_id
Definition: transition.h:72
gboolean confirmed
Definition: transition.h:56
crm_action_t * action
Definition: transition.h:75
action_type_e
Definition: transition.h:23
GList * GListPtr
Definition: crm.h:198
gboolean executed
Definition: transition.h:37
synapse_t * synapse
Definition: transition.h:52
const char * abort_reason
Definition: transition.h:92
enum crm_ais_msg_types type
Definition: internal.h:51