This source file includes following definitions.
- crmd_unpack_alerts
- crmd_alert_node_event
- crmd_alert_fencing_op
- crmd_alert_resource_op
1
2
3
4
5
6
7
8
9
10 #include <crm_internal.h>
11
12 #include <glib.h>
13 #include <libxml/tree.h>
14
15 #include <crm/fencing/internal.h>
16 #include <crm/lrmd.h>
17 #include <crm/lrmd_internal.h>
18 #include <crm/pengine/rules_internal.h>
19 #include <crm/pengine/status.h>
20 #include <crm/stonith-ng.h>
21
22 #include <pacemaker-controld.h>
23
24 static GList *crmd_alert_list = NULL;
25
26 void
27 crmd_unpack_alerts(xmlNode *alerts)
28 {
29 pe_free_alert_list(crmd_alert_list);
30 crmd_alert_list = pe_unpack_alerts(alerts);
31 }
32
33 void
34 crmd_alert_node_event(crm_node_t *node)
35 {
36 lrm_state_t *lrm_state;
37
38 if (crmd_alert_list == NULL) {
39 return;
40 }
41
42 lrm_state = lrm_state_find(fsa_our_uname);
43 if (lrm_state == NULL) {
44 return;
45 }
46
47 lrmd_send_node_alert((lrmd_t *) lrm_state->conn, crmd_alert_list,
48 node->uname, node->id, node->state);
49 }
50
51 void
52 crmd_alert_fencing_op(stonith_event_t * e)
53 {
54 char *desc;
55 lrm_state_t *lrm_state;
56
57 if (crmd_alert_list == NULL) {
58 return;
59 }
60
61 lrm_state = lrm_state_find(fsa_our_uname);
62 if (lrm_state == NULL) {
63 return;
64 }
65
66 desc = stonith__event_description(e);
67 lrmd_send_fencing_alert((lrmd_t *) lrm_state->conn, crmd_alert_list,
68 e->target, e->operation, desc, e->result);
69 free(desc);
70 }
71
72 void
73 crmd_alert_resource_op(const char *node, lrmd_event_data_t * op)
74 {
75 lrm_state_t *lrm_state;
76
77 if (crmd_alert_list == NULL) {
78 return;
79 }
80
81 lrm_state = lrm_state_find(fsa_our_uname);
82 if (lrm_state == NULL) {
83 return;
84 }
85
86 lrmd_send_resource_alert((lrmd_t *) lrm_state->conn, crmd_alert_list, node,
87 op);
88 }