]>
Commit | Line | Data |
---|---|---|
fe000966 | 1 | /* |
7f66b436 | 2 | Copyright (C) 2010-2015 Proxmox Server Solutions GmbH |
fe000966 DM |
3 | |
4 | This program is free software: you can redistribute it and/or modify | |
5 | it under the terms of the GNU Affero General Public License as published by | |
6 | the Free Software Foundation, either version 3 of the License, or | |
7 | (at your option) any later version. | |
8 | ||
9 | This program is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | GNU Affero General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU Affero General Public License | |
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | ||
17 | Author: Dietmar Maurer <dietmar@proxmox.com> | |
18 | ||
19 | */ | |
20 | ||
21 | #ifndef _PVE_STATUS_H_ | |
22 | #define _PVE_STATUS_H_ | |
23 | ||
24 | #include <glib.h> | |
25 | ||
26 | #include "dfsm.h" | |
27 | #include "logger.h" | |
28 | ||
29 | #define VMTYPE_QEMU 1 | |
30 | #define VMTYPE_OPENVZ 2 | |
7f66b436 | 31 | #define VMTYPE_LXC 3 |
fe000966 DM |
32 | |
33 | #define CFS_MAX_STATUS_SIZE (32*1024) | |
34 | ||
35 | typedef struct cfs_clnode cfs_clnode_t; | |
36 | typedef struct cfs_clinfo cfs_clinfo_t; | |
37 | ||
38 | void | |
39 | cfs_status_init(void); | |
40 | ||
41 | void | |
42 | cfs_status_cleanup(void); | |
43 | ||
44 | dfsm_t * | |
45 | cfs_status_dfsm_new(void); | |
46 | ||
47 | void | |
48 | cfs_cluster_log(clog_entry_t *entry); | |
49 | ||
50 | void | |
51 | cfs_cluster_log_dump( | |
52 | GString *str, | |
53 | const char *user, | |
54 | guint max_entries); | |
55 | ||
56 | void | |
57 | cfs_rrd_dump(GString *str); | |
58 | ||
59 | int | |
60 | cfs_status_set( | |
61 | const char *key, | |
62 | gpointer data, | |
63 | size_t len); | |
64 | ||
65 | void | |
66 | cfs_status_set_clinfo( | |
67 | cfs_clinfo_t *clinfo); | |
68 | ||
69 | void | |
70 | cfs_status_set_vmlist( | |
71 | GHashTable *vmlist); | |
72 | ||
73 | cfs_clnode_t * | |
74 | cfs_clnode_new( | |
75 | const char *name, | |
76 | uint32_t nodeid, | |
77 | uint32_t votes); | |
78 | ||
79 | void | |
80 | cfs_clnode_destroy( | |
81 | cfs_clnode_t *clnode); | |
82 | ||
83 | cfs_clinfo_t * | |
84 | cfs_clinfo_new( | |
85 | const char *cluster_name, | |
86 | uint32_t cman_version); | |
87 | ||
88 | gboolean | |
89 | cfs_clinfo_destroy( | |
90 | cfs_clinfo_t *clinfo); | |
91 | ||
92 | gboolean | |
93 | cfs_clinfo_add_node( | |
94 | cfs_clinfo_t *clinfo, | |
95 | cfs_clnode_t *clnode); | |
96 | ||
97 | void | |
98 | cfs_set_quorate( | |
99 | uint32_t quorate, | |
100 | gboolean quiet); | |
101 | ||
102 | gboolean | |
103 | cfs_is_quorate(void); | |
104 | ||
105 | GHashTable * | |
106 | vmlist_hash_new(void); | |
107 | ||
108 | gboolean | |
109 | vmlist_hash_insert_vm( | |
110 | GHashTable *vmlist, | |
111 | int vmtype, | |
112 | guint32 vmid, | |
113 | const char *nodename, | |
114 | gboolean replace); | |
115 | ||
116 | void | |
117 | vmlist_register_vm( | |
118 | int vmtype, | |
119 | guint32 vmid, | |
120 | const char *nodename); | |
121 | ||
122 | void | |
123 | vmlist_delete_vm( | |
124 | guint32 vmid); | |
125 | ||
126 | gboolean | |
127 | vmlist_vm_exists( | |
128 | guint32 vmid); | |
129 | ||
130 | gboolean | |
131 | vmlist_different_vm_exists( | |
132 | int vmtype, | |
133 | guint32 vmid, | |
134 | const char *nodename); | |
135 | ||
136 | void | |
137 | record_memdb_change(const char *path); | |
138 | ||
139 | void | |
140 | record_memdb_reload(void); | |
141 | ||
142 | ||
143 | int | |
144 | cfs_create_status_msg( | |
145 | GString *str, | |
146 | const char *nodename, | |
147 | const char *key); | |
148 | ||
149 | int | |
150 | cfs_create_version_msg( | |
151 | GString *str); | |
152 | ||
153 | int | |
154 | cfs_create_vmlist_msg( | |
155 | GString *str); | |
156 | ||
157 | int | |
158 | cfs_create_memberlist_msg( | |
159 | GString *str); | |
160 | ||
161 | ||
162 | #endif /* _PVE_STATUS_H_ */ |