提交 bef4af0e 编写于 作者: J Jonathon Jongsma 提交者: Ján Tomko

src/lxc: use #pragma once in headers

Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
Signed-off-by: NJán Tomko <jtomko@redhat.com>
上级 91d16fdb
...@@ -19,13 +19,12 @@ ...@@ -19,13 +19,12 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_LXC_CGROUP_H #pragma once
# define LIBVIRT_LXC_CGROUP_H
# include "vircgroup.h" #include "vircgroup.h"
# include "domain_conf.h" #include "domain_conf.h"
# include "lxc_fuse.h" #include "lxc_fuse.h"
# include "virusb.h" #include "virusb.h"
virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def, virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def,
pid_t initpid, pid_t initpid,
...@@ -47,5 +46,3 @@ int ...@@ -47,5 +46,3 @@ int
virLXCTeardownHostUSBDeviceCgroup(virUSBDevicePtr dev, virLXCTeardownHostUSBDeviceCgroup(virUSBDevicePtr dev,
const char *path, const char *path,
void *opaque); void *opaque);
#endif /* LIBVIRT_LXC_CGROUP_H */
...@@ -19,29 +19,28 @@ ...@@ -19,29 +19,28 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_LXC_CONF_H #pragma once
# define LIBVIRT_LXC_CONF_H
#include "internal.h"
# include "internal.h" #include "libvirt_internal.h"
# include "libvirt_internal.h" #include "domain_conf.h"
# include "domain_conf.h" #include "domain_event.h"
# include "domain_event.h" #include "capabilities.h"
# include "capabilities.h" #include "virthread.h"
# include "virthread.h" #include "security/security_manager.h"
# include "security/security_manager.h" #include "configmake.h"
# include "configmake.h" #include "vircgroup.h"
# include "vircgroup.h" #include "virsysinfo.h"
# include "virsysinfo.h" #include "virusb.h"
# include "virusb.h" #include "virclosecallbacks.h"
# include "virclosecallbacks.h" #include "virhostdev.h"
# include "virhostdev.h"
#define LXC_DRIVER_NAME "LXC"
# define LXC_DRIVER_NAME "LXC"
#define LXC_CONFIG_DIR SYSCONFDIR "/libvirt/lxc"
# define LXC_CONFIG_DIR SYSCONFDIR "/libvirt/lxc" #define LXC_STATE_DIR LOCALSTATEDIR "/run/libvirt/lxc"
# define LXC_STATE_DIR LOCALSTATEDIR "/run/libvirt/lxc" #define LXC_LOG_DIR LOCALSTATEDIR "/log/libvirt/lxc"
# define LXC_LOG_DIR LOCALSTATEDIR "/log/libvirt/lxc" #define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart"
# define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart"
typedef struct _virLXCDriver virLXCDriver; typedef struct _virLXCDriver virLXCDriver;
typedef virLXCDriver *virLXCDriverPtr; typedef virLXCDriver *virLXCDriverPtr;
...@@ -120,5 +119,3 @@ static inline void lxcDriverUnlock(virLXCDriverPtr driver) ...@@ -120,5 +119,3 @@ static inline void lxcDriverUnlock(virLXCDriverPtr driver)
{ {
virMutexUnlock(&driver->lock); virMutexUnlock(&driver->lock);
} }
#endif /* LIBVIRT_LXC_CONF_H */
...@@ -18,29 +18,28 @@ ...@@ -18,29 +18,28 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_LXC_CONTAINER_H #pragma once
# define LIBVIRT_LXC_CONTAINER_H
# include "lxc_conf.h" #include "lxc_conf.h"
# include "lxc_domain.h" #include "lxc_domain.h"
# include "security/security_manager.h" #include "security/security_manager.h"
# define LXC_DEV_MAJ_MEMORY 1 #define LXC_DEV_MAJ_MEMORY 1
# define LXC_DEV_MIN_NULL 3 #define LXC_DEV_MIN_NULL 3
# define LXC_DEV_MIN_ZERO 5 #define LXC_DEV_MIN_ZERO 5
# define LXC_DEV_MIN_FULL 7 #define LXC_DEV_MIN_FULL 7
# define LXC_DEV_MIN_RANDOM 8 #define LXC_DEV_MIN_RANDOM 8
# define LXC_DEV_MIN_URANDOM 9 #define LXC_DEV_MIN_URANDOM 9
# define LXC_DEV_MAJ_TTY 5 #define LXC_DEV_MAJ_TTY 5
# define LXC_DEV_MIN_TTY 0 #define LXC_DEV_MIN_TTY 0
# define LXC_DEV_MIN_CONSOLE 1 #define LXC_DEV_MIN_CONSOLE 1
# define LXC_DEV_MIN_PTMX 2 #define LXC_DEV_MIN_PTMX 2
# define LXC_DEV_MAJ_PTY 136 #define LXC_DEV_MAJ_PTY 136
# define LXC_DEV_MAJ_FUSE 10 #define LXC_DEV_MAJ_FUSE 10
# define LXC_DEV_MIN_FUSE 229 #define LXC_DEV_MIN_FUSE 229
int lxcContainerSendContinue(int control); int lxcContainerSendContinue(int control);
int lxcContainerWaitForContinue(int control); int lxcContainerWaitForContinue(int control);
...@@ -64,5 +63,3 @@ virArch lxcContainerGetAlt32bitArch(virArch arch); ...@@ -64,5 +63,3 @@ virArch lxcContainerGetAlt32bitArch(virArch arch);
int lxcContainerChown(virDomainDefPtr def, const char *path); int lxcContainerChown(virDomainDefPtr def, const char *path);
bool lxcIsBasicMountLocation(const char *path); bool lxcIsBasicMountLocation(const char *path);
#endif /* LIBVIRT_LXC_CONTAINER_H */
...@@ -19,13 +19,12 @@ ...@@ -19,13 +19,12 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_LXC_DOMAIN_H #pragma once
# define LIBVIRT_LXC_DOMAIN_H
# include "vircgroup.h" #include "vircgroup.h"
# include "lxc_conf.h" #include "lxc_conf.h"
# include "lxc_monitor.h" #include "lxc_monitor.h"
# include "virenum.h" #include "virenum.h"
typedef enum { typedef enum {
...@@ -113,5 +112,3 @@ virLXCDomainGetMachineName(virDomainDefPtr def, pid_t pid); ...@@ -113,5 +112,3 @@ virLXCDomainGetMachineName(virDomainDefPtr def, pid_t pid);
int int
virLXCDomainSetRunlevel(virDomainObjPtr vm, virLXCDomainSetRunlevel(virDomainObjPtr vm,
int runlevel); int runlevel);
#endif /* LIBVIRT_LXC_DOMAIN_H */
...@@ -18,10 +18,7 @@ ...@@ -18,10 +18,7 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_LXC_DRIVER_H #pragma once
# define LIBVIRT_LXC_DRIVER_H
/* Function declarations */ /* Function declarations */
int lxcRegister(void); int lxcRegister(void);
#endif /* LIBVIRT_LXC_DRIVER_H */
...@@ -18,16 +18,15 @@ ...@@ -18,16 +18,15 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_LXC_FUSE_H #pragma once
# define LIBVIRT_LXC_FUSE_H
# define FUSE_USE_VERSION 26 #define FUSE_USE_VERSION 26
# if WITH_FUSE #if WITH_FUSE
# include <fuse.h> # include <fuse.h>
# endif #endif
# include "lxc_conf.h" #include "lxc_conf.h"
struct virLXCMeminfo { struct virLXCMeminfo {
unsigned long long memtotal; unsigned long long memtotal;
...@@ -56,5 +55,3 @@ typedef struct virLXCFuse *virLXCFusePtr; ...@@ -56,5 +55,3 @@ typedef struct virLXCFuse *virLXCFusePtr;
int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def); int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def);
int lxcStartFuse(virLXCFusePtr f); int lxcStartFuse(virLXCFusePtr f);
void lxcFreeFuse(virLXCFusePtr *f); void lxcFreeFuse(virLXCFusePtr *f);
#endif /* LIBVIRT_LXC_FUSE_H */
...@@ -19,11 +19,10 @@ ...@@ -19,11 +19,10 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_LXC_HOSTDEV_H #pragma once
# define LIBVIRT_LXC_HOSTDEV_H
# include "lxc_conf.h" #include "lxc_conf.h"
# include "domain_conf.h" #include "domain_conf.h"
int virLXCUpdateActiveUSBHostdevs(virLXCDriverPtr driver, int virLXCUpdateActiveUSBHostdevs(virLXCDriverPtr driver,
virDomainDefPtr def); virDomainDefPtr def);
...@@ -37,5 +36,3 @@ int virLXCPrepareHostDevices(virLXCDriverPtr driver, ...@@ -37,5 +36,3 @@ int virLXCPrepareHostDevices(virLXCDriverPtr driver,
virDomainDefPtr def); virDomainDefPtr def);
void virLXCDomainReAttachHostDevices(virLXCDriverPtr driver, void virLXCDomainReAttachHostDevices(virLXCDriverPtr driver,
virDomainDefPtr def); virDomainDefPtr def);
#endif /* LIBVIRT_LXC_HOSTDEV_H */
...@@ -18,12 +18,11 @@ ...@@ -18,12 +18,11 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_LXC_MONITOR_H #pragma once
# define LIBVIRT_LXC_MONITOR_H
# include "virobject.h" #include "virobject.h"
# include "domain_conf.h" #include "domain_conf.h"
# include "lxc_monitor_protocol.h" #include "lxc_monitor_protocol.h"
typedef struct _virLXCMonitor virLXCMonitor; typedef struct _virLXCMonitor virLXCMonitor;
typedef virLXCMonitor *virLXCMonitorPtr; typedef virLXCMonitor *virLXCMonitorPtr;
...@@ -59,5 +58,3 @@ void virLXCMonitorClose(virLXCMonitorPtr mon); ...@@ -59,5 +58,3 @@ void virLXCMonitorClose(virLXCMonitorPtr mon);
void virLXCMonitorLock(virLXCMonitorPtr mon); void virLXCMonitorLock(virLXCMonitorPtr mon);
void virLXCMonitorUnlock(virLXCMonitorPtr mon); void virLXCMonitorUnlock(virLXCMonitorPtr mon);
#endif /* LIBVIRT_LXC_MONITOR_H */
...@@ -18,13 +18,12 @@ ...@@ -18,13 +18,12 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_LXC_NATIVE_H #pragma once
# define LIBVIRT_LXC_NATIVE_H
# include "domain_conf.h" #include "domain_conf.h"
# include "virenum.h" #include "virenum.h"
# define LXC_CONFIG_FORMAT "lxc-tools" #define LXC_CONFIG_FORMAT "lxc-tools"
typedef enum { typedef enum {
VIR_LXC_NETWORK_CONFIG_NAME, VIR_LXC_NETWORK_CONFIG_NAME,
...@@ -46,5 +45,3 @@ VIR_ENUM_DECL(virLXCNetworkConfigEntry); ...@@ -46,5 +45,3 @@ VIR_ENUM_DECL(virLXCNetworkConfigEntry);
virDomainDefPtr lxcParseConfigString(const char *config, virDomainDefPtr lxcParseConfigString(const char *config,
virCapsPtr caps, virCapsPtr caps,
virDomainXMLOptionPtr xmlopt); virDomainXMLOptionPtr xmlopt);
#endif /* LIBVIRT_LXC_NATIVE_H */
...@@ -19,10 +19,9 @@ ...@@ -19,10 +19,9 @@
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#ifndef LIBVIRT_LXC_PROCESS_H #pragma once
# define LIBVIRT_LXC_PROCESS_H
# include "lxc_conf.h" #include "lxc_conf.h"
int virLXCProcessStart(virConnectPtr conn, int virLXCProcessStart(virConnectPtr conn,
virLXCDriverPtr driver, virLXCDriverPtr driver,
...@@ -54,5 +53,3 @@ char *virLXCProcessSetupInterfaceTap(virDomainDefPtr vm, ...@@ -54,5 +53,3 @@ char *virLXCProcessSetupInterfaceTap(virDomainDefPtr vm,
char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn, char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
virDomainDefPtr def, virDomainDefPtr def,
virDomainNetDefPtr net); virDomainNetDefPtr net);
#endif /* LIBVIRT_LXC_PROCESS_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册