[PATCH 18/19] src/libxl: use #pragma once in headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>
---
 src/libxl/libxl_capabilities.h |  29 +++++-----
 src/libxl/libxl_conf.h         | 101 ++++++++++++++++-----------------
 src/libxl/libxl_domain.h       |  29 +++++-----
 src/libxl/libxl_driver.h       |   5 +-
 src/libxl/libxl_logger.h       |   7 +--
 src/libxl/libxl_migration.h    |  11 ++--
 6 files changed, 82 insertions(+), 100 deletions(-)

diff --git a/src/libxl/libxl_capabilities.h b/src/libxl/libxl_capabilities.h
index a0b9c10653..9a7c8bf636 100644
--- a/src/libxl/libxl_capabilities.h
+++ b/src/libxl/libxl_capabilities.h
@@ -18,27 +18,26 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_LIBXL_CAPABILITIES_H
-# define LIBVIRT_LIBXL_CAPABILITIES_H
+#pragma once
 
-# include <libxl.h>
+#include <libxl.h>
 
-# include "virobject.h"
-# include "capabilities.h"
-# include "domain_capabilities.h"
-# include "virfirmware.h"
+#include "virobject.h"
+#include "capabilities.h"
+#include "domain_capabilities.h"
+#include "virfirmware.h"
 
 
-# ifndef LIBXL_FIRMWARE_DIR
-#  define LIBXL_FIRMWARE_DIR "/usr/lib/xen/boot"
-# endif
-# ifndef LIBXL_EXECBIN_DIR
-#  define LIBXL_EXECBIN_DIR "/usr/lib/xen/bin"
-# endif
+#ifndef LIBXL_FIRMWARE_DIR
+# define LIBXL_FIRMWARE_DIR "/usr/lib/xen/boot"
+#endif
+#ifndef LIBXL_EXECBIN_DIR
+# define LIBXL_EXECBIN_DIR "/usr/lib/xen/bin"
+#endif
 
 /* Used for prefix of ifname of any network name generated dynamically
  * by libvirt for Xen, and cannot be used for a persistent network name.  */
-# define LIBXL_GENERATED_PREFIX_XEN "vif"
+#define LIBXL_GENERATED_PREFIX_XEN "vif"
 
 bool libxlCapsHasPVUSB(void);
 
