pacemaker
2.1.9-49aab99839
Scalable High-Availability cluster resource manager
include
crm
pengine
status_compat.h
Go to the documentation of this file.
1
/*
2
* Copyright 2004-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_PENGINE_STATUS_COMPAT__H
11
#define PCMK__CRM_PENGINE_STATUS_COMPAT__H
12
13
#include <stdbool.h>
// bool
14
#include <
crm/common/util.h
>
// pcmk_is_set()
15
#include <
crm/common/scheduler.h
>
// pcmk_resource_t, pcmk_rsc_unique, etc.
16
17
#ifdef __cplusplus
18
extern
"C"
{
19
#endif
20
30
// NOTE: sbd (as of at least 1.5.2) uses this
32
pcmk_node_t
*
pe_find_node
(
const
GList *node_list,
const
char
*node_name);
33
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
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
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
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 // PCMK__CRM_PENGINE_STATUS_COMPAT__H
scheduler.h
Scheduler API.
pe_resource_s::parent
pcmk_resource_t * parent
Definition:
resources.h:409
pcmk_rsc_variant_bundle
Definition:
resources.h:40
pe_find_node
pcmk_node_t * pe_find_node(const GList *node_list, const char *node_name)
Find a node by name in a list of nodes.
Definition:
status.c:522
pe_resource_s
Definition:
resources.h:392
util.h
Utility functions.
pcmk_is_set
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
Definition:
util.h:94
pe_resource_s::flags
unsigned long long flags
Definition:
resources.h:428
pe_node_s
Definition:
nodes.h:162
pe_resource_s::variant
enum pe_obj_types variant
Definition:
resources.h:410
pcmk_rsc_variant_clone
Definition:
resources.h:39
pcmk_rsc_unique
Definition:
resources.h:100
Generated on Thu Oct 31 2024 15:49:02 for pacemaker by
1.8.14