This source file includes following definitions.
- pcmk__colocation_has_influence
1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__PCMKI_PCMKI_SCHEDULER__H
11 # define PCMK__PCMKI_PCMKI_SCHEDULER__H
12
13 typedef struct rsc_ticket_s rsc_ticket_t;
14
15 # include <glib.h>
16 # include <crm/crm.h>
17 # include <crm/common/iso8601.h>
18 # include <crm/pengine/rules.h>
19 # include <crm/pengine/common.h>
20 # include <crm/pengine/status.h>
21
22 # include <crm/pengine/complex.h>
23
24 enum pe_weights {
25 pe_weights_none = 0x0,
26 pe_weights_init = 0x1,
27 pe_weights_forward = 0x4,
28 pe_weights_positive = 0x8,
29 pe_weights_rollback = 0x10,
30 };
31
32 typedef struct {
33 const char *id;
34 const char *node_attribute;
35 pe_resource_t *dependent;
36 pe_resource_t *primary;
37
38 int dependent_role;
39 int primary_role;
40
41 int score;
42 bool influence;
43 } pcmk__colocation_t;
44
45 enum loss_ticket_policy_e {
46 loss_ticket_stop,
47 loss_ticket_demote,
48 loss_ticket_fence,
49 loss_ticket_freeze
50 };
51
52 struct rsc_ticket_s {
53 const char *id;
54 pe_resource_t *rsc_lh;
55 pe_ticket_t *ticket;
56 enum loss_ticket_policy_e loss_policy;
57
58 int role_lh;
59 };
60
61 void pcmk__unpack_constraints(pe_working_set_t *data_set);
62
63 extern void add_maintenance_update(pe_working_set_t *data_set);
64 void pcmk__schedule_actions(xmlNode *cib, unsigned long long flags,
65 pe_working_set_t *data_set);
66
67 extern const char *transition_idle_timeout;
68
69
70
71
72
73
74
75
76
77
78
79
80
81 static inline bool
82 pcmk__colocation_has_influence(const pcmk__colocation_t *colocation,
83 const pe_resource_t *rsc)
84 {
85 if (rsc == NULL) {
86 rsc = colocation->primary;
87 }
88
89
90
91
92 return colocation->influence || (rsc->running_on == NULL);
93 }
94
95 #endif