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