]>
git.proxmox.com Git - pve-cluster.git/blob - data/src/cfs-utils.h
2 Copyright (C) 2010 Proxmox Server Solutions GmbH
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.
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.
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/>.
17 Author: Dietmar Maurer <dietmar@proxmox.com>
21 #ifndef _PVE_CFS_UTILS_H_
22 #define _PVE_CFS_UTILS_H_
26 #endif /* HAVE_CONFIG_H */
32 #define HOST_CLUSTER_CONF_FN "/etc/corosync/corosync.conf"
33 #define CFS_PID_FN "/var/run/pve-cluster.pid"
34 #define VARLIBDIR "/var/lib/pve-cluster"
36 #define CFS_MAX(a, b) (((a) > (b)) ? (a) : (b))
37 #define CFS_MIN(a, b) (((a) < (b)) ? (a) : (b))
57 const gchar
*log_domain
,
58 GLogLevelFlags log_level
,
63 ...) G_GNUC_PRINTF (6, 7);
72 #define cfs_debug(...) G_STMT_START { \
74 cfs_log(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __FILE__, __LINE__, G_STRFUNC, __VA_ARGS__); \
77 #define cfs_dom_debug(domain, ...) G_STMT_START { \
79 cfs_log(domain, G_LOG_LEVEL_DEBUG, __FILE__, __LINE__, G_STRFUNC, __VA_ARGS__); \
82 #define cfs_critical(...) cfs_log(G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, __FILE__, __LINE__, G_STRFUNC, __VA_ARGS__)
83 #define cfs_dom_critical(domain, ...) cfs_log(domain, G_LOG_LEVEL_CRITICAL, __FILE__, __LINE__, G_STRFUNC, __VA_ARGS__)
84 #define cfs_message(...) cfs_log(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, __FILE__, __LINE__, G_STRFUNC, __VA_ARGS__)
85 #define cfs_dom_message(domain, ...) cfs_log(domain, G_LOG_LEVEL_MESSAGE, __FILE__, __LINE__, G_STRFUNC, __VA_ARGS__)
88 cluster_config_version(
89 const gpointer config_data
,
106 const char *filename
,
113 path_is_private(const char *path
);
116 path_is_lxc_conf(const char *path
);
119 path_is_lockdir(const char *path
);
121 #endif /* _PVE_CFS_UTILS_H_ */