pacemaker
2.1.8-3980678f03
Scalable High-Availability cluster resource manager
lib
common
resources.c
Go to the documentation of this file.
1
/*
2
* Copyright 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
#include <
crm_internal.h
>
11
12
#include <stdio.h>
// NULL
13
#include <stdbool.h>
// bool, false
14
15
#include <
crm/common/scheduler.h
>
16
#include <
crm/common/scheduler_internal.h
>
17
26
const
char
*
27
pcmk_resource_id
(
const
pcmk_resource_t
*rsc)
28
{
29
return
(rsc == NULL)? NULL : rsc->
id
;
30
}
31
40
bool
41
pcmk_resource_is_managed
(
const
pcmk_resource_t
*rsc)
42
{
43
return
(rsc == NULL)? false :
pcmk_is_set
(rsc->
flags
,
pcmk_rsc_managed
);
44
}
45
53
const
char
*
54
pcmk__multiply_active_text
(
enum
rsc_recovery_type
recovery)
55
{
56
switch
(recovery) {
57
case
pcmk_multiply_active_stop
:
58
return
"shutting it down"
;
59
case
pcmk_multiply_active_restart
:
60
return
"attempting recovery"
;
61
case
pcmk_multiply_active_block
:
62
return
"waiting for an administrator"
;
63
case
pcmk_multiply_active_unexpected
:
64
return
"stopping unexpected instances"
;
65
}
66
return
"Unknown"
;
67
}
pcmk_resource_is_managed
bool pcmk_resource_is_managed(const pcmk_resource_t *rsc)
Definition:
resources.c:41
scheduler_internal.h
pcmk_multiply_active_block
Definition:
resources.h:68
scheduler.h
Scheduler API.
pcmk_multiply_active_stop
Definition:
resources.h:67
pe_resource_s
Definition:
resources.h:392
crm_internal.h
pcmk_is_set
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
Definition:
util.h:98
pe_resource_s::flags
unsigned long long flags
Definition:
resources.h:428
rsc_recovery_type
rsc_recovery_type
Definition:
resources.h:65
pcmk_multiply_active_unexpected
Definition:
resources.h:69
pcmk__multiply_active_text
const char * pcmk__multiply_active_text(enum rsc_recovery_type recovery)
Get readable description of a multiply-active recovery type.
Definition:
resources.c:54
pcmk_multiply_active_restart
Definition:
resources.h:66
pcmk_rsc_managed
Definition:
resources.h:88
pcmk_resource_id
const char * pcmk_resource_id(const pcmk_resource_t *rsc)
Definition:
resources.c:27
pe_resource_s::id
char * id
Definition:
resources.h:395
Generated on Thu Aug 8 2024 18:08:10 for pacemaker by
1.8.14