This source file includes following definitions.
- pe_rsc_is_clone
- pe_rsc_is_unique_clone
- pe_rsc_is_anon_clone
- pe_rsc_is_bundled
1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__CRM_PENGINE_STATUS__H
11 # define PCMK__CRM_PENGINE_STATUS__H
12
13 # include <glib.h>
14 # include <stdbool.h>
15 # include <crm/common/util.h>
16 # include <crm/common/iso8601.h>
17 # include <crm/pengine/common.h>
18 # include <crm/pengine/pe_types.h>
19 # include <crm/pengine/complex.h>
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25
26
27
28
29
30
31 const char *rsc_printable_id(const pcmk_resource_t *rsc);
32 gboolean cluster_status(pcmk_scheduler_t *scheduler);
33 pcmk_scheduler_t *pe_new_working_set(void);
34 void pe_free_working_set(pcmk_scheduler_t *scheduler);
35 void set_working_set_defaults(pcmk_scheduler_t *scheduler);
36 void cleanup_calculations(pcmk_scheduler_t *scheduler);
37 void pe_reset_working_set(pcmk_scheduler_t *scheduler);
38 pcmk_resource_t *pe_find_resource(GList *rsc_list, const char *id_rh);
39 pcmk_resource_t *pe_find_resource_with_flags(GList *rsc_list, const char *id,
40 enum pe_find flags);
41 pcmk_node_t *pe_find_node(const GList *node_list, const char *node_name);
42 pcmk_node_t *pe_find_node_id(const GList *node_list, const char *id);
43 pcmk_node_t *pe_find_node_any(const GList *node_list, const char *id,
44 const char *node_name);
45 GList *find_operations(const char *rsc, const char *node, gboolean active_filter,
46 pcmk_scheduler_t *scheduler);
47 void calculate_active_ops(const GList *sorted_op_list, int *start_index,
48 int *stop_index);
49 int pe_bundle_replicas(const pcmk_resource_t *rsc);
50
51
52
53
54
55
56
57
58 static inline bool
59 pe_rsc_is_clone(const pcmk_resource_t *rsc)
60 {
61 return (rsc != NULL) && (rsc->variant == pcmk_rsc_variant_clone);
62 }
63
64
65
66
67
68
69
70
71 static inline bool
72 pe_rsc_is_unique_clone(const pcmk_resource_t *rsc)
73 {
74 return pe_rsc_is_clone(rsc) && pcmk_is_set(rsc->flags, pcmk_rsc_unique);
75 }
76
77
78
79
80
81
82
83
84 static inline bool
85 pe_rsc_is_anon_clone(const pcmk_resource_t *rsc)
86 {
87 return pe_rsc_is_clone(rsc) && !pcmk_is_set(rsc->flags, pcmk_rsc_unique);
88 }
89
90
91
92
93
94
95
96
97 static inline bool
98 pe_rsc_is_bundled(const pcmk_resource_t *rsc)
99 {
100 if (rsc == NULL) {
101 return false;
102 }
103 while (rsc->parent != NULL) {
104 rsc = rsc->parent;
105 }
106 return rsc->variant == pcmk_rsc_variant_bundle;
107 }
108
109 #ifdef __cplusplus
110 }
111 #endif
112
113 #endif