2007-07-17 13:27:26 +00:00
|
|
|
/*
|
2014-03-07 13:38:51 +00:00
|
|
|
* openvz_conf.h: config information for OpenVZ VPSs
|
2007-07-17 13:27:26 +00:00
|
|
|
*
|
2010-03-01 23:38:28 +00:00
|
|
|
* Copyright (C) 2010 Red Hat, Inc.
|
2007-07-17 13:27:26 +00:00
|
|
|
* Copyright (C) 2006, 2007 Binary Karma.
|
|
|
|
* Copyright (C) 2006 Shuveb Hussain
|
2007-09-03 15:37:07 +00:00
|
|
|
* Copyright (C) 2007 Anoop Joe Cyriac
|
2007-07-17 13:27:26 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2007-07-17 13:27:26 +00:00
|
|
|
*
|
2008-02-05 19:27:37 +00:00
|
|
|
* Authors:
|
2007-09-03 15:37:07 +00:00
|
|
|
* Shuveb Hussain <shuveb@binarykarma.com>
|
|
|
|
* Anoop Joe Cyriac <anoop@binarykarma.com>
|
|
|
|
*
|
2007-07-17 13:27:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OPENVZ_CONF_H
|
2010-03-09 18:22:22 +00:00
|
|
|
# define OPENVZ_CONF_H
|
2007-07-17 13:27:26 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "internal.h"
|
2015-07-17 09:11:23 +00:00
|
|
|
# include "virdomainobjlist.h"
|
2012-12-13 15:49:48 +00:00
|
|
|
# include "virthread.h"
|
2007-07-17 13:27:26 +00:00
|
|
|
|
2008-10-09 15:38:31 +00:00
|
|
|
|
2008-09-05 14:10:58 +00:00
|
|
|
/* OpenVZ commands - Replace with wrapper scripts later? */
|
2014-09-05 02:25:06 +00:00
|
|
|
# define VZLIST "/usr/sbin/vzlist"
|
|
|
|
# define VZCTL "/usr/sbin/vzctl"
|
|
|
|
# define VZMIGRATE "/usr/sbin/vzmigrate"
|
|
|
|
# define VZ_CONF_FILE "/etc/vz/vz.conf"
|
2008-09-05 14:10:58 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# define VZCTL_BRIDGE_MIN_VERSION ((3 * 1000 * 1000) + (0 * 1000) + 22 + 1)
|
2008-11-12 16:35:47 +00:00
|
|
|
|
2008-09-05 14:10:58 +00:00
|
|
|
struct openvz_driver {
|
2009-01-15 19:56:05 +00:00
|
|
|
virMutex lock;
|
2008-12-04 21:44:55 +00:00
|
|
|
|
2008-09-05 14:10:58 +00:00
|
|
|
virCapsPtr caps;
|
2013-03-31 18:03:42 +00:00
|
|
|
virDomainXMLOptionPtr xmlopt;
|
2013-01-11 16:04:47 +00:00
|
|
|
virDomainObjListPtr domains;
|
2008-10-24 11:32:48 +00:00
|
|
|
int version;
|
2007-07-17 13:27:26 +00:00
|
|
|
};
|
|
|
|
|
2011-05-31 12:58:58 +00:00
|
|
|
typedef int (*openvzLocateConfFileFunc)(int vpsid, char **conffile, const char *ext);
|
|
|
|
|
|
|
|
/* this allows the testsuite to replace the conf file locator function */
|
|
|
|
extern openvzLocateConfFileFunc openvzLocateConfFile;
|
|
|
|
|
2007-07-19 16:22:40 +00:00
|
|
|
int openvz_readline(int fd, char *ptr, int maxlen);
|
2010-04-03 14:23:45 +00:00
|
|
|
int openvzExtractVersion(struct openvz_driver *driver);
|
2011-04-03 09:21:26 +00:00
|
|
|
int openvzReadVPSConfigParam(int vpsid, const char *param, char **value);
|
2009-03-24 10:59:13 +00:00
|
|
|
int openvzWriteVPSConfigParam(int vpsid, const char *param, const char *value);
|
2011-05-26 17:45:41 +00:00
|
|
|
int openvzReadConfigParam(const char *conf_file, const char *param, char **value);
|
2009-03-24 10:59:13 +00:00
|
|
|
int openvzCopyDefaultConfig(int vpsid);
|
2008-09-05 14:10:58 +00:00
|
|
|
virCapsPtr openvzCapsInit(void);
|
|
|
|
int openvzLoadDomains(struct openvz_driver *driver);
|
2007-09-03 15:37:07 +00:00
|
|
|
void openvzFreeDriver(struct openvz_driver *driver);
|
2007-09-03 16:30:00 +00:00
|
|
|
int strtoI(const char *str);
|
2008-08-05 10:53:05 +00:00
|
|
|
int openvzSetDefinedUUID(int vpsid, unsigned char *uuid);
|
2008-11-24 19:34:21 +00:00
|
|
|
unsigned int openvzGetNodeCPUs(void);
|
2010-02-19 15:49:56 +00:00
|
|
|
int openvzGetVEID(const char *name);
|
2011-05-31 12:58:58 +00:00
|
|
|
int openvzReadNetworkConf(virDomainDefPtr def, int veid);
|
2008-07-28 14:06:54 +00:00
|
|
|
|
2007-07-17 13:27:26 +00:00
|
|
|
#endif /* OPENVZ_CONF_H */
|