lxc_conf.h 2.4 KB
Newer Older
D
Daniel Veillard 已提交
1
/*
2
 * Copyright (C) 2010 Red Hat, Inc.
D
Daniel Veillard 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 * Copyright IBM Corp. 2008
 *
 * lxc_conf.h: header file for linux container config functions
 *
 * Authors:
 *  David L. Leskovec <dlesko at linux.vnet.ibm.com>
 *
 * 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
 */

#ifndef LXC_CONF_H
26
# define LXC_CONF_H
D
Daniel Veillard 已提交
27

28
# include <config.h>
D
Daniel Veillard 已提交
29

30 31 32 33 34 35
# include "internal.h"
# include "domain_conf.h"
# include "domain_event.h"
# include "capabilities.h"
# include "threads.h"
# include "cgroup.h"
36
# include "security/security_manager.h"
37
# include "configmake.h"
D
Daniel Veillard 已提交
38

39 40 41
# define LXC_CONFIG_DIR SYSCONFDIR "/libvirt/lxc"
# define LXC_STATE_DIR LOCALSTATEDIR "/run/libvirt/lxc"
# define LXC_LOG_DIR LOCALSTATEDIR "/log/libvirt/lxc"
42
# define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart"
43

D
Daniel Veillard 已提交
44 45
typedef struct __lxc_driver lxc_driver_t;
struct __lxc_driver {
46
    virMutex lock;
47

48 49
    virCapsPtr caps;

50
    virCgroupPtr cgroup;
51
    virDomainObjList domains;
52
    char *configDir;
53
    char *autostartDir;
54 55
    char *stateDir;
    char *logDir;
A
Amy Griffis 已提交
56
    int log_libvirtd;
57
    int have_netns;
58

59
    virDomainEventStatePtr domainEventState;
60

61 62 63 64 65
    char *securityDriverName;
    bool securityDefaultConfined;
    bool securityRequireConfined;
    virSecurityManagerPtr securityManager;

66 67 68 69
    /* Mapping of 'char *uuidstr' -> virConnectPtr
     * of guests which will be automatically killed
     * when the virConnectPtr is closed*/
    virHashTablePtr autodestroy;
D
Daniel Veillard 已提交
70 71
};

72
int lxcLoadDriverConfig(lxc_driver_t *driver);
73
virCapsPtr lxcCapsInit(lxc_driver_t *driver);
D
Daniel Veillard 已提交
74

75
# define lxcError(code, ...)                                             \
76
    virReportErrorHelper(VIR_FROM_LXC, code, __FILE__,                   \
77
                         __FUNCTION__, __LINE__, __VA_ARGS__)
D
Daniel Veillard 已提交
78 79

#endif /* LXC_CONF_H */