openvz_conf.h 2.5 KB
Newer Older
1
/*
2
 * openvz_conf.h: config information for OpenVZ VPSs
3
 *
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
 *
 * 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
20
 * License along with this library.  If not, see
O
Osier Yang 已提交
21
 * <http://www.gnu.org/licenses/>.
22
 *
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
# include "internal.h"
33
# include "virdomainobjlist.h"
34
# include "virthread.h"
35

36

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

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

45
struct openvz_driver {
46
    virMutex lock;
47

48
    virCapsPtr caps;
49
    virDomainXMLOptionPtr xmlopt;
50
    virDomainObjListPtr domains;
51
    int version;
52 53
};

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

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

59
int openvz_readline(int fd, char *ptr, int maxlen);
60
int openvzExtractVersion(struct openvz_driver *driver);
61
int openvzReadVPSConfigParam(int vpsid, const char *param, char **value);
62
int openvzWriteVPSConfigParam(int vpsid, const char *param, const char *value);
63
int openvzReadConfigParam(const char *conf_file, const char *param, char **value);
64
int openvzCopyDefaultConfig(int vpsid);
65 66
virCapsPtr openvzCapsInit(void);
int openvzLoadDomains(struct openvz_driver *driver);
67
void openvzFreeDriver(struct openvz_driver *driver);
68
int strtoI(const char *str);
69
int openvzSetDefinedUUID(int vpsid, unsigned char *uuid);
70
int openvzGetVEID(const char *name);
71
int openvzReadNetworkConf(virDomainDefPtr def, int veid);
D
Daniel Veillard 已提交
72

73
#endif /* OPENVZ_CONF_H */