pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
bundles_internal.h
Go to the documentation of this file.
1/*
2 * Copyright 2017-2024 the Pacemaker project contributors
3 *
4 * The version control history for this file may have further details.
5 *
6 * This source code is licensed under the GNU Lesser General Public License
7 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8 */
9
10#ifndef PCMK__CRM_COMMON_BUNDLES_INTERNAL__H
11#define PCMK__CRM_COMMON_BUNDLES_INTERNAL__H
12
13#include <stdio.h> // NULL
14#include <stdbool.h> // bool, false
15
16#include <crm/common/nodes_internal.h> // struct pcmk__node_private
17#include <crm/common/remote_internal.h> // pcmk__is_guest_or_bundle_node()
18#include <crm/common/resources_internal.h> // pcmk__rsc_variant_bundle etc.
19#include <crm/common/scheduler_types.h> // pcmk_resource_t, pcmk_node_t
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
35
46static inline bool
47pcmk__is_bundle(const pcmk_resource_t *rsc)
48{
49 return (rsc != NULL) && (rsc->priv->variant == pcmk__rsc_variant_bundle);
50}
51
60static inline bool
61pcmk__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 }
70}
71
80static inline bool
81pcmk__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 // PCMK__CRM_COMMON_BUNDLES_INTERNAL__H
@ pcmk__rsc_variant_bundle
Bundle resource.
Type aliases needed to define scheduler objects.
A single instance of a bundle.
pcmk_resource_t * child
Instance of bundled resource.
int offset
0-origin index of this instance in bundle
char * ipaddr
IP address associated with this instance.
pcmk_resource_t * remote
Pacemaker Remote connection into container.
pcmk_node_t * node
Copy of node created for this instance.
pcmk_resource_t * container
Container associated with this instance.
pcmk_resource_t * ip
IP address resource for ipaddr.
pcmk_resource_t * remote
enum pcmk__rsc_variant variant
pcmk__resource_private_t * priv
Definition resources.h:61
pcmk__node_private_t * priv
Definition nodes.h:85