This source file includes following definitions.
- pcmk__colocation_node_attr
- pcmk__colocation_has_influence
1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__LIBPACEMAKER_PRIVATE__H
11 # define PCMK__LIBPACEMAKER_PRIVATE__H
12
13
14
15
16
17 #include <crm/lrmd_events.h>
18 #include <crm/common/scheduler.h>
19 #include <crm/pengine/internal.h>
20
21
22 enum pcmk__coloc_flags {
23 pcmk__coloc_none = 0U,
24
25
26 pcmk__coloc_influence = (1U << 0),
27
28
29 pcmk__coloc_explicit = (1U << 1),
30 };
31
32
33 enum pcmk__coloc_select {
34
35 pcmk__coloc_select_default = 0,
36
37
38 pcmk__coloc_select_this_with = (1 << 0),
39
40
41 pcmk__coloc_select_nonnegative = (1 << 1),
42
43
44 pcmk__coloc_select_active = (1 << 2),
45 };
46
47
48 enum pcmk__updated {
49 pcmk__updated_none = 0,
50 pcmk__updated_first = (1 << 0),
51 pcmk__updated_then = (1 << 1),
52 };
53
54 #define pcmk__set_updated_flags(au_flags, action, flags_to_set) do { \
55 au_flags = pcmk__set_flags_as(__func__, __LINE__, \
56 LOG_TRACE, "Action update", \
57 (action)->uuid, au_flags, \
58 (flags_to_set), #flags_to_set); \
59 } while (0)
60
61 #define pcmk__clear_updated_flags(au_flags, action, flags_to_clear) do { \
62 au_flags = pcmk__clear_flags_as(__func__, __LINE__, \
63 LOG_TRACE, "Action update", \
64 (action)->uuid, au_flags, \
65 (flags_to_clear), #flags_to_clear); \
66 } while (0)
67
68
69 struct resource_alloc_functions_s {
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90 pcmk_node_t *(*assign)(pcmk_resource_t *rsc, const pcmk_node_t *prefer,
91 bool stop_if_fail);
92
93
94
95
96
97
98
99 void (*create_actions)(pcmk_resource_t *rsc);
100
101
102
103
104
105
106
107
108
109
110 bool (*create_probe)(pcmk_resource_t *rsc, pcmk_node_t *node);
111
112
113
114
115
116
117
118 void (*internal_constraints)(pcmk_resource_t *rsc);
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133 void (*apply_coloc_score)(pcmk_resource_t *dependent,
134 const pcmk_resource_t *primary,
135 const pcmk__colocation_t *colocation,
136 bool for_dependent);
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155 GList *(*colocated_resources)(const pcmk_resource_t *rsc,
156 const pcmk_resource_t *orig_rsc,
157 GList *colocated_rscs);
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176 void (*with_this_colocations)(const pcmk_resource_t *rsc,
177 const pcmk_resource_t *orig_rsc,
178 GList **list);
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198 void (*this_with_colocations)(const pcmk_resource_t *rsc,
199 const pcmk_resource_t *orig_rsc,
200 GList **list);
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231 void (*add_colocated_node_scores)(pcmk_resource_t *source_rsc,
232 const pcmk_resource_t *target_rsc,
233 const char *log_id, GHashTable **nodes,
234 const pcmk__colocation_t *colocation,
235 float factor, uint32_t flags);
236
237
238
239
240
241
242
243
244 void (*apply_location)(pcmk_resource_t *rsc, pe__location_t *location);
245
246
247
248
249
250
251
252
253
254
255
256
257
258 uint32_t (*action_flags)(pcmk_action_t *action, const pcmk_node_t *node);
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283 uint32_t (*update_ordered_actions)(pcmk_action_t *first,
284 pcmk_action_t *then,
285 const pcmk_node_t *node, uint32_t flags,
286 uint32_t filter, uint32_t type,
287 pcmk_scheduler_t *scheduler);
288
289
290
291
292
293
294
295 void (*output_actions)(pcmk_resource_t *rsc);
296
297
298
299
300
301
302
303 void (*add_actions_to_graph)(pcmk_resource_t *rsc);
304
305
306
307
308
309
310
311
312
313
314
315 void (*add_graph_meta)(const pcmk_resource_t *rsc, xmlNode *xml);
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332 void (*add_utilization)(const pcmk_resource_t *rsc,
333 const pcmk_resource_t *orig_rsc, GList *all_rscs,
334 GHashTable *utilization);
335
336
337
338
339
340
341
342 void (*shutdown_lock)(pcmk_resource_t *rsc);
343 };
344
345
346
347 G_GNUC_INTERNAL
348 void pcmk__update_action_for_orderings(pcmk_action_t *action,
349 pcmk_scheduler_t *scheduler);
350
351 G_GNUC_INTERNAL
352 uint32_t pcmk__update_ordered_actions(pcmk_action_t *first, pcmk_action_t *then,
353 const pcmk_node_t *node, uint32_t flags,
354 uint32_t filter, uint32_t type,
355 pcmk_scheduler_t *scheduler);
356
357 G_GNUC_INTERNAL
358 void pcmk__log_action(const char *pre_text, const pcmk_action_t *action,
359 bool details);
360
361 G_GNUC_INTERNAL
362 pcmk_action_t *pcmk__new_cancel_action(pcmk_resource_t *rsc, const char *name,
363 guint interval_ms,
364 const pcmk_node_t *node);
365
366 G_GNUC_INTERNAL
367 pcmk_action_t *pcmk__new_shutdown_action(pcmk_node_t *node);
368
369 G_GNUC_INTERNAL
370 bool pcmk__action_locks_rsc_to_node(const pcmk_action_t *action);
371
372 G_GNUC_INTERNAL
373 void pcmk__deduplicate_action_inputs(pcmk_action_t *action);
374
375 G_GNUC_INTERNAL
376 void pcmk__output_actions(pcmk_scheduler_t *scheduler);
377
378 G_GNUC_INTERNAL
379 bool pcmk__check_action_config(pcmk_resource_t *rsc, pcmk_node_t *node,
380 const xmlNode *xml_op);
381
382 G_GNUC_INTERNAL
383 void pcmk__handle_rsc_config_changes(pcmk_scheduler_t *scheduler);
384
385
386
387
388 G_GNUC_INTERNAL
389 void pcmk__create_recurring_actions(pcmk_resource_t *rsc);
390
391 G_GNUC_INTERNAL
392 void pcmk__schedule_cancel(pcmk_resource_t *rsc, const char *call_id,
393 const char *task, guint interval_ms,
394 const pcmk_node_t *node, const char *reason);
395
396 G_GNUC_INTERNAL
397 void pcmk__reschedule_recurring(pcmk_resource_t *rsc, const char *task,
398 guint interval_ms, pcmk_node_t *node);
399
400 G_GNUC_INTERNAL
401 bool pcmk__action_is_recurring(const pcmk_action_t *action);
402
403
404
405
406 G_GNUC_INTERNAL
407 bool pcmk__graph_has_loop(const pcmk_action_t *init_action,
408 const pcmk_action_t *action,
409 pcmk__related_action_t *input);
410
411 G_GNUC_INTERNAL
412 void pcmk__add_rsc_actions_to_graph(pcmk_resource_t *rsc);
413
414 G_GNUC_INTERNAL
415 void pcmk__create_graph(pcmk_scheduler_t *scheduler);
416
417
418
419
420 G_GNUC_INTERNAL
421 void pcmk__order_vs_fence(pcmk_action_t *stonith_op,
422 pcmk_scheduler_t *scheduler);
423
424 G_GNUC_INTERNAL
425 void pcmk__order_vs_unfence(const pcmk_resource_t *rsc, pcmk_node_t *node,
426 pcmk_action_t *action,
427 enum pcmk__action_relation_flags order);
428
429 G_GNUC_INTERNAL
430 void pcmk__fence_guest(pcmk_node_t *node);
431
432 G_GNUC_INTERNAL
433 bool pcmk__node_unfenced(const pcmk_node_t *node);
434
435 G_GNUC_INTERNAL
436 void pcmk__order_restart_vs_unfence(gpointer data, gpointer user_data);
437
438
439
440
441 void pcmk__inject_scheduler_input(pcmk_scheduler_t *scheduler, cib_t *cib,
442 const pcmk_injections_t *injections);
443
444
445
446
447 G_GNUC_INTERNAL
448 pcmk_resource_t *pcmk__find_constraint_resource(GList *rsc_list,
449 const char *id);
450
451 G_GNUC_INTERNAL
452 xmlNode *pcmk__expand_tags_in_sets(xmlNode *xml_obj,
453 const pcmk_scheduler_t *scheduler);
454
455 G_GNUC_INTERNAL
456 bool pcmk__valid_resource_or_tag(const pcmk_scheduler_t *scheduler,
457 const char *id, pcmk_resource_t **rsc,
458 pcmk_tag_t **tag);
459
460 G_GNUC_INTERNAL
461 bool pcmk__tag_to_set(xmlNode *xml_obj, xmlNode **rsc_set, const char *attr,
462 bool convert_rsc, const pcmk_scheduler_t *scheduler);
463
464 G_GNUC_INTERNAL
465 void pcmk__create_internal_constraints(pcmk_scheduler_t *scheduler);
466
467
468
469
470 G_GNUC_INTERNAL
471 void pcmk__unpack_location(xmlNode *xml_obj, pcmk_scheduler_t *scheduler);
472
473 G_GNUC_INTERNAL
474 pe__location_t *pcmk__new_location(const char *id, pcmk_resource_t *rsc,
475 int node_score, const char *discover_mode,
476 pcmk_node_t *foo_node);
477
478 G_GNUC_INTERNAL
479 void pcmk__apply_locations(pcmk_scheduler_t *scheduler);
480
481 G_GNUC_INTERNAL
482 void pcmk__apply_location(pcmk_resource_t *rsc, pe__location_t *constraint);
483
484
485
486
487 enum pcmk__coloc_affects {
488 pcmk__coloc_affects_nothing = 0,
489 pcmk__coloc_affects_location,
490 pcmk__coloc_affects_role,
491 };
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509 static inline const char *
510 pcmk__colocation_node_attr(const pcmk_node_t *node, const char *attr,
511 const pcmk_resource_t *rsc)
512 {
513 const pcmk_resource_t *top = pe__const_top_resource(rsc, false);
514 const bool force_host = pe__is_bundle_node(node)
515 && pe_rsc_is_bundled(rsc)
516 && (top == pe__bundled_resource(rsc));
517
518 return pe__node_attribute_calculated(node, attr, rsc,
519 pcmk__rsc_node_assigned, force_host);
520 }
521
522 G_GNUC_INTERNAL
523 enum pcmk__coloc_affects pcmk__colocation_affects(const pcmk_resource_t
524 *dependent,
525 const pcmk_resource_t
526 *primary,
527 const pcmk__colocation_t
528 *colocation,
529 bool preview);
530
531 G_GNUC_INTERNAL
532 void pcmk__apply_coloc_to_scores(pcmk_resource_t *dependent,
533 const pcmk_resource_t *primary,
534 const pcmk__colocation_t *colocation);
535
536 G_GNUC_INTERNAL
537 void pcmk__apply_coloc_to_priority(pcmk_resource_t *dependent,
538 const pcmk_resource_t *primary,
539 const pcmk__colocation_t *colocation);
540
541 G_GNUC_INTERNAL
542 void pcmk__add_colocated_node_scores(pcmk_resource_t *source_rsc,
543 const pcmk_resource_t *target_rsc,
544 const char *log_id, GHashTable **nodes,
545 const pcmk__colocation_t *colocation,
546 float factor, uint32_t flags);
547
548 G_GNUC_INTERNAL
549 void pcmk__add_dependent_scores(gpointer data, gpointer user_data);
550
551 G_GNUC_INTERNAL
552 void pcmk__colocation_intersect_nodes(pcmk_resource_t *dependent,
553 const pcmk_resource_t *primary,
554 const pcmk__colocation_t *colocation,
555 const GList *primary_nodes,
556 bool merge_scores);
557
558 G_GNUC_INTERNAL
559 void pcmk__unpack_colocation(xmlNode *xml_obj, pcmk_scheduler_t *scheduler);
560
561 G_GNUC_INTERNAL
562 void pcmk__add_this_with(GList **list, const pcmk__colocation_t *colocation,
563 const pcmk_resource_t *rsc);
564
565 G_GNUC_INTERNAL
566 void pcmk__add_this_with_list(GList **list, GList *addition,
567 const pcmk_resource_t *rsc);
568
569 G_GNUC_INTERNAL
570 void pcmk__add_with_this(GList **list, const pcmk__colocation_t *colocation,
571 const pcmk_resource_t *rsc);
572
573 G_GNUC_INTERNAL
574 void pcmk__add_with_this_list(GList **list, GList *addition,
575 const pcmk_resource_t *rsc);
576
577 G_GNUC_INTERNAL
578 GList *pcmk__with_this_colocations(const pcmk_resource_t *rsc);
579
580 G_GNUC_INTERNAL
581 GList *pcmk__this_with_colocations(const pcmk_resource_t *rsc);
582
583 G_GNUC_INTERNAL
584 void pcmk__new_colocation(const char *id, const char *node_attr, int score,
585 pcmk_resource_t *dependent, pcmk_resource_t *primary,
586 const char *dependent_role, const char *primary_role,
587 uint32_t flags);
588
589 G_GNUC_INTERNAL
590 void pcmk__block_colocation_dependents(pcmk_action_t *action);
591
592
593
594
595
596
597
598
599
600
601
602
603
604 static inline bool
605 pcmk__colocation_has_influence(const pcmk__colocation_t *colocation,
606 const pcmk_resource_t *rsc)
607 {
608 if (rsc == NULL) {
609 rsc = colocation->primary;
610 }
611
612
613
614
615
616
617
618
619
620
621
622
623
624 if (pcmk_is_set(colocation->dependent->flags,
625 pcmk_rsc_remote_nesting_allowed)
626 && !pcmk_is_set(rsc->flags, pcmk_rsc_failed)
627 && pcmk__list_of_1(rsc->running_on)) {
628 return false;
629 }
630
631
632
633
634 return pcmk_is_set(colocation->flags, pcmk__coloc_influence)
635 || (rsc->running_on == NULL);
636 }
637
638
639
640
641 G_GNUC_INTERNAL
642 void pcmk__new_ordering(pcmk_resource_t *first_rsc, char *first_task,
643 pcmk_action_t *first_action, pcmk_resource_t *then_rsc,
644 char *then_task, pcmk_action_t *then_action,
645 uint32_t flags, pcmk_scheduler_t *sched);
646
647 G_GNUC_INTERNAL
648 void pcmk__unpack_ordering(xmlNode *xml_obj, pcmk_scheduler_t *scheduler);
649
650 G_GNUC_INTERNAL
651 void pcmk__disable_invalid_orderings(pcmk_scheduler_t *scheduler);
652
653 G_GNUC_INTERNAL
654 void pcmk__order_stops_before_shutdown(pcmk_node_t *node,
655 pcmk_action_t *shutdown_op);
656
657 G_GNUC_INTERNAL
658 void pcmk__apply_orderings(pcmk_scheduler_t *sched);
659
660 G_GNUC_INTERNAL
661 void pcmk__order_after_each(pcmk_action_t *after, GList *list);
662
663
664
665
666
667
668
669
670
671
672
673
674 #define pcmk__order_resource_actions(first_rsc, first_task, \
675 then_rsc, then_task, flags) \
676 pcmk__new_ordering((first_rsc), \
677 pcmk__op_key((first_rsc)->id, (first_task), 0), \
678 NULL, \
679 (then_rsc), \
680 pcmk__op_key((then_rsc)->id, (then_task), 0), \
681 NULL, (flags), (first_rsc)->cluster)
682
683 #define pcmk__order_starts(rsc1, rsc2, flags) \
684 pcmk__order_resource_actions((rsc1), PCMK_ACTION_START, \
685 (rsc2), PCMK_ACTION_START, (flags))
686
687 #define pcmk__order_stops(rsc1, rsc2, flags) \
688 pcmk__order_resource_actions((rsc1), PCMK_ACTION_STOP, \
689 (rsc2), PCMK_ACTION_STOP, (flags))
690
691
692
693
694 G_GNUC_INTERNAL
695 void pcmk__unpack_rsc_ticket(xmlNode *xml_obj, pcmk_scheduler_t *scheduler);
696
697
698
699
700 G_GNUC_INTERNAL
701 void pcmk__add_promotion_scores(pcmk_resource_t *rsc);
702
703 G_GNUC_INTERNAL
704 void pcmk__require_promotion_tickets(pcmk_resource_t *rsc);
705
706 G_GNUC_INTERNAL
707 void pcmk__set_instance_roles(pcmk_resource_t *rsc);
708
709 G_GNUC_INTERNAL
710 void pcmk__create_promotable_actions(pcmk_resource_t *clone);
711
712 G_GNUC_INTERNAL
713 void pcmk__promotable_restart_ordering(pcmk_resource_t *rsc);
714
715 G_GNUC_INTERNAL
716 void pcmk__order_promotable_instances(pcmk_resource_t *clone);
717
718 G_GNUC_INTERNAL
719 void pcmk__update_dependent_with_promotable(const pcmk_resource_t *primary,
720 pcmk_resource_t *dependent,
721 const pcmk__colocation_t
722 *colocation);
723
724 G_GNUC_INTERNAL
725 void pcmk__update_promotable_dependent_priority(const pcmk_resource_t *primary,
726 pcmk_resource_t *dependent,
727 const pcmk__colocation_t
728 *colocation);
729
730
731
732
733 G_GNUC_INTERNAL
734 bool pcmk__is_failed_remote_node(const pcmk_node_t *node);
735
736 G_GNUC_INTERNAL
737 void pcmk__order_remote_connection_actions(pcmk_scheduler_t *scheduler);
738
739 G_GNUC_INTERNAL
740 bool pcmk__rsc_corresponds_to_guest(const pcmk_resource_t *rsc,
741 const pcmk_node_t *node);
742
743 G_GNUC_INTERNAL
744 pcmk_node_t *pcmk__connection_host_for_action(const pcmk_action_t *action);
745
746 G_GNUC_INTERNAL
747 void pcmk__substitute_remote_addr(pcmk_resource_t *rsc, GHashTable *params);
748
749 G_GNUC_INTERNAL
750 void pcmk__add_bundle_meta_to_xml(xmlNode *args_xml,
751 const pcmk_action_t *action);
752
753
754
755
756 G_GNUC_INTERNAL
757 pcmk_node_t *pcmk__primitive_assign(pcmk_resource_t *rsc,
758 const pcmk_node_t *prefer,
759 bool stop_if_fail);
760
761 G_GNUC_INTERNAL
762 void pcmk__primitive_create_actions(pcmk_resource_t *rsc);
763
764 G_GNUC_INTERNAL
765 void pcmk__primitive_internal_constraints(pcmk_resource_t *rsc);
766
767 G_GNUC_INTERNAL
768 uint32_t pcmk__primitive_action_flags(pcmk_action_t *action,
769 const pcmk_node_t *node);
770
771 G_GNUC_INTERNAL
772 void pcmk__primitive_apply_coloc_score(pcmk_resource_t *dependent,
773 const pcmk_resource_t *primary,
774 const pcmk__colocation_t *colocation,
775 bool for_dependent);
776
777 G_GNUC_INTERNAL
778 void pcmk__with_primitive_colocations(const pcmk_resource_t *rsc,
779 const pcmk_resource_t *orig_rsc,
780 GList **list);
781
782 G_GNUC_INTERNAL
783 void pcmk__primitive_with_colocations(const pcmk_resource_t *rsc,
784 const pcmk_resource_t *orig_rsc,
785 GList **list);
786
787 G_GNUC_INTERNAL
788 void pcmk__schedule_cleanup(pcmk_resource_t *rsc, const pcmk_node_t *node,
789 bool optional);
790
791 G_GNUC_INTERNAL
792 void pcmk__primitive_add_graph_meta(const pcmk_resource_t *rsc, xmlNode *xml);
793
794 G_GNUC_INTERNAL
795 void pcmk__primitive_add_utilization(const pcmk_resource_t *rsc,
796 const pcmk_resource_t *orig_rsc,
797 GList *all_rscs, GHashTable *utilization);
798
799 G_GNUC_INTERNAL
800 void pcmk__primitive_shutdown_lock(pcmk_resource_t *rsc);
801
802
803
804
805 G_GNUC_INTERNAL
806 pcmk_node_t *pcmk__group_assign(pcmk_resource_t *rsc, const pcmk_node_t *prefer,
807 bool stop_if_fail);
808
809 G_GNUC_INTERNAL
810 void pcmk__group_create_actions(pcmk_resource_t *rsc);
811
812 G_GNUC_INTERNAL
813 void pcmk__group_internal_constraints(pcmk_resource_t *rsc);
814
815 G_GNUC_INTERNAL
816 void pcmk__group_apply_coloc_score(pcmk_resource_t *dependent,
817 const pcmk_resource_t *primary,
818 const pcmk__colocation_t *colocation,
819 bool for_dependent);
820
821 G_GNUC_INTERNAL
822 void pcmk__with_group_colocations(const pcmk_resource_t *rsc,
823 const pcmk_resource_t *orig_rsc,
824 GList **list);
825
826 G_GNUC_INTERNAL
827 void pcmk__group_with_colocations(const pcmk_resource_t *rsc,
828 const pcmk_resource_t *orig_rsc,
829 GList **list);
830
831 G_GNUC_INTERNAL
832 void pcmk__group_add_colocated_node_scores(pcmk_resource_t *source_rsc,
833 const pcmk_resource_t *target_rsc,
834 const char *log_id,
835 GHashTable **nodes,
836 const pcmk__colocation_t *colocation,
837 float factor, uint32_t flags);
838
839 G_GNUC_INTERNAL
840 void pcmk__group_apply_location(pcmk_resource_t *rsc, pe__location_t *location);
841
842 G_GNUC_INTERNAL
843 uint32_t pcmk__group_action_flags(pcmk_action_t *action,
844 const pcmk_node_t *node);
845
846 G_GNUC_INTERNAL
847 uint32_t pcmk__group_update_ordered_actions(pcmk_action_t *first,
848 pcmk_action_t *then,
849 const pcmk_node_t *node,
850 uint32_t flags, uint32_t filter,
851 uint32_t type,
852 pcmk_scheduler_t *scheduler);
853
854 G_GNUC_INTERNAL
855 GList *pcmk__group_colocated_resources(const pcmk_resource_t *rsc,
856 const pcmk_resource_t *orig_rsc,
857 GList *colocated_rscs);
858
859 G_GNUC_INTERNAL
860 void pcmk__group_add_utilization(const pcmk_resource_t *rsc,
861 const pcmk_resource_t *orig_rsc,
862 GList *all_rscs, GHashTable *utilization);
863
864 G_GNUC_INTERNAL
865 void pcmk__group_shutdown_lock(pcmk_resource_t *rsc);
866
867
868
869
870 G_GNUC_INTERNAL
871 pcmk_node_t *pcmk__clone_assign(pcmk_resource_t *rsc, const pcmk_node_t *prefer,
872 bool stop_if_fail);
873
874 G_GNUC_INTERNAL
875 void pcmk__clone_create_actions(pcmk_resource_t *rsc);
876
877 G_GNUC_INTERNAL
878 bool pcmk__clone_create_probe(pcmk_resource_t *rsc, pcmk_node_t *node);
879
880 G_GNUC_INTERNAL
881 void pcmk__clone_internal_constraints(pcmk_resource_t *rsc);
882
883 G_GNUC_INTERNAL
884 void pcmk__clone_apply_coloc_score(pcmk_resource_t *dependent,
885 const pcmk_resource_t *primary,
886 const pcmk__colocation_t *colocation,
887 bool for_dependent);
888
889 G_GNUC_INTERNAL
890 void pcmk__with_clone_colocations(const pcmk_resource_t *rsc,
891 const pcmk_resource_t *orig_rsc,
892 GList **list);
893
894 G_GNUC_INTERNAL
895 void pcmk__clone_with_colocations(const pcmk_resource_t *rsc,
896 const pcmk_resource_t *orig_rsc,
897 GList **list);
898
899 G_GNUC_INTERNAL
900 void pcmk__clone_apply_location(pcmk_resource_t *rsc,
901 pe__location_t *constraint);
902
903 G_GNUC_INTERNAL
904 uint32_t pcmk__clone_action_flags(pcmk_action_t *action,
905 const pcmk_node_t *node);
906
907 G_GNUC_INTERNAL
908 void pcmk__clone_add_actions_to_graph(pcmk_resource_t *rsc);
909
910 G_GNUC_INTERNAL
911 void pcmk__clone_add_graph_meta(const pcmk_resource_t *rsc, xmlNode *xml);
912
913 G_GNUC_INTERNAL
914 void pcmk__clone_add_utilization(const pcmk_resource_t *rsc,
915 const pcmk_resource_t *orig_rsc,
916 GList *all_rscs, GHashTable *utilization);
917
918 G_GNUC_INTERNAL
919 void pcmk__clone_shutdown_lock(pcmk_resource_t *rsc);
920
921
922
923 G_GNUC_INTERNAL
924 pcmk_node_t *pcmk__bundle_assign(pcmk_resource_t *rsc,
925 const pcmk_node_t *prefer, bool stop_if_fail);
926
927 G_GNUC_INTERNAL
928 void pcmk__bundle_create_actions(pcmk_resource_t *rsc);
929
930 G_GNUC_INTERNAL
931 bool pcmk__bundle_create_probe(pcmk_resource_t *rsc, pcmk_node_t *node);
932
933 G_GNUC_INTERNAL
934 void pcmk__bundle_internal_constraints(pcmk_resource_t *rsc);
935
936 G_GNUC_INTERNAL
937 void pcmk__bundle_apply_coloc_score(pcmk_resource_t *dependent,
938 const pcmk_resource_t *primary,
939 const pcmk__colocation_t *colocation,
940 bool for_dependent);
941
942 G_GNUC_INTERNAL
943 void pcmk__with_bundle_colocations(const pcmk_resource_t *rsc,
944 const pcmk_resource_t *orig_rsc,
945 GList **list);
946
947 G_GNUC_INTERNAL
948 void pcmk__bundle_with_colocations(const pcmk_resource_t *rsc,
949 const pcmk_resource_t *orig_rsc,
950 GList **list);
951
952 G_GNUC_INTERNAL
953 void pcmk__bundle_apply_location(pcmk_resource_t *rsc,
954 pe__location_t *constraint);
955
956 G_GNUC_INTERNAL
957 uint32_t pcmk__bundle_action_flags(pcmk_action_t *action,
958 const pcmk_node_t *node);
959
960 G_GNUC_INTERNAL
961 void pcmk__output_bundle_actions(pcmk_resource_t *rsc);
962
963 G_GNUC_INTERNAL
964 void pcmk__bundle_add_actions_to_graph(pcmk_resource_t *rsc);
965
966 G_GNUC_INTERNAL
967 void pcmk__bundle_add_utilization(const pcmk_resource_t *rsc,
968 const pcmk_resource_t *orig_rsc,
969 GList *all_rscs, GHashTable *utilization);
970
971 G_GNUC_INTERNAL
972 void pcmk__bundle_shutdown_lock(pcmk_resource_t *rsc);
973
974
975
976
977 G_GNUC_INTERNAL
978 void pcmk__assign_instances(pcmk_resource_t *collective, GList *instances,
979 int max_total, int max_per_node);
980
981 G_GNUC_INTERNAL
982 void pcmk__create_instance_actions(pcmk_resource_t *rsc, GList *instances);
983
984 G_GNUC_INTERNAL
985 bool pcmk__instance_matches(const pcmk_resource_t *instance,
986 const pcmk_node_t *node, enum rsc_role_e role,
987 bool current);
988
989 G_GNUC_INTERNAL
990 pcmk_resource_t *pcmk__find_compatible_instance(const pcmk_resource_t *match_rsc,
991 const pcmk_resource_t *rsc,
992 enum rsc_role_e role,
993 bool current);
994
995 G_GNUC_INTERNAL
996 uint32_t pcmk__instance_update_ordered_actions(pcmk_action_t *first,
997 pcmk_action_t *then,
998 const pcmk_node_t *node,
999 uint32_t flags, uint32_t filter,
1000 uint32_t type,
1001 pcmk_scheduler_t *scheduler);
1002
1003 G_GNUC_INTERNAL
1004 uint32_t pcmk__collective_action_flags(pcmk_action_t *action,
1005 const GList *instances,
1006 const pcmk_node_t *node);
1007
1008
1009
1010
1011 G_GNUC_INTERNAL
1012 xmlNode *pcmk__inject_node(cib_t *cib_conn, const char *node, const char *uuid);
1013
1014 G_GNUC_INTERNAL
1015 xmlNode *pcmk__inject_node_state_change(cib_t *cib_conn, const char *node,
1016 bool up);
1017
1018 G_GNUC_INTERNAL
1019 xmlNode *pcmk__inject_resource_history(pcmk__output_t *out, xmlNode *cib_node,
1020 const char *resource,
1021 const char *lrm_name,
1022 const char *rclass,
1023 const char *rtype,
1024 const char *rprovider);
1025
1026 G_GNUC_INTERNAL
1027 void pcmk__inject_failcount(pcmk__output_t *out, xmlNode *cib_node,
1028 const char *resource, const char *task,
1029 guint interval_ms, int rc);
1030
1031 G_GNUC_INTERNAL
1032 xmlNode *pcmk__inject_action_result(xmlNode *cib_resource,
1033 lrmd_event_data_t *op, int target_rc);
1034
1035
1036
1037
1038 G_GNUC_INTERNAL
1039 bool pcmk__node_available(const pcmk_node_t *node, bool consider_score,
1040 bool consider_guest);
1041
1042 G_GNUC_INTERNAL
1043 bool pcmk__any_node_available(GHashTable *nodes);
1044
1045 G_GNUC_INTERNAL
1046 GHashTable *pcmk__copy_node_table(GHashTable *nodes);
1047
1048 G_GNUC_INTERNAL
1049 void pcmk__copy_node_tables(const pcmk_resource_t *rsc, GHashTable **copy);
1050
1051 G_GNUC_INTERNAL
1052 void pcmk__restore_node_tables(pcmk_resource_t *rsc, GHashTable *backup);
1053
1054 G_GNUC_INTERNAL
1055 GList *pcmk__sort_nodes(GList *nodes, pcmk_node_t *active_node);
1056
1057 G_GNUC_INTERNAL
1058 void pcmk__apply_node_health(pcmk_scheduler_t *scheduler);
1059
1060 G_GNUC_INTERNAL
1061 pcmk_node_t *pcmk__top_allowed_node(const pcmk_resource_t *rsc,
1062 const pcmk_node_t *node);
1063
1064
1065
1066
1067 G_GNUC_INTERNAL
1068 void pcmk__set_assignment_methods(pcmk_scheduler_t *scheduler);
1069
1070 G_GNUC_INTERNAL
1071 bool pcmk__rsc_agent_changed(pcmk_resource_t *rsc, pcmk_node_t *node,
1072 const xmlNode *rsc_entry, bool active_on_node);
1073
1074 G_GNUC_INTERNAL
1075 GList *pcmk__rscs_matching_id(const char *id,
1076 const pcmk_scheduler_t *scheduler);
1077
1078 G_GNUC_INTERNAL
1079 GList *pcmk__colocated_resources(const pcmk_resource_t *rsc,
1080 const pcmk_resource_t *orig_rsc,
1081 GList *colocated_rscs);
1082
1083 G_GNUC_INTERNAL
1084 void pcmk__noop_add_graph_meta(const pcmk_resource_t *rsc, xmlNode *xml);
1085
1086 G_GNUC_INTERNAL
1087 void pcmk__output_resource_actions(pcmk_resource_t *rsc);
1088
1089 G_GNUC_INTERNAL
1090 bool pcmk__assign_resource(pcmk_resource_t *rsc, pcmk_node_t *node, bool force,
1091 bool stop_if_fail);
1092
1093 G_GNUC_INTERNAL
1094 void pcmk__unassign_resource(pcmk_resource_t *rsc);
1095
1096 G_GNUC_INTERNAL
1097 bool pcmk__threshold_reached(pcmk_resource_t *rsc, const pcmk_node_t *node,
1098 pcmk_resource_t **failed);
1099
1100 G_GNUC_INTERNAL
1101 void pcmk__sort_resources(pcmk_scheduler_t *scheduler);
1102
1103 G_GNUC_INTERNAL
1104 gint pcmk__cmp_instance(gconstpointer a, gconstpointer b);
1105
1106 G_GNUC_INTERNAL
1107 gint pcmk__cmp_instance_number(gconstpointer a, gconstpointer b);
1108
1109
1110
1111
1112 G_GNUC_INTERNAL
1113 bool pcmk__probe_rsc_on_node(pcmk_resource_t *rsc, pcmk_node_t *node);
1114
1115 G_GNUC_INTERNAL
1116 void pcmk__order_probes(pcmk_scheduler_t *scheduler);
1117
1118 G_GNUC_INTERNAL
1119 bool pcmk__probe_resource_list(GList *rscs, pcmk_node_t *node);
1120
1121 G_GNUC_INTERNAL
1122 void pcmk__schedule_probes(pcmk_scheduler_t *scheduler);
1123
1124
1125
1126
1127 void pcmk__create_migration_actions(pcmk_resource_t *rsc,
1128 const pcmk_node_t *current);
1129
1130 void pcmk__abort_dangling_migration(void *data, void *user_data);
1131
1132 bool pcmk__rsc_can_migrate(const pcmk_resource_t *rsc,
1133 const pcmk_node_t *current);
1134
1135 void pcmk__order_migration_equivalents(pe__ordering_t *order);
1136
1137
1138
1139
1140 G_GNUC_INTERNAL
1141 int pcmk__compare_node_capacities(const pcmk_node_t *node1,
1142 const pcmk_node_t *node2);
1143
1144 G_GNUC_INTERNAL
1145 void pcmk__consume_node_capacity(GHashTable *current_utilization,
1146 const pcmk_resource_t *rsc);
1147
1148 G_GNUC_INTERNAL
1149 void pcmk__release_node_capacity(GHashTable *current_utilization,
1150 const pcmk_resource_t *rsc);
1151
1152 G_GNUC_INTERNAL
1153 const pcmk_node_t *pcmk__ban_insufficient_capacity(pcmk_resource_t *rsc);
1154
1155 G_GNUC_INTERNAL
1156 void pcmk__create_utilization_constraints(pcmk_resource_t *rsc,
1157 const GList *allowed_nodes);
1158
1159 G_GNUC_INTERNAL
1160 void pcmk__show_node_capacities(const char *desc, pcmk_scheduler_t *scheduler);
1161
1162 #endif