@@ -52,5 +51,3 @@ libxlMakeDomainCapabilities(virDomainCapsPtr domCaps,
 
 int
 libxlDomainGetEmulatorType(const virDomainDef *def);
-
-#endif /* LIBVIRT_LIBXL_CAPABILITIES_H */
diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
index fee94241af..136b5ae1ac 100644
--- a/src/libxl/libxl_conf.h
+++ b/src/libxl/libxl_conf.h
@@ -19,43 +19,42 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_LIBXL_CONF_H
-# define LIBVIRT_LIBXL_CONF_H
-
-# include <libxl.h>
-
-# include "internal.h"
-# include "libvirt_internal.h"
-# include "virdomainobjlist.h"
-# include "domain_event.h"
-# include "capabilities.h"
-# include "configmake.h"
-# include "virportallocator.h"
-# include "virobject.h"
-# include "virchrdev.h"
-# include "virhostdev.h"
-# include "locking/lock_manager.h"
-# include "virfirmware.h"
-# include "libxl_capabilities.h"
-# include "libxl_logger.h"
-
-# define LIBXL_DRIVER_NAME "xenlight"
-# define LIBXL_VNC_PORT_MIN  5900
-# define LIBXL_VNC_PORT_MAX  65535
-
-# define LIBXL_MIGRATION_PORT_MIN  49152
-# define LIBXL_MIGRATION_PORT_MAX  49216
-
-# define LIBXL_CONFIG_BASE_DIR SYSCONFDIR "/libvirt"
-# define LIBXL_CONFIG_DIR SYSCONFDIR "/libvirt/libxl"
-# define LIBXL_AUTOSTART_DIR LIBXL_CONFIG_DIR "/autostart"
-# define LIBXL_STATE_DIR LOCALSTATEDIR "/run/libvirt/libxl"
-# define LIBXL_LOG_DIR LOCALSTATEDIR "/log/libvirt/libxl"
-# define LIBXL_LIB_DIR LOCALSTATEDIR "/lib/libvirt/libxl"
-# define LIBXL_SAVE_DIR LIBXL_LIB_DIR "/save"
-# define LIBXL_DUMP_DIR LIBXL_LIB_DIR "/dump"
-# define LIBXL_CHANNEL_DIR LIBXL_LIB_DIR "/channel/target"
-# define LIBXL_BOOTLOADER_PATH "pygrub"
+#pragma once
+
+#include <libxl.h>
+
+#include "internal.h"
+#include "libvirt_internal.h"
+#include "virdomainobjlist.h"
+#include "domain_event.h"
+#include "capabilities.h"
+#include "configmake.h"
+#include "virportallocator.h"
+#include "virobject.h"
+#include "virchrdev.h"
+#include "virhostdev.h"
+#include "locking/lock_manager.h"
+#include "virfirmware.h"
+#include "libxl_capabilities.h"
+#include "libxl_logger.h"
+
+#define LIBXL_DRIVER_NAME "xenlight"
+#define LIBXL_VNC_PORT_MIN  5900
+#define LIBXL_VNC_PORT_MAX  65535
+
+#define LIBXL_MIGRATION_PORT_MIN  49152
+#define LIBXL_MIGRATION_PORT_MAX  49216
+
+#define LIBXL_CONFIG_BASE_DIR SYSCONFDIR "/libvirt"
+#define LIBXL_CONFIG_DIR SYSCONFDIR "/libvirt/libxl"
+#define LIBXL_AUTOSTART_DIR LIBXL_CONFIG_DIR "/autostart"
+#define LIBXL_STATE_DIR LOCALSTATEDIR "/run/libvirt/libxl"
+#define LIBXL_LOG_DIR LOCALSTATEDIR "/log/libvirt/libxl"
+#define LIBXL_LIB_DIR LOCALSTATEDIR "/lib/libvirt/libxl"
+#define LIBXL_SAVE_DIR LIBXL_LIB_DIR "/save"
+#define LIBXL_DUMP_DIR LIBXL_LIB_DIR "/dump"
+#define LIBXL_CHANNEL_DIR LIBXL_LIB_DIR "/channel/target"
+#define LIBXL_BOOTLOADER_PATH "pygrub"
 
 
 typedef struct _libxlDriverPrivate libxlDriverPrivate;
@@ -141,12 +140,12 @@ struct _libxlDriverPrivate {
     virLockManagerPluginPtr lockManager;
 };
 
-# define LIBXL_SAVE_MAGIC "libvirt-xml\n \0 \r"
-# ifdef LIBXL_HAVE_SRM_V2
-#  define LIBXL_SAVE_VERSION 2
-# else
-#  define LIBXL_SAVE_VERSION 1
-# endif
+#define LIBXL_SAVE_MAGIC "libvirt-xml\n \0 \r"
+#ifdef LIBXL_HAVE_SRM_V2
+# define LIBXL_SAVE_VERSION 2
+#else
+# define LIBXL_SAVE_VERSION 1
+#endif
 
 typedef struct _libxlSavefileHeader libxlSavefileHeader;
 typedef libxlSavefileHeader *libxlSavefileHeaderPtr;
@@ -193,23 +192,23 @@ libxlMakeVfb(virPortAllocatorRangePtr graphicsports,
 int
 libxlMakePCI(virDomainHostdevDefPtr hostdev, libxl_device_pci *pcidev);
 
-# ifdef LIBXL_HAVE_PVUSB
+#ifdef LIBXL_HAVE_PVUSB
 int
 libxlMakeUSBController(virDomainControllerDefPtr controller,
                        libxl_device_usbctrl *usbctrl);
 
 int
 libxlMakeUSB(virDomainHostdevDefPtr hostdev, libxl_device_usbdev *usbdev);
-# endif
+#endif
 
 virDomainXMLOptionPtr
 libxlCreateXMLConf(void);
 
-# ifdef LIBXL_HAVE_DEVICE_CHANNEL
-#  define LIBXL_ATTR_UNUSED
-# else
-#  define LIBXL_ATTR_UNUSED ATTRIBUTE_UNUSED
-# endif
+#ifdef LIBXL_HAVE_DEVICE_CHANNEL
+# define LIBXL_ATTR_UNUSED
+#else
+# define LIBXL_ATTR_UNUSED ATTRIBUTE_UNUSED
+#endif
 int
 libxlBuildDomainConfig(virPortAllocatorRangePtr graphicsports,
                        virDomainDefPtr def,
@@ -227,5 +226,3 @@ libxlDriverUnlock(libxlDriverPrivatePtr driver)
 {
     virMutexUnlock(&driver->lock);
 }
-
-#endif /* LIBVIRT_LIBXL_CONF_H */
diff --git a/src/libxl/libxl_domain.h b/src/libxl/libxl_domain.h
index 769ee8ec4d..737ae6accd 100644
--- a/src/libxl/libxl_domain.h
+++ b/src/libxl/libxl_domain.h
@@ -18,18 +18,17 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_LIBXL_DOMAIN_H
-# define LIBVIRT_LIBXL_DOMAIN_H
+#pragma once
 
-# include <libxl.h>
+#include <libxl.h>
 
-# include "domain_conf.h"
-# include "libxl_conf.h"
-# include "virchrdev.h"
-# include "virenum.h"
+#include "domain_conf.h"
+#include "libxl_conf.h"
+#include "virchrdev.h"
+#include "virenum.h"
 
-# define JOB_MASK(job)                  (job == 0 ? 0 : 1 << (job - 1))
-# define DEFAULT_JOB_MASK \
+#define JOB_MASK(job)                  (job == 0 ? 0 : 1 << (job - 1))
+#define DEFAULT_JOB_MASK \
     (JOB_MASK(LIBXL_JOB_DESTROY) | \
      JOB_MASK(LIBXL_JOB_ABORT))
 
@@ -122,11 +121,11 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,
  * Detect which signature to use based on
  * LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG.
  */
-# ifdef LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG
-#  define VIR_LIBXL_EVENT_CONST /* empty */
-# else
-#  define VIR_LIBXL_EVENT_CONST const
-# endif
+#ifdef LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG
+# define VIR_LIBXL_EVENT_CONST /* empty */
+#else
+# define VIR_LIBXL_EVENT_CONST const
+#endif
 
 void
 libxlDomainEventHandler(void *data,
@@ -156,5 +155,3 @@ bool
 libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver,
                                 virDomainDefPtr src,
                                 virDomainDefPtr dst);
-
-#endif /* LIBVIRT_LIBXL_DOMAIN_H */
diff --git a/src/libxl/libxl_driver.h b/src/libxl/libxl_driver.h
index 23b3ed2910..4fbcd377e6 100644
--- a/src/libxl/libxl_driver.h
+++ b/src/libxl/libxl_driver.h
@@ -18,9 +18,6 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_LIBXL_DRIVER_H
-# define LIBVIRT_LIBXL_DRIVER_H
+#pragma once
 
 int libxlRegister(void);
-
-#endif /* LIBVIRT_LIBXL_DRIVER_H */
diff --git a/src/libxl/libxl_logger.h b/src/libxl/libxl_logger.h
index 678009eba8..a09c6496f3 100644
--- a/src/libxl/libxl_logger.h
+++ b/src/libxl/libxl_logger.h
@@ -18,10 +18,9 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_LIBXL_LOGGER_H
-# define LIBVIRT_LIBXL_LOGGER_H
+#pragma once
 
-# include "util/virlog.h"
+#include "util/virlog.h"
 
 typedef struct xentoollog_logger_libvirt libxlLogger;
 typedef libxlLogger *libxlLoggerPtr;
@@ -33,5 +32,3 @@ void libxlLoggerFree(libxlLoggerPtr logger);
 void libxlLoggerOpenFile(libxlLoggerPtr logger, int id, const char *name,
                          const char *domain_config);
 void libxlLoggerCloseFile(libxlLoggerPtr logger, int id);
-
-#endif /* LIBVIRT_LIBXL_LOGGER_H */
diff --git a/src/libxl/libxl_migration.h b/src/libxl/libxl_migration.h
index 5aea16b741..b733d21cd2 100644
--- a/src/libxl/libxl_migration.h
+++ b/src/libxl/libxl_migration.h
@@ -18,12 +18,11 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_LIBXL_MIGRATION_H
-# define LIBVIRT_LIBXL_MIGRATION_H
+#pragma once
 
-# include "libxl_conf.h"
+#include "libxl_conf.h"
 
-# define LIBXL_MIGRATION_FLAGS \
+#define LIBXL_MIGRATION_FLAGS \
     (VIR_MIGRATE_LIVE | \
      VIR_MIGRATE_PEER2PEER | \
      VIR_MIGRATE_TUNNELLED | \
@@ -32,7 +31,7 @@
      VIR_MIGRATE_PAUSED)
 
 /* All supported migration parameters and their types. */
-# define LIBXL_MIGRATION_PARAMETERS \
+#define LIBXL_MIGRATION_PARAMETERS \
     VIR_MIGRATE_PARAM_URI,              VIR_TYPED_PARAM_STRING, \
     VIR_MIGRATE_PARAM_DEST_NAME,        VIR_TYPED_PARAM_STRING, \
     VIR_MIGRATE_PARAM_DEST_XML,         VIR_TYPED_PARAM_STRING, \
@@ -97,5 +96,3 @@ libxlDomainMigrationSrcConfirm(libxlDriverPrivatePtr driver,
                                virDomainObjPtr vm,
                                unsigned int flags,
                                int cancelled);
-
-#endif /* LIBVIRT_LIBXL_MIGRATION_H */
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux