lxc_conf.h 2.1 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 26 27 28 29 30
 * 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
#define LXC_CONF_H

#include <config.h>

#include "internal.h"
31
#include "domain_conf.h"
32
#include "domain_event.h"
33
#include "capabilities.h"
34
#include "threads.h"
35
#include "cgroup.h"
D
Daniel Veillard 已提交
36

37 38 39
#define LXC_CONFIG_DIR SYSCONF_DIR "/libvirt/lxc"
#define LXC_STATE_DIR LOCAL_STATE_DIR "/run/libvirt/lxc"
#define LXC_LOG_DIR LOCAL_STATE_DIR "/log/libvirt/lxc"
40
#define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart"
41

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

46 47
    virCapsPtr caps;

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

    /* An array of callbacks */
    virDomainEventCallbackListPtr domainEventCallbacks;
    virDomainEventQueuePtr domainEventQueue;
    int domainEventTimer;
    int domainEventDispatching;
D
Daniel Veillard 已提交
62 63
};

64
int lxcLoadDriverConfig(lxc_driver_t *driver);
65
virCapsPtr lxcCapsInit(void);
D
Daniel Veillard 已提交
66

67
#define lxcError(code, ...)                                             \
68
    virReportErrorHelper(NULL, VIR_FROM_LXC, code, __FILE__,            \
69
                         __FUNCTION__, __LINE__, __VA_ARGS__)
D
Daniel Veillard 已提交
70 71

#endif /* LXC_CONF_H */