This source file includes following definitions.
- ra_param_flag2text
1
2
3
4
5
6
7
8
9
10 #ifndef CRMD_METADATA_H
11 #define CRMD_METADATA_H
12
13 #include <stdint.h>
14 #include <glib.h>
15 #include "controld_lrm.h"
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 enum ra_flags_e {
32 ra_supports_legacy_reload = (1 << 0),
33 ra_supports_reload_agent = (1 << 1),
34 };
35
36 enum ra_param_flags_e {
37 ra_param_unique = (1 << 0),
38 ra_param_private = (1 << 1),
39 ra_param_reloadable = (1 << 2),
40 };
41
42
43 enum controld_metadata_source_e {
44 controld_metadata_from_cache = (1 << 0),
45 controld_metadata_from_agent = (1 << 1),
46 };
47
48 struct ra_param_s {
49 char *rap_name;
50 uint32_t rap_flags;
51 };
52
53 struct ra_metadata_s {
54 GList *ra_params;
55 uint32_t ra_flags;
56 };
57
58 #define controld_set_ra_flags(ra_md, ra_key, flags_to_set) do { \
59 (ra_md)->ra_flags = pcmk__set_flags_as(__func__, __LINE__, \
60 LOG_TRACE, "Resource agent", ra_key, \
61 (ra_md)->ra_flags, (flags_to_set), #flags_to_set); \
62 } while (0)
63
64 #define controld_set_ra_param_flags(ra_param, flags_to_set) do { \
65 (ra_param)->rap_flags = pcmk__set_flags_as(__func__, __LINE__, \
66 LOG_TRACE, "Resource agent parameter", (ra_param)->rap_name, \
67 (ra_param)->rap_flags, (flags_to_set), #flags_to_set); \
68 } while (0)
69
70 GHashTable *metadata_cache_new(void);
71 void metadata_cache_free(GHashTable *mdc);
72 void metadata_cache_reset(GHashTable *mdc);
73
74 struct ra_metadata_s *controld_cache_metadata(GHashTable *mdc,
75 const lrmd_rsc_info_t *rsc,
76 const char *metadata_str);
77 struct ra_metadata_s *controld_get_rsc_metadata(lrm_state_t *lrm_state,
78 const lrmd_rsc_info_t *rsc,
79 uint32_t source);
80
81 static inline const char *
82 ra_param_flag2text(enum ra_param_flags_e flag)
83 {
84 switch (flag) {
85 case ra_param_reloadable:
86 return "reloadable";
87 case ra_param_unique:
88 return "unique";
89 case ra_param_private:
90 return "private";
91 default:
92 return "unknown";
93 }
94 }
95
96 #endif