]> git.proxmox.com Git - pve-cluster.git/blame - data/src/status.h
restart pve-cluster.service on failure
[pve-cluster.git] / data / src / status.h
CommitLineData
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
35typedef struct cfs_clnode cfs_clnode_t;
36typedef struct cfs_clinfo cfs_clinfo_t;
37
38void
39cfs_status_init(void);
40
41void
42cfs_status_cleanup(void);
43
44dfsm_t *
45cfs_status_dfsm_new(void);
46
47void
48cfs_cluster_log(clog_entry_t *entry);
49
50void
51cfs_cluster_log_dump(
52 GString *str,
53 const char *user,
54 guint max_entries);
55
56void
57cfs_rrd_dump(GString *str);
58
59int
60cfs_status_set(
61 const char *key,
62 gpointer data,
63 size_t len);
64
65void
66cfs_status_set_clinfo(
67 cfs_clinfo_t *clinfo);
68
69void
70cfs_status_set_vmlist(
71 GHashTable *vmlist);
72
73cfs_clnode_t *
74cfs_clnode_new(
75 const char *name,
76 uint32_t nodeid,
77 uint32_t votes);
78
79void
80cfs_clnode_destroy(
81 cfs_clnode_t *clnode);
82
83cfs_clinfo_t *
84cfs_clinfo_new(
85 const char *cluster_name,
86 uint32_t cman_version);
87
88gboolean
89cfs_clinfo_destroy(
90 cfs_clinfo_t *clinfo);
91
92gboolean
93cfs_clinfo_add_node(
94 cfs_clinfo_t *clinfo,
95 cfs_clnode_t *clnode);
96
97void
98cfs_set_quorate(
99 uint32_t quorate,
100 gboolean quiet);
101
102gboolean
103cfs_is_quorate(void);
104
105GHashTable *
106vmlist_hash_new(void);
107
108gboolean
109vmlist_hash_insert_vm(
110 GHashTable *vmlist,
111 int vmtype,
112 guint32 vmid,
113 const char *nodename,
114 gboolean replace);
115
116void
117vmlist_register_vm(
118 int vmtype,
119 guint32 vmid,
120 const char *nodename);
121
122void
123vmlist_delete_vm(
124 guint32 vmid);
125
126gboolean
127vmlist_vm_exists(
128 guint32 vmid);
129
130gboolean
131vmlist_different_vm_exists(
132 int vmtype,
133 guint32 vmid,
134 const char *nodename);
135
136void
137record_memdb_change(const char *path);
138
139void
140record_memdb_reload(void);
141
142
143int
144cfs_create_status_msg(
145 GString *str,
146 const char *nodename,
147 const char *key);
148
149int
150cfs_create_version_msg(
151 GString *str);
152
153int
154cfs_create_vmlist_msg(
155 GString *str);
156
157int
158cfs_create_memberlist_msg(
159 GString *str);
160
161
162#endif /* _PVE_STATUS_H_ */