2008-03-21 15:03:37 +00:00
|
|
|
/*
|
2010-03-01 23:38:28 +00:00
|
|
|
* Copyright (C) 2010 Red Hat, Inc.
|
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
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2008-03-21 15:03:37 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LXC_CONF_H
|
2010-03-09 18:22:22 +00:00
|
|
|
# define LXC_CONF_H
|
2008-03-21 15:03:37 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include <config.h>
|
2008-03-21 15:03:37 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "internal.h"
|
|
|
|
# include "domain_conf.h"
|
|
|
|
# include "domain_event.h"
|
|
|
|
# include "capabilities.h"
|
|
|
|
# include "threads.h"
|
2012-12-03 15:03:47 +00:00
|
|
|
# include "vircgroup.h"
|
2012-01-25 14:12:53 +00:00
|
|
|
# include "security/security_manager.h"
|
2010-11-16 14:54:17 +00:00
|
|
|
# include "configmake.h"
|
2012-12-12 17:04:51 +00:00
|
|
|
# include "virusb.h"
|
2008-03-21 15:03:37 +00:00
|
|
|
|
2012-05-10 16:49:29 +00:00
|
|
|
# define LXC_DRIVER_NAME "LXC"
|
|
|
|
|
2010-11-16 14:54:17 +00:00
|
|
|
# define LXC_CONFIG_DIR SYSCONFDIR "/libvirt/lxc"
|
|
|
|
# define LXC_STATE_DIR LOCALSTATEDIR "/run/libvirt/lxc"
|
|
|
|
# define LXC_LOG_DIR LOCALSTATEDIR "/log/libvirt/lxc"
|
2010-03-09 18:22:22 +00:00
|
|
|
# define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart"
|
2008-08-20 20:55:32 +00:00
|
|
|
|
2012-07-13 11:56:29 +00:00
|
|
|
typedef struct _virLXCDriver virLXCDriver;
|
|
|
|
typedef virLXCDriver *virLXCDriverPtr;
|
|
|
|
|
|
|
|
struct _virLXCDriver {
|
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;
|
2012-10-31 19:03:55 +00:00
|
|
|
|
|
|
|
size_t nactive;
|
|
|
|
virStateInhibitCallback inhibitCallback;
|
|
|
|
void *inhibitOpaque;
|
|
|
|
|
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;
|
2009-10-08 15:40:14 +00:00
|
|
|
int log_libvirtd;
|
2008-06-26 16:05:02 +00:00
|
|
|
int have_netns;
|
2009-07-06 15:04:36 +00:00
|
|
|
|
2012-11-23 14:46:18 +00:00
|
|
|
usbDeviceList *activeUsbHostdevs;
|
|
|
|
|
2011-01-06 17:42:12 +00:00
|
|
|
virDomainEventStatePtr domainEventState;
|
2011-07-13 11:21:54 +00:00
|
|
|
|
2012-01-25 14:12:53 +00:00
|
|
|
char *securityDriverName;
|
|
|
|
bool securityDefaultConfined;
|
|
|
|
bool securityRequireConfined;
|
|
|
|
virSecurityManagerPtr securityManager;
|
|
|
|
|
2011-07-13 11:21:54 +00:00
|
|
|
/* Mapping of 'char *uuidstr' -> virConnectPtr
|
|
|
|
* of guests which will be automatically killed
|
|
|
|
* when the virConnectPtr is closed*/
|
|
|
|
virHashTablePtr autodestroy;
|
2008-03-21 15:03:37 +00:00
|
|
|
};
|
|
|
|
|
2012-07-13 11:56:29 +00:00
|
|
|
int lxcLoadDriverConfig(virLXCDriverPtr driver);
|
|
|
|
virCapsPtr lxcCapsInit(virLXCDriverPtr driver);
|
2008-03-21 15:03:37 +00:00
|
|
|
|
2012-07-13 11:56:29 +00:00
|
|
|
static inline void lxcDriverLock(virLXCDriverPtr driver)
|
2012-07-13 11:39:29 +00:00
|
|
|
{
|
|
|
|
virMutexLock(&driver->lock);
|
|
|
|
}
|
2012-07-13 11:56:29 +00:00
|
|
|
static inline void lxcDriverUnlock(virLXCDriverPtr driver)
|
2012-07-13 11:39:29 +00:00
|
|
|
{
|
|
|
|
virMutexUnlock(&driver->lock);
|
|
|
|
}
|
|
|
|
|
2008-03-21 15:03:37 +00:00
|
|
|
#endif /* LXC_CONF_H */
|