2008-03-21 15:03:37 +00:00
|
|
|
/*
|
|
|
|
* 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"
|
2008-08-13 12:50:55 +00:00
|
|
|
#include "domain_conf.h"
|
2009-07-06 15:04:36 +00:00
|
|
|
#include "domain_event.h"
|
2008-08-13 12:50:55 +00:00
|
|
|
#include "capabilities.h"
|
2009-01-15 19:56:05 +00:00
|
|
|
#include "threads.h"
|
2009-07-10 10:40:04 +00:00
|
|
|
#include "cgroup.h"
|
2008-03-21 15:03:37 +00:00
|
|
|
|
2008-08-20 20:55:32 +00:00
|
|
|
#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"
|
|
|
|
|
2008-03-21 15:03:37 +00:00
|
|
|
typedef struct __lxc_driver lxc_driver_t;
|
|
|
|
struct __lxc_driver {
|
2009-01-15 19:56:05 +00:00
|
|
|
virMutex lock;
|
2008-12-04 21:12:41 +00:00
|
|
|
|
2008-08-13 12:50:55 +00:00
|
|
|
virCapsPtr caps;
|
|
|
|
|
2009-07-10 10:40:04 +00:00
|
|
|
virCgroupPtr cgroup;
|
2008-10-10 14:20:37 +00:00
|
|
|
virDomainObjList domains;
|
2008-08-13 10:52:15 +00:00
|
|
|
char *configDir;
|
2008-08-13 12:50:55 +00:00
|
|
|
char *autostartDir;
|
2008-08-13 10:52:15 +00:00
|
|
|
char *stateDir;
|
|
|
|
char *logDir;
|
2008-06-26 16:05:02 +00:00
|
|
|
int have_netns;
|
2009-07-06 15:04:36 +00:00
|
|
|
|
|
|
|
/* An array of callbacks */
|
|
|
|
virDomainEventCallbackListPtr domainEventCallbacks;
|
|
|
|
virDomainEventQueuePtr domainEventQueue;
|
|
|
|
int domainEventTimer;
|
|
|
|
int domainEventDispatching;
|
2008-03-21 15:03:37 +00:00
|
|
|
};
|
|
|
|
|
2008-03-27 09:34:06 +00:00
|
|
|
int lxcLoadDriverConfig(lxc_driver_t *driver);
|
2008-08-13 12:50:55 +00:00
|
|
|
virCapsPtr lxcCapsInit(void);
|
2008-03-21 15:03:37 +00:00
|
|
|
|
2008-10-09 15:38:31 +00:00
|
|
|
#define lxcError(conn, dom, code, fmt...) \
|
2008-11-04 22:30:33 +00:00
|
|
|
virReportErrorHelper(conn, VIR_FROM_LXC, code, __FILE__, \
|
2008-10-09 15:38:31 +00:00
|
|
|
__FUNCTION__, __LINE__, fmt)
|
2008-03-21 15:03:37 +00:00
|
|
|
|
|
|
|
#endif /* LXC_CONF_H */
|