pacemaker  1.1.12-561c4cf
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
common.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 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 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 PE_COMMON__H
19 # define PE_COMMON__H
20 # include <glib.h>
21 
22 extern gboolean was_processing_error;
23 extern gboolean was_processing_warning;
24 
25 /* order is significant here
26  * items listed in order of accending severeness
27  * more severe actions take precedent over lower ones
28  */
32  action_fail_migrate, /* recover by moving it somewhere else */
38 };
39 
40 /* the "done" action must be the "pre" action +1 */
56 };
57 
62 };
63 
65  rsc_req_nothing, /* Allowed by custom_action() */
66  rsc_req_quorum, /* Enforced by custom_action() */
67  rsc_req_stonith /* Enforced by native_start_constraints() */
68 };
69 
70 enum rsc_role_e {
76 };
77 
78 # define RSC_ROLE_MAX RSC_ROLE_MASTER+1
79 
80 # define RSC_ROLE_UNKNOWN_S "Unknown"
81 # define RSC_ROLE_STOPPED_S "Stopped"
82 # define RSC_ROLE_STARTED_S "Started"
83 # define RSC_ROLE_SLAVE_S "Slave"
84 # define RSC_ROLE_MASTER_S "Master"
85 
86 /* *INDENT-OFF* */
88 
89  pe_print_log = 0x0001,
90  pe_print_html = 0x0002,
91  pe_print_ncurses = 0x0004,
92  pe_print_printf = 0x0008,
93  pe_print_dev = 0x0010,
94  pe_print_details = 0x0020,
96  pe_print_rsconly = 0x0080,
97  pe_print_ops = 0x0100,
99  pe_print_xml = 0x0400,
100  pe_print_brief = 0x0800,
103 };
104 /* *INDENT-ON* */
105 
106 const char *task2text(enum action_tasks task);
107 enum action_tasks text2task(const char *task);
108 enum rsc_role_e text2role(const char *role);
109 const char *role2text(enum rsc_role_e role);
110 const char *fail2text(enum action_fail_response fail);
111 
112 const char *pe_pref(GHashTable * options, const char *name);
113 void calculate_active_ops(GList * sorted_op_list, int *start_index, int *stop_index);
114 
115 static inline const char *
116 recovery2text(enum rsc_recovery_type type)
117 {
118  switch (type) {
119  case recovery_stop_only:
120  return "shutting it down";
121  case recovery_stop_start:
122  return "attempting recovery";
123  case recovery_block:
124  return "waiting for an administrator";
125  }
126  return "Unknown";
127 }
128 
129 #endif
const char * task2text(enum action_tasks task)
enum action_tasks text2task(const char *task)
const char * pe_pref(GHashTable *options, const char *name)
action_fail_response
Definition: common.h:29
const char * role2text(enum rsc_role_e role)
rsc_recovery_type
Definition: common.h:58
void calculate_active_ops(GList *sorted_op_list, int *start_index, int *stop_index)
rsc_start_requirement
Definition: common.h:64
pe_print_options
Definition: common.h:87
enum rsc_role_e text2role(const char *role)
const char * fail2text(enum action_fail_response fail)
rsc_role_e
Definition: common.h:70
gboolean was_processing_error
gboolean was_processing_warning
action_tasks
Definition: common.h:41
enum crm_ais_msg_types type
Definition: internal.h:51