2007-07-17 13:27:26 +00:00
|
|
|
/*
|
|
|
|
* openvz_config.h: config information for OpenVZ VPSs
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
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
|
|
|
|
#define OPENVZ_CONF_H
|
|
|
|
|
2008-09-05 14:10:58 +00:00
|
|
|
#include "internal.h"
|
2008-07-28 14:06:54 +00:00
|
|
|
#include "domain_conf.h"
|
2007-07-17 13:27:26 +00:00
|
|
|
|
2007-09-03 15:37:07 +00:00
|
|
|
enum { OPENVZ_WARN, OPENVZ_ERR };
|
|
|
|
|
2008-09-05 14:10:58 +00:00
|
|
|
#define openvzLog(level, msg...) { if(level == OPENVZ_WARN) \
|
|
|
|
fprintf(stderr, "\nWARNING: ");\
|
|
|
|
else \
|
|
|
|
fprintf(stderr, "\nERROR: ");\
|
|
|
|
fprintf(stderr, "\n\t");\
|
|
|
|
fprintf(stderr, msg);\
|
|
|
|
fprintf(stderr, "\n"); }
|
|
|
|
|
2008-10-09 15:38:31 +00:00
|
|
|
#define openvzError(conn, code, fmt...) \
|
|
|
|
__virReportErrorHelper(conn, VIR_FROM_OPENVZ, code, __FILE__, \
|
|
|
|
__FUNCTION__, __LINE__, fmt)
|
|
|
|
|
|
|
|
|
2008-09-05 14:10:58 +00:00
|
|
|
/* OpenVZ commands - Replace with wrapper scripts later? */
|
|
|
|
#define VZLIST "vzlist"
|
|
|
|
#define VZCTL "vzctl"
|
|
|
|
|
|
|
|
struct openvz_driver {
|
|
|
|
virCapsPtr caps;
|
|
|
|
virDomainObjPtr domains;
|
2007-07-17 13:27:26 +00:00
|
|
|
};
|
|
|
|
|
2007-07-19 16:22:40 +00:00
|
|
|
int openvz_readline(int fd, char *ptr, int maxlen);
|
2008-07-10 07:52:14 +00:00
|
|
|
int openvzReadConfigParam(int vpsid ,const char * param, char *value, int maxlen);
|
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-07-28 14:06:54 +00:00
|
|
|
int openvzCheckEmptyMac(const unsigned char *mac);
|
|
|
|
char *openvzMacToString(const unsigned char *mac);
|
2008-08-05 10:53:05 +00:00
|
|
|
int openvzSetDefinedUUID(int vpsid, unsigned char *uuid);
|
2008-07-28 14:06:54 +00:00
|
|
|
|
2007-07-17 13:27:26 +00:00
|
|
|
#endif /* OPENVZ_CONF_H */
|