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 <stdio.h>
14 #include <stdbool.h>
15
16 #include <crm/common/nodes_internal.h>
17 #include <crm/common/remote_internal.h>
18 #include <crm/common/resources_internal.h>
19 #include <crm/common/scheduler_types.h>
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25
26 typedef struct {
27 int offset;
28 char *ipaddr;
29 pcmk_node_t *node;
30 pcmk_resource_t *ip;
31 pcmk_resource_t *child;
32 pcmk_resource_t *container;
33 pcmk_resource_t *remote;
34 } pcmk__bundle_replica_t;
35
36
37
38
39
40
41
42
43
44
45
46 static inline bool
47 pcmk__is_bundle(const pcmk_resource_t *rsc)
48 {
49 return (rsc != NULL) && (rsc->priv->variant == pcmk__rsc_variant_bundle);
50 }
51
52
53
54
55
56
57
58
59
60 static inline bool
61 pcmk__is_bundled(const pcmk_resource_t *rsc)
62 {
63 if (rsc == NULL) {
64 return false;
65 }
66 while (rsc->priv->parent != NULL) {
67 rsc = rsc->priv->parent;
68 }
69 return rsc->priv->variant == pcmk__rsc_variant_bundle;
70 }
71
72
73
74
75
76
77
78
79
80 static inline bool
81 pcmk__is_bundle_node(const pcmk_node_t *node)
82 {
83 return pcmk__is_guest_or_bundle_node(node)
84 && pcmk__is_bundled(node->priv->remote);
85 }
86
87 #ifdef __cplusplus
88 }
89 #endif
90
91 #endif