This source file includes following definitions.
- pcmk__is_bundle
- pcmk__is_bundled
- pcmk__is_bundle_node
1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__CRM_COMMON_BUNDLES_INTERNAL__H
11 #define PCMK__CRM_COMMON_BUNDLES_INTERNAL__H
12
13 #include <stdbool.h>
14
15 #include <crm/common/remote_internal.h>
16 #include <crm/common/resources.h>
17 #include <crm/common/scheduler_types.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23
24 typedef struct {
25 int offset;
26 char *ipaddr;
27 pcmk_node_t *node;
28 pcmk_resource_t *ip;
29 pcmk_resource_t *child;
30 pcmk_resource_t *container;
31 pcmk_resource_t *remote;
32 } pcmk__bundle_replica_t;
33
34
35
36
37
38
39
40
41
42
43
44 static inline bool
45 pcmk__is_bundle(const pcmk_resource_t *rsc)
46 {
47 return (rsc != NULL) && (rsc->variant == pcmk_rsc_variant_bundle);
48 }
49
50
51
52
53
54
55
56
57
58 static inline bool
59 pcmk__is_bundled(const pcmk_resource_t *rsc)
60 {
61 if (rsc == NULL) {
62 return false;
63 }
64 while (rsc->parent != NULL) {
65 rsc = rsc->parent;
66 }
67 return rsc->variant == pcmk_rsc_variant_bundle;
68 }
69
70
71
72
73
74
75
76
77
78 static inline bool
79 pcmk__is_bundle_node(const pcmk_node_t *node)
80 {
81 return pcmk__is_guest_or_bundle_node(node)
82 && pcmk__is_bundled(node->details->remote_rsc);
83 }
84
85 #ifdef __cplusplus
86 }
87 #endif
88
89 #endif