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

#ifndef OPENVZ_CONF_H
30
# define OPENVZ_CONF_H
31

32 33 34
# include "internal.h"
# include "domain_conf.h"
# include "threads.h"
35

36

37
/* OpenVZ commands - Replace with wrapper scripts later? */
38 39 40
# define VZLIST  "/usr/sbin/vzlist"
# define VZCTL   "/usr/sbin/vzctl"
# define VZ_CONF_FILE "/etc/vz/vz.conf"
41

42
# define VZCTL_BRIDGE_MIN_VERSION ((3 * 1000 * 1000) + (0 * 1000) + 22 + 1)
43

44
struct openvz_driver {
45
    virMutex lock;
46

47
    virCapsPtr caps;
48
    virDomainObjList domains;
49
    int version;
50 51
};

52 53 54 55 56
typedef int (*openvzLocateConfFileFunc)(int vpsid, char **conffile, const char *ext);

/* this allows the testsuite to replace the conf file locator function */
extern openvzLocateConfFileFunc openvzLocateConfFile;

57
int openvz_readline(int fd, char *ptr, int maxlen);
58
int openvzExtractVersion(struct openvz_driver *driver);
59
int openvzReadVPSConfigParam(int vpsid, const char *param, char **value);
60
int openvzWriteVPSConfigParam(int vpsid, const char *param, const char *value);
61
int openvzReadConfigParam(const char *conf_file, const char *param, char **value);
62
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);
69
int openvzGetVEID(const char *name);
70
int openvzReadNetworkConf(virDomainDefPtr def, int veid);
D
Daniel Veillard 已提交
71

72
#endif /* OPENVZ_CONF_H */