openvz_conf.h 2.3 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
#include "threads.h"
34

35 36
enum { OPENVZ_WARN, OPENVZ_ERR };

37
#define openvzError(conn, code, fmt...)                                      \
38
        virReportErrorHelper(conn, VIR_FROM_OPENVZ, code, __FILE__,        \
39 40 41
                               __FUNCTION__, __LINE__, fmt)


42
/* OpenVZ commands - Replace with wrapper scripts later? */
43 44
#define VZLIST  "/usr/sbin/vzlist"
#define VZCTL   "/usr/sbin/vzctl"
45
#define VZ_CONF_FILE "/etc/vz/vz.conf"
46

47 48
#define VZCTL_BRIDGE_MIN_VERSION ((3 * 1000 * 1000) + (0 * 1000) + 22 + 1)

49
struct openvz_driver {
50
    virMutex lock;
51

52
    virCapsPtr caps;
53
    virDomainObjList domains;
54
    int version;
55 56
};

57
int openvz_readline(int fd, char *ptr, int maxlen);
58 59
int openvzExtractVersion(virConnectPtr conn,
                         struct openvz_driver *driver);
60 61 62
int openvzReadVPSConfigParam(int vpsid ,const char * param, char *value, int maxlen);
int openvzWriteVPSConfigParam(int vpsid, const char *param, const char *value);
int openvzCopyDefaultConfig(int vpsid);
63 64
virCapsPtr openvzCapsInit(void);
int openvzLoadDomains(struct openvz_driver *driver);
65
void openvzFreeDriver(struct openvz_driver *driver);
66
int strtoI(const char *str);
67
int openvzSetDefinedUUID(int vpsid, unsigned char *uuid);
68
unsigned int openvzGetNodeCPUs(void);
D
Daniel Veillard 已提交
69

70
#endif /* OPENVZ_CONF_H */