libvirt/src/lxc/lxc_conf.h
Eric Blake 1add9c78da maint: don't use config.h in .h files
Enforce the rule that .h files don't need to (redundantly)
include <config.h>.

* cfg.mk (sc_prohibit_config_h_in_headers): New rule.
(_virsh_includes): Delete; instead, inline a smaller number of
exclusions...
(exclude_file_name_regexp--sc_require_config_h)
(exclude_file_name_regexp--sc_require_config_h_first): ...here.
* daemon/libvirtd.h (includes): Fix offenders.
* src/driver.h (includes): Likewise.
* src/gnutls_1_0_compat.h (includes): Likewise.
* src/libxl/libxl_conf.h (includes): Likewise.
* src/libxl/libxl_driver.h (includes): Likewise.
* src/lxc/lxc_conf.h (includes): Likewise.
* src/lxc/lxc_driver.h (includes): Likewise.
* src/lxc/lxc_fuse.h (includes): Likewise.
* src/network/bridge_driver.h (includes): Likewise.
* src/phyp/phyp_driver.h (includes): Likewise.
* src/qemu/qemu_conf.h (includes): Likewise.
* src/util/virnetlink.h (includes): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-06-05 05:53:25 -06:00

100 lines
2.6 KiB
C

/*
* Copyright (C) 2010, 2013 Red Hat, Inc.
* 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, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef LXC_CONF_H
# define LXC_CONF_H
# include "internal.h"
# include "domain_conf.h"
# include "domain_event.h"
# include "capabilities.h"
# include "virthread.h"
# include "security/security_manager.h"
# include "configmake.h"
# include "vircgroup.h"
# include "virsysinfo.h"
# include "virusb.h"
# define LXC_DRIVER_NAME "LXC"
# define LXC_CONFIG_DIR SYSCONFDIR "/libvirt/lxc"
# define LXC_STATE_DIR LOCALSTATEDIR "/run/libvirt/lxc"
# define LXC_LOG_DIR LOCALSTATEDIR "/log/libvirt/lxc"
# define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart"
typedef struct _virLXCDriver virLXCDriver;
typedef virLXCDriver *virLXCDriverPtr;
struct _virLXCDriver {
virMutex lock;
virCapsPtr caps;
virDomainXMLOptionPtr xmlopt;
virCgroupPtr cgroup;
virSysinfoDefPtr hostsysinfo;
size_t nactive;
virStateInhibitCallback inhibitCallback;
void *inhibitOpaque;
virDomainObjListPtr domains;
char *configDir;
char *autostartDir;
char *stateDir;
char *logDir;
int log_libvirtd;
int have_netns;
virUSBDeviceListPtr activeUsbHostdevs;
virDomainEventStatePtr domainEventState;
char *securityDriverName;
bool securityDefaultConfined;
bool securityRequireConfined;
virSecurityManagerPtr securityManager;
/* Mapping of 'char *uuidstr' -> virConnectPtr
* of guests which will be automatically killed
* when the virConnectPtr is closed*/
virHashTablePtr autodestroy;
};
int lxcLoadDriverConfig(virLXCDriverPtr driver);
virCapsPtr lxcCapsInit(virLXCDriverPtr driver);
virDomainXMLOptionPtr lxcDomainXMLConfInit(void);
static inline void lxcDriverLock(virLXCDriverPtr driver)
{
virMutexLock(&driver->lock);
}
static inline void lxcDriverUnlock(virLXCDriverPtr driver)
{
virMutexUnlock(&driver->lock);
}
#endif /* LXC_CONF_H */