openvz_conf.h 2.4 KB
Newer Older
1 2 3 4 5
/*
 * openvz_config.h: config information for OpenVZ VPSs
 *
 * Copyright (C) 2006, 2007 Binary Karma.
 * Copyright (C) 2006 Shuveb Hussain
6
 * Copyright (C) 2007 Anoop Joe Cyriac
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 *
 * 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
 *
22
 * Authors:
23 24 25
 * Shuveb Hussain <shuveb@binarykarma.com>
 * Anoop Joe Cyriac <anoop@binarykarma.com>
 *
26 27 28 29 30
 */

#ifndef OPENVZ_CONF_H
#define OPENVZ_CONF_H

31
#include "internal.h"
D
Daniel Veillard 已提交
32
#include "domain_conf.h"
33

34 35
enum { OPENVZ_WARN, OPENVZ_ERR };

36 37 38 39 40 41 42 43
#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"); }

44 45 46 47 48
#define openvzError(conn, code, fmt...)                                      \
        __virReportErrorHelper(conn, VIR_FROM_OPENVZ, code, __FILE__,        \
                               __FUNCTION__, __LINE__, fmt)


49 50 51 52 53 54 55
/* OpenVZ commands - Replace with wrapper scripts later? */
#define VZLIST  "vzlist"
#define VZCTL   "vzctl"

struct openvz_driver {
    virCapsPtr caps;
    virDomainObjPtr domains;
56 57
};

58
int openvz_readline(int fd, char *ptr, int maxlen);
59
int openvzReadConfigParam(int vpsid ,const char * param, char *value, int maxlen);
60 61
virCapsPtr openvzCapsInit(void);
int openvzLoadDomains(struct openvz_driver *driver);
62
void openvzFreeDriver(struct openvz_driver *driver);
63
int strtoI(const char *str);
D
Daniel Veillard 已提交
64 65
int openvzCheckEmptyMac(const unsigned char *mac);
char *openvzMacToString(const unsigned char *mac);
66
int openvzSetDefinedUUID(int vpsid, unsigned char *uuid);
D
Daniel Veillard 已提交
67

68
#endif /* OPENVZ_CONF_H */