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_COMPAT__H
11 #define PCMK__CRM_PENGINE_STATUS_COMPAT__H
12
13 #include <stdbool.h>
14 #include <crm/common/util.h>
15 #include <crm/common/scheduler.h>
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21
22
23
24
25
26
27
28
29
30
31
32 pcmk_node_t *pe_find_node(const GList *node_list, const char *node_name);
33
34
35 static inline bool
36 pe_rsc_is_clone(const pcmk_resource_t *rsc)
37 {
38 return (rsc != NULL) && (rsc->variant == pcmk_rsc_variant_clone);
39 }
40
41
42 static inline bool
43 pe_rsc_is_unique_clone(const pcmk_resource_t *rsc)
44 {
45 return pe_rsc_is_clone(rsc) && pcmk_is_set(rsc->flags, pcmk_rsc_unique);
46 }
47
48
49 static inline bool
50 pe_rsc_is_anon_clone(const pcmk_resource_t *rsc)
51 {
52 return pe_rsc_is_clone(rsc) && !pcmk_is_set(rsc->flags, pcmk_rsc_unique);
53 }
54
55
56 static inline bool
57 pe_rsc_is_bundled(const pcmk_resource_t *rsc)
58 {
59 if (rsc == NULL) {
60 return false;
61 }
62 while (rsc->parent != NULL) {
63 rsc = rsc->parent;
64 }
65 return rsc->variant == pcmk_rsc_variant_bundle;
66 }
67
68 #ifdef __cplusplus
69 }
70 #endif
71
72 #endif