[libvirt] [PATCH 00/19] Use '#pragma once' in headers

Hi all, I'm trying to get up to speed with libvirt code, so I decided to start out with a slightly "mindless" task. I grabbed the '#pragma once' task from https://wiki.libvirt.org/page/BiteSizedTasks. This series covers the first part of the conversion. I chatted with Daniel Berrange briefly on IRC before starting, and he suggested that I should try to keep patches under 100k, and maybe each driver's source files as a single patch. I had a bit of difficulty deciding where to split the src/conf/ and src/util/ directories. So some of the files with more changes ended up being single-file patches. I tried to combine some related source files into patches, but at a certain point I ran out of obvious files to combine, so I combined a bunch of smaller miscellaneous files into one larger patch. It may not be ideal, but it's the best I could come up with. Alternative suggestions welcome. I'll follow up with the remaining changes if this division looks acceptable. Jonathon Jongsma (19): Use #pragma once in driver headers src/access: use #pragma once in headers src/admin: use #pragma once in headers src/bhyve: use #pragma once in headers conf: domain: use #pragma once in headers conf: network: use #pragma once in headers conf: nwfilter: use #pragma once in headers conf: node device: use #pragma once in headers conf: storage: use #pragma once in headers conf: misc: use #pragma once in headers src/cpu: use #pragma once in headers src/datatypes.h: use #pragma once src/esx: use #pragma once in headers src/hyperv: use #pragma once in headers src/interface: use #pragma once in headers src/internal.h: use #pragma once src/libvirt_internal.h: use #pragma once src/libxl: use #pragma once in headers src/logging: use #pragma once in headers src/access/viraccessdriver.h | 10 +- src/access/viraccessdrivernop.h | 7 +- src/access/viraccessdriverpolkit.h | 7 +- src/access/viraccessdriverstack.h | 7 +- src/access/viraccessmanager.h | 26 +-- src/access/viraccessperm.h | 11 +- src/admin/admin_server.h | 9 +- src/admin/admin_server_dispatch.h | 11 +- src/bhyve/bhyve_capabilities.h | 11 +- src/bhyve/bhyve_command.h | 15 +- src/bhyve/bhyve_conf.h | 7 +- src/bhyve/bhyve_device.h | 11 +- src/bhyve/bhyve_domain.h | 11 +- src/bhyve/bhyve_driver.h | 9 +- src/bhyve/bhyve_monitor.h | 11 +- src/bhyve/bhyve_parse_command.h | 5 +- src/bhyve/bhyve_process.h | 7 +- src/bhyve/bhyve_utils.h | 31 ++- src/conf/capabilities.h | 23 +-- src/conf/cpu_conf.h | 23 +-- src/conf/device_conf.h | 33 ++- src/conf/domain_addr.h | 16 +- src/conf/domain_audit.h | 10 +- src/conf/domain_capabilities.h | 15 +- src/conf/domain_conf.h | 91 ++++----- src/conf/domain_event.h | 11 +- src/conf/domain_nwfilter.h | 5 +- src/conf/interface_conf.h | 23 +-- src/conf/moment_conf.h | 11 +- src/conf/netdev_bandwidth_conf.h | 15 +- src/conf/netdev_vlan_conf.h | 13 +- src/conf/netdev_vport_profile_conf.h | 14 +- src/conf/network_conf.h | 52 +++-- src/conf/network_event.h | 11 +- src/conf/networkcommon_conf.h | 17 +- src/conf/node_device_conf.h | 31 ++- src/conf/node_device_event.h | 11 +- src/conf/node_device_util.h | 7 +- src/conf/numa_conf.h | 18 +- src/conf/nwfilter_conf.h | 93 ++++----- src/conf/nwfilter_ipaddrmap.h | 5 +- src/conf/nwfilter_params.h | 28 ++- src/conf/object_event.h | 11 +- src/conf/object_event_private.h | 7 +- src/conf/secret_conf.h | 15 +- src/conf/secret_event.h | 11 +- src/conf/snapshot_conf.h | 13 +- src/conf/storage_adapter_conf.h | 11 +- src/conf/storage_capabilities.h | 8 +- src/conf/storage_conf.h | 41 ++-- src/conf/storage_event.h | 11 +- src/conf/virchrdev.h | 9 +- src/conf/virconftypes.h | 5 +- src/conf/virdomainmomentobjlist.h | 17 +- src/conf/virdomainobjlist.h | 21 +- src/conf/virdomainsnapshotobjlist.h | 21 +- src/conf/virinterfaceobj.h | 7 +- src/conf/virnetworkobj.h | 9 +- src/conf/virnodedeviceobj.h | 13 +- src/conf/virnwfilterbindingdef.h | 13 +- src/conf/virnwfilterbindingobj.h | 11 +- src/conf/virnwfilterbindingobjlist.h | 8 +- src/conf/virnwfilterobj.h | 11 +- src/conf/virsavecookie.h | 13 +- src/conf/virsecretobj.h | 11 +- src/conf/virstorageobj.h | 11 +- src/cpu/cpu.h | 19 +- src/cpu/cpu_arm.h | 7 +- src/cpu/cpu_map.h | 7 +- src/cpu/cpu_ppc64.h | 7 +- src/cpu/cpu_ppc64_data.h | 8 +- src/cpu/cpu_s390.h | 7 +- src/cpu/cpu_x86.h | 9 +- src/cpu/cpu_x86_data.h | 58 +++--- src/datatypes.h | 89 ++++---- src/driver-hypervisor.h | 12 +- src/driver-interface.h | 12 +- src/driver-network.h | 12 +- src/driver-nodedev.h | 12 +- src/driver-nwfilter.h | 12 +- src/driver-secret.h | 12 +- src/driver-state.h | 12 +- src/driver-storage.h | 12 +- src/driver-stream.h | 12 +- src/driver.h | 37 ++-- src/esx/esx_driver.h | 5 +- src/esx/esx_interface_driver.h | 7 +- src/esx/esx_network_driver.h | 7 +- src/esx/esx_private.h | 15 +- src/esx/esx_storage_backend_iscsi.h | 7 +- src/esx/esx_storage_backend_vmfs.h | 7 +- src/esx/esx_storage_driver.h | 7 +- src/esx/esx_stream.h | 9 +- src/esx/esx_util.h | 13 +- src/esx/esx_vi.h | 37 ++-- src/esx/esx_vi_methods.h | 11 +- src/esx/esx_vi_types.h | 13 +- src/hyperv/hyperv_driver.h | 5 +- src/hyperv/hyperv_private.h | 13 +- src/hyperv/hyperv_util.h | 9 +- src/hyperv/hyperv_wmi.h | 21 +- src/hyperv/hyperv_wmi_classes.h | 27 ++- src/hyperv/openwsman.h | 35 ++-- src/interface/interface_driver.h | 5 +- src/internal.h | 295 +++++++++++++-------------- src/libvirt_internal.h | 7 +- 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 +- src/logging/log_daemon.h | 9 +- src/logging/log_daemon_config.h | 7 +- src/logging/log_daemon_dispatch.h | 7 +- src/logging/log_handler.h | 9 +- src/logging/log_manager.h | 9 +- 117 files changed, 928 insertions(+), 1296 deletions(-) -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/driver-hypervisor.h | 12 ++++-------- src/driver-interface.h | 12 ++++-------- src/driver-network.h | 12 ++++-------- src/driver-nodedev.h | 12 ++++-------- src/driver-nwfilter.h | 12 ++++-------- src/driver-secret.h | 12 ++++-------- src/driver-state.h | 12 ++++-------- src/driver-storage.h | 12 ++++-------- src/driver-stream.h | 12 ++++-------- src/driver.h | 37 +++++++++++++++++-------------------- 10 files changed, 53 insertions(+), 92 deletions(-) diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index 5315e33dde..b15aaa36bc 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -18,12 +18,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DRIVER_HYPERVISOR_H -# define LIBVIRT_DRIVER_HYPERVISOR_H +#pragma once -# ifndef __VIR_DRIVER_H_INCLUDES___ -# error "Don't include this file directly, only use driver.h" -# endif +#ifndef __VIR_DRIVER_H_INCLUDES___ +# error "Don't include this file directly, only use driver.h" +#endif typedef int (*virDrvConnectURIProbe)(char **uri); @@ -1581,6 +1580,3 @@ struct _virHypervisorDriver { virDrvNodeGetSEVInfo nodeGetSEVInfo; virDrvDomainGetLaunchSecurityInfo domainGetLaunchSecurityInfo; }; - - -#endif /* LIBVIRT_DRIVER_HYPERVISOR_H */ diff --git a/src/driver-interface.h b/src/driver-interface.h index 5373f5e66a..117c93b66f 100644 --- a/src/driver-interface.h +++ b/src/driver-interface.h @@ -18,12 +18,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DRIVER_INTERFACE_H -# define LIBVIRT_DRIVER_INTERFACE_H +#pragma once -# ifndef __VIR_DRIVER_H_INCLUDES___ -# error "Don't include this file directly, only use driver.h" -# endif +#ifndef __VIR_DRIVER_H_INCLUDES___ +# error "Don't include this file directly, only use driver.h" +#endif typedef int (*virDrvConnectNumOfInterfaces)(virConnectPtr conn); @@ -117,6 +116,3 @@ struct _virInterfaceDriver { virDrvInterfaceChangeCommit interfaceChangeCommit; virDrvInterfaceChangeRollback interfaceChangeRollback; }; - - -#endif /* LIBVIRT_DRIVER_INTERFACE_H */ diff --git a/src/driver-network.h b/src/driver-network.h index 2715c7bfec..a4f71a8fd1 100644 --- a/src/driver-network.h +++ b/src/driver-network.h @@ -18,12 +18,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DRIVER_NETWORK_H -# define LIBVIRT_DRIVER_NETWORK_H +#pragma once -# ifndef __VIR_DRIVER_H_INCLUDES___ -# error "Don't include this file directly, only use driver.h" -# endif +#ifndef __VIR_DRIVER_H_INCLUDES___ +# error "Don't include this file directly, only use driver.h" +#endif typedef int (*virDrvConnectNumOfNetworks)(virConnectPtr conn); @@ -152,6 +151,3 @@ struct _virNetworkDriver { virDrvNetworkIsPersistent networkIsPersistent; virDrvNetworkGetDHCPLeases networkGetDHCPLeases; }; - - -#endif /* LIBVIRT_DRIVER_NETWORK_H */ diff --git a/src/driver-nodedev.h b/src/driver-nodedev.h index c506e846f6..d0fc7f19cf 100644 --- a/src/driver-nodedev.h +++ b/src/driver-nodedev.h @@ -18,12 +18,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DRIVER_NODEDEV_H -# define LIBVIRT_DRIVER_NODEDEV_H +#pragma once -# ifndef __VIR_DRIVER_H_INCLUDES___ -# error "Don't include this file directly, only use driver.h" -# endif +#ifndef __VIR_DRIVER_H_INCLUDES___ +# error "Don't include this file directly, only use driver.h" +#endif typedef int (*virDrvNodeNumOfDevices)(virConnectPtr conn, @@ -115,6 +114,3 @@ struct _virNodeDeviceDriver { virDrvNodeDeviceCreateXML nodeDeviceCreateXML; virDrvNodeDeviceDestroy nodeDeviceDestroy; }; - - -#endif /* LIBVIRT_DRIVER_NODEDEV_H */ diff --git a/src/driver-nwfilter.h b/src/driver-nwfilter.h index 7bcb823f0a..7e95622423 100644 --- a/src/driver-nwfilter.h +++ b/src/driver-nwfilter.h @@ -18,12 +18,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DRIVER_NWFILTER_H -# define LIBVIRT_DRIVER_NWFILTER_H +#pragma once -# ifndef __VIR_DRIVER_H_INCLUDES___ -# error "Don't include this file directly, only use driver.h" -# endif +#ifndef __VIR_DRIVER_H_INCLUDES___ +# error "Don't include this file directly, only use driver.h" +#endif typedef int (*virDrvConnectNumOfNWFilters)(virConnectPtr conn); @@ -108,6 +107,3 @@ struct _virNWFilterDriver { virDrvNWFilterBindingDelete nwfilterBindingDelete; virDrvNWFilterBindingGetXMLDesc nwfilterBindingGetXMLDesc; }; - - -#endif /* LIBVIRT_DRIVER_NWFILTER_H */ diff --git a/src/driver-secret.h b/src/driver-secret.h index 1dcae63880..125238fe7b 100644 --- a/src/driver-secret.h +++ b/src/driver-secret.h @@ -18,12 +18,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DRIVER_SECRET_H -# define LIBVIRT_DRIVER_SECRET_H +#pragma once -# ifndef __VIR_DRIVER_H_INCLUDES___ -# error "Don't include this file directly, only use driver.h" -# endif +#ifndef __VIR_DRIVER_H_INCLUDES___ +# error "Don't include this file directly, only use driver.h" +#endif enum { /* This getValue call is inside libvirt, override the "private" flag. @@ -113,6 +112,3 @@ struct _virSecretDriver { virDrvConnectSecretEventRegisterAny connectSecretEventRegisterAny; virDrvConnectSecretEventDeregisterAny connectSecretEventDeregisterAny; }; - - -#endif /* LIBVIRT_DRIVER_SECRET_H */ diff --git a/src/driver-state.h b/src/driver-state.h index a8595662af..974b2252ee 100644 --- a/src/driver-state.h +++ b/src/driver-state.h @@ -18,12 +18,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DRIVER_STATE_H -# define LIBVIRT_DRIVER_STATE_H +#pragma once -# ifndef __VIR_DRIVER_H_INCLUDES___ -# error "Don't include this file directly, only use driver.h" -# endif +#ifndef __VIR_DRIVER_H_INCLUDES___ +# error "Don't include this file directly, only use driver.h" +#endif typedef int (*virDrvStateInitialize)(bool privileged, @@ -49,6 +48,3 @@ struct _virStateDriver { virDrvStateReload stateReload; virDrvStateStop stateStop; }; - - -#endif /* LIBVIRT_DRIVER_STATE_H */ diff --git a/src/driver-storage.h b/src/driver-storage.h index 2a855c34d8..e11d1b7895 100644 --- a/src/driver-storage.h +++ b/src/driver-storage.h @@ -18,12 +18,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DRIVER_STORAGE_H -# define LIBVIRT_DRIVER_STORAGE_H +#pragma once -# ifndef __VIR_DRIVER_H_INCLUDES___ -# error "Don't include this file directly, only use driver.h" -# endif +#ifndef __VIR_DRIVER_H_INCLUDES___ +# error "Don't include this file directly, only use driver.h" +#endif typedef int (*virDrvConnectNumOfStoragePools)(virConnectPtr conn); @@ -279,6 +278,3 @@ struct _virStorageDriver { virDrvStoragePoolIsActive storagePoolIsActive; virDrvStoragePoolIsPersistent storagePoolIsPersistent; }; - - -#endif /* LIBVIRT_DRIVER_STORAGE_H */ diff --git a/src/driver-stream.h b/src/driver-stream.h index 4978f90d2d..a5b16c8c4e 100644 --- a/src/driver-stream.h +++ b/src/driver-stream.h @@ -18,12 +18,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DRIVER_STREAM_H -# define LIBVIRT_DRIVER_STREAM_H +#pragma once -# ifndef __VIR_DRIVER_H_INCLUDES___ -# error "Don't include this file directly, only use driver.h" -# endif +#ifndef __VIR_DRIVER_H_INCLUDES___ +# error "Don't include this file directly, only use driver.h" +#endif typedef int (*virDrvStreamSend)(virStreamPtr st, @@ -92,6 +91,3 @@ struct _virStreamDriver { virDrvStreamFinish streamFinish; virDrvStreamAbort streamAbort; }; - - -#endif /* LIBVIRT_DRIVER_STREAM_H */ diff --git a/src/driver.h b/src/driver.h index 6472bd9367..3fcea0d629 100644 --- a/src/driver.h +++ b/src/driver.h @@ -19,14 +19,13 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DRIVER_H -# define LIBVIRT_DRIVER_H +#pragma once -# include <unistd.h> +#include <unistd.h> -# include "internal.h" -# include "libvirt_internal.h" -# include "viruri.h" +#include "internal.h" +#include "libvirt_internal.h" +#include "viruri.h" /* Status codes returned from driver open call. */ @@ -56,24 +55,24 @@ typedef enum { * != 0 Feature is supported. * 0 Feature is not supported. */ -# define VIR_DRV_SUPPORTS_FEATURE(drv, conn, feature) \ +#define VIR_DRV_SUPPORTS_FEATURE(drv, conn, feature) \ ((drv)->connectSupportsFeature ? \ (drv)->connectSupportsFeature((conn), (feature)) > 0 : 0) -# define __VIR_DRIVER_H_INCLUDES___ +#define __VIR_DRIVER_H_INCLUDES___ -# include "driver-hypervisor.h" -# include "driver-interface.h" -# include "driver-network.h" -# include "driver-nodedev.h" -# include "driver-nwfilter.h" -# include "driver-secret.h" -# include "driver-state.h" -# include "driver-stream.h" -# include "driver-storage.h" +#include "driver-hypervisor.h" +#include "driver-interface.h" +#include "driver-network.h" +#include "driver-nodedev.h" +#include "driver-nwfilter.h" +#include "driver-secret.h" +#include "driver-state.h" +#include "driver-stream.h" +#include "driver-storage.h" -# undef __VIR_DRIVER_H_INCLUDES___ +#undef __VIR_DRIVER_H_INCLUDES___ typedef struct _virConnectDriver virConnectDriver; typedef virConnectDriver *virConnectDriverPtr; @@ -126,5 +125,3 @@ int virSetConnectNWFilter(virConnectPtr conn); int virSetConnectNodeDev(virConnectPtr conn); int virSetConnectSecret(virConnectPtr conn); int virSetConnectStorage(virConnectPtr conn); - -#endif /* LIBVIRT_DRIVER_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/access/viraccessdriver.h | 10 +++------- src/access/viraccessdrivernop.h | 7 ++----- src/access/viraccessdriverpolkit.h | 7 ++----- src/access/viraccessdriverstack.h | 7 ++----- src/access/viraccessmanager.h | 26 +++++++++++--------------- src/access/viraccessperm.h | 11 ++++------- 6 files changed, 24 insertions(+), 44 deletions(-) diff --git a/src/access/viraccessdriver.h b/src/access/viraccessdriver.h index 2cc3950f60..9fe7428e0e 100644 --- a/src/access/viraccessdriver.h +++ b/src/access/viraccessdriver.h @@ -18,11 +18,10 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRACCESSDRIVER_H -# define LIBVIRT_VIRACCESSDRIVER_H +#pragma once -# include "conf/domain_conf.h" -# include "access/viraccessmanager.h" +#include "conf/domain_conf.h" +#include "access/viraccessmanager.h" typedef int (*virAccessDriverCheckConnectDrv)(virAccessManagerPtr manager, const char *driverName, @@ -89,6 +88,3 @@ struct _virAccessDriver { virAccessDriverCheckStoragePoolDrv checkStoragePool; virAccessDriverCheckStorageVolDrv checkStorageVol; }; - - -#endif /* LIBVIRT_VIRACCESSDRIVER_H */ diff --git a/src/access/viraccessdrivernop.h b/src/access/viraccessdrivernop.h index d383c6f3ef..60f4cac0b7 100644 --- a/src/access/viraccessdrivernop.h +++ b/src/access/viraccessdrivernop.h @@ -18,11 +18,8 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRACCESSDRIVERNOP_H -# define LIBVIRT_VIRACCESSDRIVERNOP_H +#pragma once -# include "access/viraccessdriver.h" +#include "access/viraccessdriver.h" extern virAccessDriver accessDriverNop; - -#endif /* LIBVIRT_VIRACCESSDRIVERNOP_H */ diff --git a/src/access/viraccessdriverpolkit.h b/src/access/viraccessdriverpolkit.h index 4c71889824..0e52606c99 100644 --- a/src/access/viraccessdriverpolkit.h +++ b/src/access/viraccessdriverpolkit.h @@ -18,11 +18,8 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRACCESSDRIVERPOLKIT_H -# define LIBVIRT_VIRACCESSDRIVERPOLKIT_H +#pragma once -# include "viraccessdriver.h" +#include "viraccessdriver.h" extern virAccessDriver accessDriverPolkit; - -#endif /* LIBVIRT_VIRACCESSDRIVERPOLKIT_H */ diff --git a/src/access/viraccessdriverstack.h b/src/access/viraccessdriverstack.h index 0984b21914..078da697e8 100644 --- a/src/access/viraccessdriverstack.h +++ b/src/access/viraccessdriverstack.h @@ -18,15 +18,12 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRACCESSDRIVERSTACK_H -# define LIBVIRT_VIRACCESSDRIVERSTACK_H +#pragma once -# include "access/viraccessdriver.h" +#include "access/viraccessdriver.h" int virAccessDriverStackAppend(virAccessManagerPtr manager, virAccessManagerPtr child); extern virAccessDriver accessDriverStack; - -#endif /* LIBVIRT_VIRACCESSDRIVERSTACK_H */ diff --git a/src/access/viraccessmanager.h b/src/access/viraccessmanager.h index ab5ef87585..6da41b0823 100644 --- a/src/access/viraccessmanager.h +++ b/src/access/viraccessmanager.h @@ -18,19 +18,18 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRACCESSMANAGER_H -# define LIBVIRT_VIRACCESSMANAGER_H +#pragma once -# include "viridentity.h" -# include "conf/domain_conf.h" -# include "conf/network_conf.h" -# include "conf/nwfilter_conf.h" -# include "conf/node_device_conf.h" -# include "conf/storage_conf.h" -# include "conf/secret_conf.h" -# include "conf/interface_conf.h" -# include "conf/virnwfilterbindingdef.h" -# include "access/viraccessperm.h" +#include "viridentity.h" +#include "conf/domain_conf.h" +#include "conf/network_conf.h" +#include "conf/nwfilter_conf.h" +#include "conf/node_device_conf.h" +#include "conf/storage_conf.h" +#include "conf/secret_conf.h" +#include "conf/interface_conf.h" +#include "conf/virnwfilterbindingdef.h" +#include "access/viraccessperm.h" typedef struct _virAccessManager virAccessManager; typedef virAccessManager *virAccessManagerPtr; @@ -91,6 +90,3 @@ int virAccessManagerCheckStorageVol(virAccessManagerPtr manager, virStoragePoolDefPtr pool, virStorageVolDefPtr vol, virAccessPermStorageVol perm); - - -#endif /* LIBVIRT_VIRACCESSMANAGER_H */ diff --git a/src/access/viraccessperm.h b/src/access/viraccessperm.h index ed1f7168ca..8b63d75cf7 100644 --- a/src/access/viraccessperm.h +++ b/src/access/viraccessperm.h @@ -18,12 +18,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRACCESSPERM_H -# define LIBVIRT_VIRACCESSPERM_H +#pragma once -# include "internal.h" -# include "virutil.h" -# include "virenum.h" +#include "internal.h" +#include "virutil.h" +#include "virenum.h" typedef enum { /** @@ -699,5 +698,3 @@ VIR_ENUM_DECL(virAccessPermNWFilterBinding); VIR_ENUM_DECL(virAccessPermSecret); VIR_ENUM_DECL(virAccessPermStoragePool); VIR_ENUM_DECL(virAccessPermStorageVol); - -#endif /* LIBVIRT_VIRACCESSPERM_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/admin/admin_server.h | 9 +++------ src/admin/admin_server_dispatch.h | 11 ++++------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/admin/admin_server.h b/src/admin/admin_server.h index 43f2b85fc1..1d5cbec55f 100644 --- a/src/admin/admin_server.h +++ b/src/admin/admin_server.h @@ -18,11 +18,10 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_ADMIN_SERVER_H -# define LIBVIRT_ADMIN_SERVER_H +#pragma once -# include "rpc/virnetdaemon.h" -# include "rpc/virnetserver.h" +#include "rpc/virnetdaemon.h" +#include "rpc/virnetserver.h" int adminConnectListServers(virNetDaemonPtr dmn, virNetServerPtr **servers, @@ -68,5 +67,3 @@ int adminServerSetClientLimits(virNetServerPtr srv, virTypedParameterPtr params, int nparams, unsigned int flags); - -#endif /* LIBVIRT_ADMIN_SERVER_H */ diff --git a/src/admin/admin_server_dispatch.h b/src/admin/admin_server_dispatch.h index 5316b89313..f39757a13a 100644 --- a/src/admin/admin_server_dispatch.h +++ b/src/admin/admin_server_dispatch.h @@ -18,12 +18,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_ADMIN_SERVER_DISPATCH_H -# define LIBVIRT_ADMIN_SERVER_DISPATCH_H +#pragma once -# include "rpc/virnetserverprogram.h" -# include "rpc/virnetserverclient.h" -# include "admin/admin_protocol.h" +#include "rpc/virnetserverprogram.h" +#include "rpc/virnetserverclient.h" +#include "admin/admin_protocol.h" extern virNetServerProgramProc adminProcs[]; @@ -36,5 +35,3 @@ void *remoteAdmClientNewPostExecRestart(virNetServerClientPtr client, void *opaque); virJSONValuePtr remoteAdmClientPreExecRestart(virNetServerClientPtr client, void *data); - -#endif /* LIBVIRT_ADMIN_SERVER_DISPATCH_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/bhyve/bhyve_capabilities.h | 11 ++++------- src/bhyve/bhyve_command.h | 15 ++++++--------- src/bhyve/bhyve_conf.h | 7 ++----- src/bhyve/bhyve_device.h | 11 ++++------- src/bhyve/bhyve_domain.h | 11 ++++------- src/bhyve/bhyve_driver.h | 9 +++------ src/bhyve/bhyve_monitor.h | 11 ++++------- src/bhyve/bhyve_parse_command.h | 5 +---- src/bhyve/bhyve_process.h | 7 ++----- src/bhyve/bhyve_utils.h | 31 ++++++++++++++----------------- 10 files changed, 44 insertions(+), 74 deletions(-) diff --git a/src/bhyve/bhyve_capabilities.h b/src/bhyve/bhyve_capabilities.h index db4aff4775..12926cf423 100644 --- a/src/bhyve/bhyve_capabilities.h +++ b/src/bhyve/bhyve_capabilities.h @@ -19,13 +19,12 @@ * */ -#ifndef LIBVIRT_BHYVE_CAPABILITIES_H -# define LIBVIRT_BHYVE_CAPABILITIES_H +#pragma once -# include "capabilities.h" -# include "conf/domain_capabilities.h" +#include "capabilities.h" +#include "conf/domain_capabilities.h" -# include "bhyve_utils.h" +#include "bhyve_utils.h" virCapsPtr virBhyveCapsBuild(void); int virBhyveDomainCapsFill(virDomainCapsPtr caps, @@ -54,5 +53,3 @@ typedef enum { int virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps); int virBhyveProbeCaps(unsigned int *caps); - -#endif /* LIBVIRT_BHYVE_CAPABILITIES_H */ diff --git a/src/bhyve/bhyve_command.h b/src/bhyve/bhyve_command.h index ae0f770ac2..8c39f4eb2f 100644 --- a/src/bhyve/bhyve_command.h +++ b/src/bhyve/bhyve_command.h @@ -19,16 +19,15 @@ * */ -#ifndef LIBVIRT_BHYVE_COMMAND_H -# define LIBVIRT_BHYVE_COMMAND_H +#pragma once -# include "bhyve_domain.h" -# include "bhyve_utils.h" +#include "bhyve_domain.h" +#include "bhyve_utils.h" -# include "domain_conf.h" -# include "vircommand.h" +#include "domain_conf.h" +#include "vircommand.h" -# define BHYVE_CONFIG_FORMAT_ARGV "bhyve-argv" +#define BHYVE_CONFIG_FORMAT_ARGV "bhyve-argv" virCommandPtr virBhyveProcessBuildBhyveCmd(virConnectPtr conn, virDomainDefPtr def, @@ -41,5 +40,3 @@ virBhyveProcessBuildDestroyCmd(bhyveConnPtr driver, virCommandPtr virBhyveProcessBuildLoadCmd(virConnectPtr conn, virDomainDefPtr def, const char *devmap_file, char **devicesmap_out); - -#endif /* LIBVIRT_BHYVE_COMMAND_H */ diff --git a/src/bhyve/bhyve_conf.h b/src/bhyve/bhyve_conf.h index eb4a2e0fb8..7dee377c76 100644 --- a/src/bhyve/bhyve_conf.h +++ b/src/bhyve/bhyve_conf.h @@ -19,10 +19,9 @@ * */ -#ifndef LIBVIRT_BHYVE_CONF_H -# define LIBVIRT_BHYVE_CONF_H +#pragma once -# include "bhyve_utils.h" +#include "bhyve_utils.h" virBhyveDriverConfigPtr virBhyveDriverConfigNew(void); virBhyveDriverConfigPtr virBhyveDriverGetConfig(bhyveConnPtr driver); @@ -37,5 +36,3 @@ struct _bhyveDomainCmdlineDef { }; void bhyveDomainCmdlineDefFree(bhyveDomainCmdlineDefPtr def); - -#endif /* LIBVIRT_BHYVE_CONF_H */ diff --git a/src/bhyve/bhyve_device.h b/src/bhyve/bhyve_device.h index 23b32e0e3e..30c08c2a61 100644 --- a/src/bhyve/bhyve_device.h +++ b/src/bhyve/bhyve_device.h @@ -18,12 +18,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_BHYVE_DEVICE_H -# define LIBVIRT_BHYVE_DEVICE_H +#pragma once -# include "domain_conf.h" -# include "virpci.h" -# include "bhyve_domain.h" +#include "domain_conf.h" +#include "virpci.h" +#include "bhyve_domain.h" int bhyveDomainAssignPCIAddresses(virDomainDefPtr def, virDomainObjPtr obj); @@ -32,5 +31,3 @@ virDomainPCIAddressSetPtr bhyveDomainPCIAddressSetCreate(virDomainDefPtr def, int bhyveDomainAssignAddresses(virDomainDefPtr def, virDomainObjPtr obj) ATTRIBUTE_NONNULL(1); - -#endif /* LIBVIRT_BHYVE_DEVICE_H */ diff --git a/src/bhyve/bhyve_domain.h b/src/bhyve/bhyve_domain.h index 03a2b369d9..17cb283e54 100644 --- a/src/bhyve/bhyve_domain.h +++ b/src/bhyve/bhyve_domain.h @@ -18,13 +18,12 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_BHYVE_DOMAIN_H -# define LIBVIRT_BHYVE_DOMAIN_H +#pragma once -# include "domain_addr.h" -# include "domain_conf.h" +#include "domain_addr.h" +#include "domain_conf.h" -# include "bhyve_monitor.h" +#include "bhyve_monitor.h" typedef struct _bhyveDomainObjPrivate bhyveDomainObjPrivate; typedef bhyveDomainObjPrivate *bhyveDomainObjPrivatePtr; @@ -42,5 +41,3 @@ extern virDomainDefParserConfig virBhyveDriverDomainDefParserConfig; extern virDomainXMLNamespace virBhyveDriverDomainXMLNamespace; bool bhyveDomainDefNeedsISAController(virDomainDefPtr def); - -#endif /* LIBVIRT_BHYVE_DOMAIN_H */ diff --git a/src/bhyve/bhyve_driver.h b/src/bhyve/bhyve_driver.h index 36d1f8be85..98e75039a3 100644 --- a/src/bhyve/bhyve_driver.h +++ b/src/bhyve/bhyve_driver.h @@ -18,11 +18,10 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_BHYVE_DRIVER_H -# define LIBVIRT_BHYVE_DRIVER_H +#pragma once -# include "capabilities.h" -# include "bhyve_utils.h" +#include "capabilities.h" +#include "bhyve_utils.h" int bhyveRegister(void); @@ -31,5 +30,3 @@ unsigned bhyveDriverGetCaps(virConnectPtr conn); unsigned bhyveDriverGetGrubCaps(virConnectPtr conn); virCapsPtr bhyveDriverGetCapabilities(bhyveConnPtr driver); - -#endif /* LIBVIRT_BHYVE_DRIVER_H */ diff --git a/src/bhyve/bhyve_monitor.h b/src/bhyve/bhyve_monitor.h index 54c9e70040..226866e6d9 100644 --- a/src/bhyve/bhyve_monitor.h +++ b/src/bhyve/bhyve_monitor.h @@ -18,17 +18,14 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_BHYVE_MONITOR_H -# define LIBVIRT_BHYVE_MONITOR_H +#pragma once -# include "internal.h" -# include "domain_conf.h" -# include "bhyve_utils.h" +#include "internal.h" +#include "domain_conf.h" +#include "bhyve_utils.h" typedef struct _bhyveMonitor bhyveMonitor; typedef bhyveMonitor *bhyveMonitorPtr; bhyveMonitorPtr bhyveMonitorOpen(virDomainObjPtr vm, bhyveConnPtr driver); void bhyveMonitorClose(bhyveMonitorPtr mon); - -#endif /* LIBVIRT_BHYVE_MONITOR_H */ diff --git a/src/bhyve/bhyve_parse_command.h b/src/bhyve/bhyve_parse_command.h index 3609107711..38521dcc55 100644 --- a/src/bhyve/bhyve_parse_command.h +++ b/src/bhyve/bhyve_parse_command.h @@ -18,11 +18,8 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_BHYVE_PARSE_COMMAND_H -# define LIBVIRT_BHYVE_PARSE_COMMAND_H +#pragma once virDomainDefPtr bhyveParseCommandLineString(const char* nativeConfig, unsigned caps, virDomainXMLOptionPtr xmlopt); - -#endif /* LIBVIRT_BHYVE_PARSE_COMMAND_H */ diff --git a/src/bhyve/bhyve_process.h b/src/bhyve/bhyve_process.h index f9ad5b6b5a..4f62f6be4b 100644 --- a/src/bhyve/bhyve_process.h +++ b/src/bhyve/bhyve_process.h @@ -19,10 +19,9 @@ * */ -#ifndef LIBVIRT_BHYVE_PROCESS_H -# define LIBVIRT_BHYVE_PROCESS_H +#pragma once -# include "bhyve_utils.h" +#include "bhyve_utils.h" int virBhyveProcessStart(virConnectPtr conn, bhyveConnPtr driver, @@ -44,5 +43,3 @@ void virBhyveProcessReconnectAll(bhyveConnPtr driver); typedef enum { VIR_BHYVE_PROCESS_START_AUTODESTROY = 1 << 0, } bhyveProcessStartFlags; - -#endif /* LIBVIRT_BHYVE_PROCESS_H */ diff --git a/src/bhyve/bhyve_utils.h b/src/bhyve/bhyve_utils.h index e915bedd87..26956d7d21 100644 --- a/src/bhyve/bhyve_utils.h +++ b/src/bhyve/bhyve_utils.h @@ -19,21 +19,20 @@ * */ -#ifndef LIBVIRT_BHYVE_UTILS_H -# define LIBVIRT_BHYVE_UTILS_H - -# include "driver.h" -# include "domain_event.h" -# include "configmake.h" -# include "virdomainobjlist.h" -# include "virthread.h" -# include "virclosecallbacks.h" -# include "virportallocator.h" - -# define BHYVE_AUTOSTART_DIR SYSCONFDIR "/libvirt/bhyve/autostart" -# define BHYVE_CONFIG_DIR SYSCONFDIR "/libvirt/bhyve" -# define BHYVE_STATE_DIR LOCALSTATEDIR "/run/libvirt/bhyve" -# define BHYVE_LOG_DIR LOCALSTATEDIR "/log/libvirt/bhyve" +#pragma once + +#include "driver.h" +#include "domain_event.h" +#include "configmake.h" +#include "virdomainobjlist.h" +#include "virthread.h" +#include "virclosecallbacks.h" +#include "virportallocator.h" + +#define BHYVE_AUTOSTART_DIR SYSCONFDIR "/libvirt/bhyve/autostart" +#define BHYVE_CONFIG_DIR SYSCONFDIR "/libvirt/bhyve" +#define BHYVE_STATE_DIR LOCALSTATEDIR "/run/libvirt/bhyve" +#define BHYVE_LOG_DIR LOCALSTATEDIR "/log/libvirt/bhyve" typedef struct _virBhyveDriverConfig virBhyveDriverConfig; typedef struct _virBhyveDriverConfig *virBhyveDriverConfigPtr; @@ -75,5 +74,3 @@ struct bhyveAutostartData { void bhyveDriverLock(bhyveConnPtr driver); void bhyveDriverUnlock(bhyveConnPtr driver); - -#endif /* LIBVIRT_BHYVE_UTILS_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/conf/domain_addr.h | 16 +++--- src/conf/domain_audit.h | 10 ++-- src/conf/domain_capabilities.h | 15 +++--- src/conf/domain_conf.h | 91 ++++++++++++++++------------------ src/conf/domain_event.h | 11 ++-- src/conf/domain_nwfilter.h | 5 +- 6 files changed, 65 insertions(+), 83 deletions(-) diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index 803d07d415..dcb90618f8 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -19,13 +19,12 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DOMAIN_ADDR_H -# define LIBVIRT_DOMAIN_ADDR_H +#pragma once -# include "domain_conf.h" +#include "domain_conf.h" -# define VIR_PCI_ADDRESS_SLOT_LAST 31 -# define VIR_PCI_ADDRESS_FUNCTION_LAST 7 +#define VIR_PCI_ADDRESS_SLOT_LAST 31 +#define VIR_PCI_ADDRESS_FUNCTION_LAST 7 typedef enum { VIR_PCI_ADDRESS_EXTENSION_NONE = 0, /* no extension */ @@ -58,7 +57,7 @@ typedef enum { /* a combination of all bits that describe the type of connections * allowed, e.g. PCI, PCIe, switch */ -# define VIR_PCI_CONNECT_TYPES_MASK \ +#define VIR_PCI_CONNECT_TYPES_MASK \ (VIR_PCI_CONNECT_TYPE_PCI_DEVICE | VIR_PCI_CONNECT_TYPE_PCIE_DEVICE | \ VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_UPSTREAM_PORT | \ VIR_PCI_CONNECT_TYPE_PCIE_SWITCH_DOWNSTREAM_PORT | \ @@ -74,7 +73,7 @@ typedef enum { * upstream and downstream switch port, or a PCIe root port and a PCIe * port) */ -# define VIR_PCI_CONNECT_TYPES_ENDPOINT \ +#define VIR_PCI_CONNECT_TYPES_ENDPOINT \ (VIR_PCI_CONNECT_TYPE_PCI_DEVICE | VIR_PCI_CONNECT_TYPE_PCIE_DEVICE) virDomainPCIConnectFlags @@ -255,7 +254,7 @@ virDomainUSBAddressPortFormatBuf(virBufferPtr buf, unsigned int *port) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -# define VIR_DOMAIN_USB_HUB_PORTS 8 +#define VIR_DOMAIN_USB_HUB_PORTS 8 typedef struct _virDomainUSBAddressHub virDomainUSBAddressHub; typedef virDomainUSBAddressHub *virDomainUSBAddressHubPtr; @@ -312,4 +311,3 @@ int virDomainUSBAddressRelease(virDomainUSBAddressSetPtr addrs, virDomainDeviceInfoPtr info) ATTRIBUTE_NONNULL(2); -#endif /* LIBVIRT_DOMAIN_ADDR_H */ diff --git a/src/conf/domain_audit.h b/src/conf/domain_audit.h index ee8a4aa70e..d34c750427 100644 --- a/src/conf/domain_audit.h +++ b/src/conf/domain_audit.h @@ -19,11 +19,10 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DOMAIN_AUDIT_H -# define LIBVIRT_DOMAIN_AUDIT_H +#pragma once -# include "domain_conf.h" -# include "vircgroup.h" +#include "domain_conf.h" +#include "vircgroup.h" void virDomainAuditStart(virDomainObjPtr vm, const char *reason, @@ -136,6 +135,3 @@ void virDomainAuditInput(virDomainObjPtr vm, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); - - -#endif /* LIBVIRT_DOMAIN_AUDIT_H */ diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index cd09d50cee..96ab59cae9 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -18,13 +18,12 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DOMAIN_CAPABILITIES_H -# define LIBVIRT_DOMAIN_CAPABILITIES_H +#pragma once -# include "internal.h" -# include "domain_conf.h" -# include "virautoclean.h" -# include "virenum.h" +#include "internal.h" +#include "domain_conf.h" +#include "virautoclean.h" +#include "virenum.h" typedef const char * (*virDomainCapsValToStr)(int value); @@ -201,7 +200,7 @@ virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels, const char *name); -# define VIR_DOMAIN_CAPS_ENUM_SET(capsEnum, ...) \ +#define VIR_DOMAIN_CAPS_ENUM_SET(capsEnum, ...) \ do { \ unsigned int __values[] = {__VA_ARGS__}; \ size_t __nvalues = ARRAY_CARDINALITY(__values); \ @@ -221,5 +220,3 @@ void virSEVCapabilitiesFree(virSEVCapability *capabilities); VIR_DEFINE_AUTOPTR_FUNC(virSEVCapability, virSEVCapabilitiesFree); - -#endif /* LIBVIRT_DOMAIN_CAPABILITIES_H */ diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 4c3ab07062..471c18ae19 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -20,43 +20,42 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DOMAIN_CONF_H -# define LIBVIRT_DOMAIN_CONF_H - -# include <libxml/parser.h> -# include <libxml/tree.h> -# include <libxml/xpath.h> - -# include "internal.h" -# include "virconftypes.h" -# include "capabilities.h" -# include "virstorageencryption.h" -# include "cpu_conf.h" -# include "virthread.h" -# include "virhash.h" -# include "virsocketaddr.h" -# include "networkcommon_conf.h" -# include "nwfilter_params.h" -# include "numa_conf.h" -# include "virnetdevmacvlan.h" -# include "virsysinfo.h" -# include "virnetdev.h" -# include "virnetdevip.h" -# include "virnetdevvportprofile.h" -# include "virnetdevbandwidth.h" -# include "virnetdevvlan.h" -# include "virobject.h" -# include "device_conf.h" -# include "virbitmap.h" -# include "virstoragefile.h" -# include "virseclabel.h" -# include "virprocess.h" -# include "virgic.h" -# include "virperf.h" -# include "virtypedparam.h" -# include "virsavecookie.h" -# include "virresctrl.h" -# include "virenum.h" +#pragma once + +#include <libxml/parser.h> +#include <libxml/tree.h> +#include <libxml/xpath.h> + +#include "internal.h" +#include "virconftypes.h" +#include "capabilities.h" +#include "virstorageencryption.h" +#include "cpu_conf.h" +#include "virthread.h" +#include "virhash.h" +#include "virsocketaddr.h" +#include "networkcommon_conf.h" +#include "nwfilter_params.h" +#include "numa_conf.h" +#include "virnetdevmacvlan.h" +#include "virsysinfo.h" +#include "virnetdev.h" +#include "virnetdevip.h" +#include "virnetdevvportprofile.h" +#include "virnetdevbandwidth.h" +#include "virnetdevvlan.h" +#include "virobject.h" +#include "device_conf.h" +#include "virbitmap.h" +#include "virstoragefile.h" +#include "virseclabel.h" +#include "virprocess.h" +#include "virgic.h" +#include "virperf.h" +#include "virtypedparam.h" +#include "virsavecookie.h" +#include "virresctrl.h" +#include "virenum.h" /* Flags for the 'type' field in virDomainDeviceDef */ typedef enum { @@ -680,7 +679,7 @@ typedef enum { VIR_DOMAIN_CONTROLLER_MODEL_VIRTIO_SERIAL_LAST } virDomainControllerModelVirtioSerial; -# define IS_USB2_CONTROLLER(ctrl) \ +#define IS_USB2_CONTROLLER(ctrl) \ (((ctrl)->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) && \ ((ctrl)->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1 || \ (ctrl)->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI1 || \ @@ -1208,8 +1207,8 @@ typedef enum { VIR_DOMAIN_SMARTCARD_TYPE_LAST } virDomainSmartcardType; -# define VIR_DOMAIN_SMARTCARD_NUM_CERTIFICATES 3 -# define VIR_DOMAIN_SMARTCARD_DEFAULT_DATABASE "/etc/pki/nssdb" +#define VIR_DOMAIN_SMARTCARD_NUM_CERTIFICATES 3 +#define VIR_DOMAIN_SMARTCARD_DEFAULT_DATABASE "/etc/pki/nssdb" struct _virDomainSmartcardDef { int type; /* virDomainSmartcardType */ @@ -1252,7 +1251,7 @@ typedef enum { VIR_DOMAIN_TPM_VERSION_LAST } virDomainTPMVersion; -# define VIR_DOMAIN_TPM_DEFAULT_DEVICE "/dev/tpm0" +#define VIR_DOMAIN_TPM_DEFAULT_DEVICE "/dev/tpm0" struct _virDomainTPMDef { int type; /* virDomainTPMBackendType */ @@ -1701,7 +1700,7 @@ typedef enum { } virDomainSmbiosMode; -# define VIR_DOMAIN_MAX_BOOT_DEVS 4 +#define VIR_DOMAIN_MAX_BOOT_DEVS 4 typedef enum { VIR_DOMAIN_BOOT_FLOPPY, @@ -1737,7 +1736,7 @@ typedef enum { VIR_DOMAIN_FEATURE_LAST } virDomainFeature; -# define VIR_DOMAIN_HYPERV_VENDOR_ID_MAX 12 +#define VIR_DOMAIN_HYPERV_VENDOR_ID_MAX 12 typedef enum { VIR_DOMAIN_HYPERV_RELAXED = 0, @@ -2167,7 +2166,7 @@ struct _virDomainHugePage { unsigned long long size; /* hugepage size in KiB */ }; -# define VIR_DOMAIN_CPUMASK_LEN 1024 +#define VIR_DOMAIN_CPUMASK_LEN 1024 struct _virDomainIOThreadIDDef { bool autofill; @@ -3042,7 +3041,7 @@ void virDomainIOThreadIDDel(virDomainDefPtr def, unsigned int iothread_id); * server omits the requested output, but a new flag to suppress * information could result in a security hole when older libvirt * supplies the sensitive information in spite of the flag. */ -# define VIR_DOMAIN_XML_COMMON_FLAGS \ +#define VIR_DOMAIN_XML_COMMON_FLAGS \ (VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_INACTIVE | \ VIR_DOMAIN_XML_MIGRATABLE) unsigned int virDomainDefFormatConvertXMLFlags(unsigned int flags); @@ -3637,5 +3636,3 @@ virDomainGraphicsGetRenderNode(const virDomainGraphicsDef *graphics); bool virDomainGraphicsNeedsAutoRenderNode(const virDomainGraphicsDef *graphics); - -#endif /* LIBVIRT_DOMAIN_CONF_H */ diff --git a/src/conf/domain_event.h b/src/conf/domain_event.h index 637f1daf68..d1cfb81d62 100644 --- a/src/conf/domain_event.h +++ b/src/conf/domain_event.h @@ -20,12 +20,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DOMAIN_EVENT_H -# define LIBVIRT_DOMAIN_EVENT_H +#pragma once -# include "internal.h" -# include "object_event.h" -# include "domain_conf.h" +#include "internal.h" +#include "object_event.h" +#include "domain_conf.h" virObjectEventPtr @@ -323,5 +322,3 @@ virDomainQemuMonitorEventNew(int id, unsigned int micros, const char *details) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); - -#endif /* LIBVIRT_DOMAIN_EVENT_H */ diff --git a/src/conf/domain_nwfilter.h b/src/conf/domain_nwfilter.h index 9429ee6493..f44fbcce7d 100644 --- a/src/conf/domain_nwfilter.h +++ b/src/conf/domain_nwfilter.h @@ -19,8 +19,7 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DOMAIN_NWFILTER_H -# define LIBVIRT_DOMAIN_NWFILTER_H +#pragma once int virDomainConfNWFilterInstantiate(const char *vmname, const unsigned char *vmuuid, @@ -28,5 +27,3 @@ int virDomainConfNWFilterInstantiate(const char *vmname, bool ignoreExists); void virDomainConfNWFilterTeardown(virDomainNetDefPtr net); void virDomainConfVMNWFilterTeardown(virDomainObjPtr vm); - -#endif /* LIBVIRT_DOMAIN_NWFILTER_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/conf/netdev_bandwidth_conf.h | 15 ++++---- src/conf/netdev_vlan_conf.h | 13 +++---- src/conf/netdev_vport_profile_conf.h | 14 +++----- src/conf/network_conf.h | 52 +++++++++++++--------------- src/conf/network_event.h | 11 +++--- src/conf/networkcommon_conf.h | 17 ++++----- src/conf/virnetworkobj.h | 9 ++--- 7 files changed, 55 insertions(+), 76 deletions(-) diff --git a/src/conf/netdev_bandwidth_conf.h b/src/conf/netdev_bandwidth_conf.h index 7fe750ce27..c10574d0b6 100644 --- a/src/conf/netdev_bandwidth_conf.h +++ b/src/conf/netdev_bandwidth_conf.h @@ -16,14 +16,13 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_NETDEV_BANDWIDTH_CONF_H -# define LIBVIRT_NETDEV_BANDWIDTH_CONF_H +#pragma once -# include "internal.h" -# include "virnetdevbandwidth.h" -# include "virbuffer.h" -# include "virxml.h" -# include "domain_conf.h" +#include "internal.h" +#include "virnetdevbandwidth.h" +#include "virbuffer.h" +#include "virxml.h" +#include "domain_conf.h" int virNetDevBandwidthParse(virNetDevBandwidthPtr *bandwidth, xmlNodePtr node, @@ -56,5 +55,3 @@ static inline bool virNetDevSupportBandwidth(virDomainNetType type) } return false; } - -#endif /* LIBVIRT_NETDEV_BANDWIDTH_CONF_H */ diff --git a/src/conf/netdev_vlan_conf.h b/src/conf/netdev_vlan_conf.h index e3a99790eb..f798c2ae2d 100644 --- a/src/conf/netdev_vlan_conf.h +++ b/src/conf/netdev_vlan_conf.h @@ -16,15 +16,12 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_NETDEV_VLAN_CONF_H -# define LIBVIRT_NETDEV_VLAN_CONF_H +#pragma once -# include "internal.h" -# include "virnetdevvlan.h" -# include "virbuffer.h" -# include "virxml.h" +#include "internal.h" +#include "virnetdevvlan.h" +#include "virbuffer.h" +#include "virxml.h" int virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr def); int virNetDevVlanFormat(const virNetDevVlan *def, virBufferPtr buf); - -#endif /* LIBVIRT_NETDEV_VLAN_CONF_H */ diff --git a/src/conf/netdev_vport_profile_conf.h b/src/conf/netdev_vport_profile_conf.h index 9044217fb0..a2989af81e 100644 --- a/src/conf/netdev_vport_profile_conf.h +++ b/src/conf/netdev_vport_profile_conf.h @@ -16,13 +16,12 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_NETDEV_VPORT_PROFILE_CONF_H -# define LIBVIRT_NETDEV_VPORT_PROFILE_CONF_H +#pragma once -# include "internal.h" -# include "virnetdevvportprofile.h" -# include "virbuffer.h" -# include "virxml.h" +#include "internal.h" +#include "virnetdevvportprofile.h" +#include "virbuffer.h" +#include "virxml.h" typedef enum { /* generate random defaults for interfaceID/interfaceID @@ -43,6 +42,3 @@ virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags); int virNetDevVPortProfileFormat(virNetDevVPortProfilePtr virtPort, virBufferPtr buf); - - -#endif /* LIBVIRT_NETDEV_VPORT_PROFILE_CONF_H */ diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h index 5410a57c67..424c4b0913 100644 --- a/src/conf/network_conf.h +++ b/src/conf/network_conf.h @@ -19,28 +19,27 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_NETWORK_CONF_H -# define LIBVIRT_NETWORK_CONF_H - -# define DNS_RECORD_LENGTH_SRV (512 - 30) /* Limit minus overhead as mentioned in RFC-2782 */ - -# include <libxml/parser.h> -# include <libxml/tree.h> -# include <libxml/xpath.h> - -# include "internal.h" -# include "virthread.h" -# include "virsocketaddr.h" -# include "virnetdevbandwidth.h" -# include "virnetdevvportprofile.h" -# include "virnetdevvlan.h" -# include "virmacaddr.h" -# include "device_conf.h" -# include "virbitmap.h" -# include "networkcommon_conf.h" -# include "virobject.h" -# include "virmacmap.h" -# include "virenum.h" +#pragma once + +#define DNS_RECORD_LENGTH_SRV (512 - 30) /* Limit minus overhead as mentioned in RFC-2782 */ + +#include <libxml/parser.h> +#include <libxml/tree.h> +#include <libxml/xpath.h> + +#include "internal.h" +#include "virthread.h" +#include "virsocketaddr.h" +#include "virnetdevbandwidth.h" +#include "virnetdevvportprofile.h" +#include "virnetdevvlan.h" +#include "virmacaddr.h" +#include "device_conf.h" +#include "virbitmap.h" +#include "networkcommon_conf.h" +#include "virobject.h" +#include "virmacmap.h" +#include "virenum.h" typedef enum { VIR_NETWORK_FORWARD_NONE = 0, @@ -358,19 +357,19 @@ virNetworkSetBridgeMacAddr(virNetworkDefPtr def); VIR_ENUM_DECL(virNetworkForward); -# define VIR_CONNECT_LIST_NETWORKS_FILTERS_ACTIVE \ +#define VIR_CONNECT_LIST_NETWORKS_FILTERS_ACTIVE \ (VIR_CONNECT_LIST_NETWORKS_ACTIVE | \ VIR_CONNECT_LIST_NETWORKS_INACTIVE) -# define VIR_CONNECT_LIST_NETWORKS_FILTERS_PERSISTENT \ +#define VIR_CONNECT_LIST_NETWORKS_FILTERS_PERSISTENT \ (VIR_CONNECT_LIST_NETWORKS_PERSISTENT | \ VIR_CONNECT_LIST_NETWORKS_TRANSIENT) -# define VIR_CONNECT_LIST_NETWORKS_FILTERS_AUTOSTART \ +#define VIR_CONNECT_LIST_NETWORKS_FILTERS_AUTOSTART \ (VIR_CONNECT_LIST_NETWORKS_AUTOSTART | \ VIR_CONNECT_LIST_NETWORKS_NO_AUTOSTART) -# define VIR_CONNECT_LIST_NETWORKS_FILTERS_ALL \ +#define VIR_CONNECT_LIST_NETWORKS_FILTERS_ALL \ (VIR_CONNECT_LIST_NETWORKS_FILTERS_ACTIVE | \ VIR_CONNECT_LIST_NETWORKS_FILTERS_PERSISTENT | \ VIR_CONNECT_LIST_NETWORKS_FILTERS_AUTOSTART) @@ -385,4 +384,3 @@ virNetworkDefUpdateSection(virNetworkDefPtr def, unsigned int flags); /* virNetworkUpdateFlags */ VIR_ENUM_DECL(virNetworkTaint); -#endif /* LIBVIRT_NETWORK_CONF_H */ diff --git a/src/conf/network_event.h b/src/conf/network_event.h index d3d17dd168..2267003970 100644 --- a/src/conf/network_event.h +++ b/src/conf/network_event.h @@ -19,12 +19,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_NETWORK_EVENT_H -# define LIBVIRT_NETWORK_EVENT_H +#pragma once -# include "internal.h" -# include "object_event.h" -# include "object_event_private.h" +#include "internal.h" +#include "object_event.h" +#include "object_event_private.h" int virNetworkEventStateRegisterID(virConnectPtr conn, @@ -55,5 +54,3 @@ virNetworkEventLifecycleNew(const char *name, const unsigned char *uuid, int type, int detail); - -#endif /* LIBVIRT_NETWORK_EVENT_H */ diff --git a/src/conf/networkcommon_conf.h b/src/conf/networkcommon_conf.h index b6c37a5a28..b257ffdd9c 100644 --- a/src/conf/networkcommon_conf.h +++ b/src/conf/networkcommon_conf.h @@ -20,16 +20,15 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_NETWORKCOMMON_CONF_H -# define LIBVIRT_NETWORKCOMMON_CONF_H +#pragma once -# include <libxml/tree.h> -# include <libxml/xpath.h> +#include <libxml/tree.h> +#include <libxml/xpath.h> -# include "internal.h" -# include "virbuffer.h" -# include "virsocketaddr.h" -# include "virnetdevip.h" +#include "internal.h" +#include "virbuffer.h" +#include "virsocketaddr.h" +#include "virnetdevip.h" virNetDevIPRoutePtr virNetDevIPRouteCreate(const char *networkName, @@ -49,5 +48,3 @@ virNetDevIPRouteParseXML(const char *networkName, int virNetDevIPRouteFormat(virBufferPtr buf, const virNetDevIPRoute *def); - -#endif /* LIBVIRT_NETWORKCOMMON_CONF_H */ diff --git a/src/conf/virnetworkobj.h b/src/conf/virnetworkobj.h index 9c8f141cd9..3b296a10b3 100644 --- a/src/conf/virnetworkobj.h +++ b/src/conf/virnetworkobj.h @@ -17,12 +17,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRNETWORKOBJ_H -# define LIBVIRT_VIRNETWORKOBJ_H +#pragma once -# include "internal.h" +#include "internal.h" -# include "network_conf.h" +#include "network_conf.h" typedef struct _virNetworkObj virNetworkObj; typedef virNetworkObj *virNetworkObjPtr; @@ -220,5 +219,3 @@ virNetworkObjListNumOfNetworks(virNetworkObjListPtr nets, void virNetworkObjListPrune(virNetworkObjListPtr nets, unsigned int flags); - -#endif /* LIBVIRT_VIRNETWORKOBJ_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/conf/nwfilter_conf.h | 93 ++++++++++++++-------------- src/conf/nwfilter_ipaddrmap.h | 5 +- src/conf/nwfilter_params.h | 28 ++++----- src/conf/virnwfilterbindingdef.h | 13 ++-- src/conf/virnwfilterbindingobj.h | 11 ++-- src/conf/virnwfilterbindingobjlist.h | 8 +-- src/conf/virnwfilterobj.h | 11 ++-- 7 files changed, 73 insertions(+), 96 deletions(-) diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h index 4366ccc4d1..13db58e380 100644 --- a/src/conf/nwfilter_conf.h +++ b/src/conf/nwfilter_conf.h @@ -22,18 +22,17 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_NWFILTER_CONF_H -# define LIBVIRT_NWFILTER_CONF_H +#pragma once -# include "internal.h" +#include "internal.h" -# include "virhash.h" -# include "virxml.h" -# include "virbuffer.h" -# include "virsocketaddr.h" -# include "virmacaddr.h" -# include "virdomainobjlist.h" -# include "virenum.h" +#include "virhash.h" +#include "virxml.h" +#include "virbuffer.h" +#include "virsocketaddr.h" +#include "virmacaddr.h" +#include "virdomainobjlist.h" +#include "virenum.h" /* XXX * The config parser/structs should not be using platform specific @@ -41,21 +40,21 @@ * so temporarily define them until this can be re-written to use * locally defined enums for all constants */ -# ifndef ETHERTYPE_IP -# define ETHERTYPE_IP 0x0800 -# endif -# ifndef ETHERTYPE_ARP -# define ETHERTYPE_ARP 0x0806 -# endif -# ifndef ETHERTYPE_REVARP -# define ETHERTYPE_REVARP 0x8035 -# endif -# ifndef ETHERTYPE_IPV6 -# define ETHERTYPE_IPV6 0x86dd -# endif -# ifndef ETHERTYPE_VLAN -# define ETHERTYPE_VLAN 0x8100 -# endif +#ifndef ETHERTYPE_IP +# define ETHERTYPE_IP 0x0800 +#endif +#ifndef ETHERTYPE_ARP +# define ETHERTYPE_ARP 0x0806 +#endif +#ifndef ETHERTYPE_REVARP +# define ETHERTYPE_REVARP 0x8035 +#endif +#ifndef ETHERTYPE_IPV6 +# define ETHERTYPE_IPV6 0x86dd +#endif +#ifndef ETHERTYPE_VLAN +# define ETHERTYPE_VLAN 0x8100 +#endif /** * Chain suffix size is: @@ -66,7 +65,7 @@ * terminating '0' = * 32-3-15-1-1 = 12 */ -# define MAX_CHAIN_SUFFIX_SIZE 12 +#define MAX_CHAIN_SUFFIX_SIZE 12 typedef enum { @@ -76,13 +75,13 @@ typedef enum { } virNWFilterEntryItemFlags; -# define MAX_COMMENT_LENGTH 256 -# define MAX_IPSET_NAME_LENGTH 32 /* incl. terminating '\0' */ +#define MAX_COMMENT_LENGTH 256 +#define MAX_IPSET_NAME_LENGTH 32 /* incl. terminating '\0' */ -# define HAS_ENTRY_ITEM(data) \ +#define HAS_ENTRY_ITEM(data) \ (((data)->flags) & NWFILTER_ENTRY_ITEM_FLAG_EXISTS) -# define ENTRY_WANT_NEG_SIGN(data) \ +#define ENTRY_WANT_NEG_SIGN(data) \ (((data)->flags) & NWFILTER_ENTRY_ITEM_FLAG_IS_NEG) /* datatypes appearing in rule attributes */ @@ -108,7 +107,7 @@ typedef enum attrDatatype { DATATYPE_LAST = (1 << 17), } virNWFilterAttrDataType; -# define NWFILTER_MAC_BGA "01:80:c2:00:00:00" +#define NWFILTER_MAC_BGA "01:80:c2:00:00:00" typedef struct _nwItemDesc nwItemDesc; @@ -138,7 +137,7 @@ struct _nwItemDesc { } u; }; -# define VALID_IPSETNAME \ +#define VALID_IPSETNAME \ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.:-+ " typedef struct _ethHdrDataDef ethHdrDataDef; @@ -426,20 +425,20 @@ typedef enum { } virNWFilterEbtablesTableType; -# define MIN_RULE_PRIORITY -1000 -# define MAX_RULE_PRIORITY 1000 +#define MIN_RULE_PRIORITY -1000 +#define MAX_RULE_PRIORITY 1000 -# define NWFILTER_MIN_FILTER_PRIORITY -1000 -# define NWFILTER_MAX_FILTER_PRIORITY MAX_RULE_PRIORITY +#define NWFILTER_MIN_FILTER_PRIORITY -1000 +#define NWFILTER_MAX_FILTER_PRIORITY MAX_RULE_PRIORITY -# define NWFILTER_ROOT_FILTER_PRI 0 -# define NWFILTER_STP_FILTER_PRI -810 -# define NWFILTER_MAC_FILTER_PRI -800 -# define NWFILTER_VLAN_FILTER_PRI -750 -# define NWFILTER_IPV4_FILTER_PRI -700 -# define NWFILTER_IPV6_FILTER_PRI -600 -# define NWFILTER_ARP_FILTER_PRI -500 -# define NWFILTER_RARP_FILTER_PRI -400 +#define NWFILTER_ROOT_FILTER_PRI 0 +#define NWFILTER_STP_FILTER_PRI -810 +#define NWFILTER_MAC_FILTER_PRI -800 +#define NWFILTER_VLAN_FILTER_PRI -750 +#define NWFILTER_IPV4_FILTER_PRI -700 +#define NWFILTER_IPV6_FILTER_PRI -600 +#define NWFILTER_ARP_FILTER_PRI -500 +#define NWFILTER_RARP_FILTER_PRI -400 typedef enum { RULE_FLAG_NO_STATEMATCH = (1 << 0), @@ -451,7 +450,7 @@ typedef enum { } virNWFilterRuleFlags; -# define IPTABLES_STATE_FLAGS \ +#define IPTABLES_STATE_FLAGS \ (RULE_FLAG_STATE_NEW | \ RULE_FLAG_STATE_ESTABLISHED | \ RULE_FLAG_STATE_RELATED | \ @@ -525,7 +524,7 @@ typedef enum { VIR_NWFILTER_CHAINSUFFIX_LAST, } virNWFilterChainSuffixType; -# define VALID_CHAINNAME \ +#define VALID_CHAINNAME \ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.:-" typedef int32_t virNWFilterChainPriority; @@ -615,5 +614,3 @@ VIR_ENUM_DECL(virNWFilterJumpTarget); VIR_ENUM_DECL(virNWFilterChainPolicy); VIR_ENUM_DECL(virNWFilterEbtablesTable); VIR_ENUM_DECL(virNWFilterChainSuffix); - -#endif /* LIBVIRT_NWFILTER_CONF_H */ diff --git a/src/conf/nwfilter_ipaddrmap.h b/src/conf/nwfilter_ipaddrmap.h index 13e763ae7e..ebb999a29a 100644 --- a/src/conf/nwfilter_ipaddrmap.h +++ b/src/conf/nwfilter_ipaddrmap.h @@ -20,8 +20,7 @@ * */ -#ifndef LIBVIRT_NWFILTER_IPADDRMAP_H -# define LIBVIRT_NWFILTER_IPADDRMAP_H +#pragma once int virNWFilterIPAddrMapInit(void); void virNWFilterIPAddrMapShutdown(void); @@ -30,5 +29,3 @@ int virNWFilterIPAddrMapAddIPAddr(const char *ifname, char *addr); int virNWFilterIPAddrMapDelIPAddr(const char *ifname, const char *ipaddr); virNWFilterVarValuePtr virNWFilterIPAddrMapGetIPAddr(const char *ifname); - -#endif /* LIBVIRT_NWFILTER_IPADDRMAP_H */ diff --git a/src/conf/nwfilter_params.h b/src/conf/nwfilter_params.h index 9abeeba43a..d51f3f7f9f 100644 --- a/src/conf/nwfilter_params.h +++ b/src/conf/nwfilter_params.h @@ -19,13 +19,12 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_NWFILTER_PARAMS_H -# define LIBVIRT_NWFILTER_PARAMS_H +#pragma once -# include "virhash.h" -# include "virbuffer.h" -# include "virmacaddr.h" -# include "virxml.h" +#include "virhash.h" +#include "virbuffer.h" +#include "virmacaddr.h" +#include "virxml.h" typedef enum { NWFILTER_VALUE_TYPE_SIMPLE, @@ -74,16 +73,16 @@ int virNWFilterHashTablePutAll(virHashTablePtr src, bool virNWFilterHashTableEqual(virHashTablePtr a, virHashTablePtr b); -# define VALID_VARNAME \ +#define VALID_VARNAME \ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_" -# define VALID_VARVALUE \ +#define VALID_VARVALUE \ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.:" -# define NWFILTER_VARNAME_IP "IP" -# define NWFILTER_VARNAME_MAC "MAC" -# define NWFILTER_VARNAME_CTRL_IP_LEARNING "CTRL_IP_LEARNING" -# define NWFILTER_VARNAME_DHCPSERVER "DHCPSERVER" +#define NWFILTER_VARNAME_IP "IP" +#define NWFILTER_VARNAME_MAC "MAC" +#define NWFILTER_VARNAME_CTRL_IP_LEARNING "CTRL_IP_LEARNING" +#define NWFILTER_VARNAME_DHCPSERVER "DHCPSERVER" typedef enum { VIR_NWFILTER_VAR_ACCESS_ELEMENT = 0, @@ -106,7 +105,7 @@ struct _virNWFilterVarAccess { char *varName; }; -# define VIR_NWFILTER_MAX_ITERID 1000 +#define VIR_NWFILTER_MAX_ITERID 1000 void virNWFilterVarAccessFree(virNWFilterVarAccessPtr varAccess); bool virNWFilterVarAccessEqual(const virNWFilterVarAccess *a, @@ -150,6 +149,3 @@ virNWFilterVarCombIterPtr virNWFilterVarCombIterNext( virNWFilterVarCombIterPtr ci); const char *virNWFilterVarCombIterGetVarValue(virNWFilterVarCombIterPtr ci, const virNWFilterVarAccess *); - - -#endif /* LIBVIRT_NWFILTER_PARAMS_H */ diff --git a/src/conf/virnwfilterbindingdef.h b/src/conf/virnwfilterbindingdef.h index 7cd2890b15..3d291fd6bf 100644 --- a/src/conf/virnwfilterbindingdef.h +++ b/src/conf/virnwfilterbindingdef.h @@ -19,13 +19,12 @@ * */ -#ifndef LIBVIRT_VIRNWFILTERBINDINGDEF_H -# define LIBVIRT_VIRNWFILTERBINDINGDEF_H +#pragma once -# include "internal.h" -# include "virmacaddr.h" -# include "virhash.h" -# include "virbuffer.h" +#include "internal.h" +#include "virmacaddr.h" +#include "virhash.h" +#include "virbuffer.h" typedef struct _virNWFilterBindingDef virNWFilterBindingDef; typedef virNWFilterBindingDef *virNWFilterBindingDefPtr; @@ -62,5 +61,3 @@ virNWFilterBindingDefFormat(const virNWFilterBindingDef *def); int virNWFilterBindingDefFormatBuf(virBufferPtr buf, const virNWFilterBindingDef *def); - -#endif /* LIBVIRT_VIRNWFILTERBINDINGDEF_H */ diff --git a/src/conf/virnwfilterbindingobj.h b/src/conf/virnwfilterbindingobj.h index b26bb3c8ec..2318f042bc 100644 --- a/src/conf/virnwfilterbindingobj.h +++ b/src/conf/virnwfilterbindingobj.h @@ -19,12 +19,11 @@ * */ -#ifndef LIBVIRT_VIRNWFILTERBINDINGOBJ_H -# define LIBVIRT_VIRNWFILTERBINDINGOBJ_H +#pragma once -# include "internal.h" -# include "virnwfilterbindingdef.h" -# include "virobject.h" +#include "internal.h" +#include "virnwfilterbindingdef.h" +#include "virobject.h" typedef struct _virNWFilterBindingObj virNWFilterBindingObj; typedef virNWFilterBindingObj *virNWFilterBindingObjPtr; @@ -69,5 +68,3 @@ virNWFilterBindingObjParseFile(const char *filename); char * virNWFilterBindingObjFormat(const virNWFilterBindingObj *obj); - -#endif /* LIBVIRT_VIRNWFILTERBINDINGOBJ_H */ diff --git a/src/conf/virnwfilterbindingobjlist.h b/src/conf/virnwfilterbindingobjlist.h index b0fb90f667..a819b4cc8a 100644 --- a/src/conf/virnwfilterbindingobjlist.h +++ b/src/conf/virnwfilterbindingobjlist.h @@ -18,10 +18,9 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRNWFILTERBINDINGOBJLIST_H -# define LIBVIRT_VIRNWFILTERBINDINGOBJLIST_H +#pragma once -# include "virnwfilterbindingobj.h" +#include "virnwfilterbindingobj.h" typedef struct _virNWFilterBindingObjList virNWFilterBindingObjList; typedef virNWFilterBindingObjList *virNWFilterBindingObjListPtr; @@ -62,6 +61,3 @@ virNWFilterBindingObjListExport(virNWFilterBindingObjListPtr bindings, virConnectPtr conn, virNWFilterBindingPtr **bindinglist, virNWFilterBindingObjListACLFilter filter); - - -#endif /* LIBVIRT_VIRNWFILTERBINDINGOBJLIST_H */ diff --git a/src/conf/virnwfilterobj.h b/src/conf/virnwfilterobj.h index 2369c20313..bdf5c51fe2 100644 --- a/src/conf/virnwfilterobj.h +++ b/src/conf/virnwfilterobj.h @@ -17,13 +17,12 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRNWFILTEROBJ_H -# define LIBVIRT_VIRNWFILTEROBJ_H +#pragma once -# include "internal.h" +#include "internal.h" -# include "nwfilter_conf.h" -# include "virnwfilterbindingobjlist.h" +#include "nwfilter_conf.h" +#include "virnwfilterbindingobjlist.h" typedef struct _virNWFilterObj virNWFilterObj; typedef virNWFilterObj *virNWFilterObjPtr; @@ -114,5 +113,3 @@ virNWFilterObjLock(virNWFilterObjPtr obj); void virNWFilterObjUnlock(virNWFilterObjPtr obj); - -#endif /* LIBVIRT_VIRNWFILTEROBJ_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/conf/node_device_conf.h | 31 ++++++++++++++----------------- src/conf/node_device_event.h | 11 ++++------- src/conf/node_device_util.h | 7 ++----- src/conf/virnodedeviceobj.h | 13 +++++-------- 4 files changed, 25 insertions(+), 37 deletions(-) diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h index 510624968f..bf7939fbb3 100644 --- a/src/conf/node_device_conf.h +++ b/src/conf/node_device_conf.h @@ -20,23 +20,22 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_NODE_DEVICE_CONF_H -# define LIBVIRT_NODE_DEVICE_CONF_H +#pragma once -# include "internal.h" -# include "virbitmap.h" -# include "virutil.h" -# include "virscsihost.h" -# include "virpci.h" -# include "virvhba.h" -# include "device_conf.h" -# include "storage_adapter_conf.h" -# include "virenum.h" +#include "internal.h" +#include "virbitmap.h" +#include "virutil.h" +#include "virscsihost.h" +#include "virpci.h" +#include "virvhba.h" +#include "device_conf.h" +#include "storage_adapter_conf.h" +#include "virenum.h" -# include <libxml/tree.h> +#include <libxml/tree.h> -# define CREATE_DEVICE 1 -# define EXISTING_DEVICE 0 +#define CREATE_DEVICE 1 +#define EXISTING_DEVICE 0 typedef enum { /* Keep in sync with VIR_ENUM_IMPL in node_device_conf.c */ @@ -348,7 +347,7 @@ virNodeDeviceDefFree(virNodeDeviceDefPtr def); void virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps); -# define VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_CAP \ +#define VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_CAP \ (VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM | \ VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV | \ VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV | \ @@ -383,5 +382,3 @@ virNodeDeviceUpdateCaps(virNodeDeviceDefPtr def); int virNodeDeviceCapsListExport(virNodeDeviceDefPtr def, virNodeDevCapType **list); - -#endif /* LIBVIRT_NODE_DEVICE_CONF_H */ diff --git a/src/conf/node_device_event.h b/src/conf/node_device_event.h index b30177a901..8fe55ba6d1 100644 --- a/src/conf/node_device_event.h +++ b/src/conf/node_device_event.h @@ -20,12 +20,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_NODE_DEVICE_EVENT_H -# define LIBVIRT_NODE_DEVICE_EVENT_H +#pragma once -# include "internal.h" -# include "object_event.h" -# include "object_event_private.h" +#include "internal.h" +#include "object_event.h" +#include "object_event_private.h" int virNodeDeviceEventStateRegisterID(virConnectPtr conn, @@ -58,5 +57,3 @@ virNodeDeviceEventLifecycleNew(const char *name, virObjectEventPtr virNodeDeviceEventUpdateNew(const char *name); - -#endif /* LIBVIRT_NODE_DEVICE_EVENT_H */ diff --git a/src/conf/node_device_util.h b/src/conf/node_device_util.h index e040bf62a9..933b7f6e31 100644 --- a/src/conf/node_device_util.h +++ b/src/conf/node_device_util.h @@ -16,10 +16,9 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_NODE_DEVICE_UTIL_H -# define LIBVIRT_NODE_DEVICE_UTIL_H +#pragma once -# include "conf/storage_adapter_conf.h" +#include "conf/storage_adapter_conf.h" char * virNodeDeviceGetParentName(virConnectPtr conn, @@ -31,5 +30,3 @@ virNodeDeviceCreateVport(virStorageAdapterFCHostPtr fchost); int virNodeDeviceDeleteVport(virConnectPtr conn, virStorageAdapterFCHostPtr fchost); - -#endif /* LIBVIRT_NODE_DEVICE_UTIL_H */ diff --git a/src/conf/virnodedeviceobj.h b/src/conf/virnodedeviceobj.h index a560852c27..1abfcb9af4 100644 --- a/src/conf/virnodedeviceobj.h +++ b/src/conf/virnodedeviceobj.h @@ -17,14 +17,13 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRNODEDEVICEOBJ_H -# define LIBVIRT_VIRNODEDEVICEOBJ_H +#pragma once -# include "internal.h" -# include "virthread.h" +#include "internal.h" +#include "virthread.h" -# include "node_device_conf.h" -# include "object_event.h" +#include "node_device_conf.h" +#include "object_event.h" typedef struct _virNodeDeviceObj virNodeDeviceObj; @@ -112,5 +111,3 @@ virNodeDeviceObjListExport(virConnectPtr conn, void virNodeDeviceObjSetSkipUpdateCaps(virNodeDeviceObjPtr obj, bool skipUpdateCaps); - -#endif /* LIBVIRT_VIRNODEDEVICEOBJ_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/conf/storage_adapter_conf.h | 11 ++++----- src/conf/storage_capabilities.h | 8 ++----- src/conf/storage_conf.h | 41 +++++++++++++++------------------ src/conf/storage_event.h | 11 ++++----- src/conf/virstorageobj.h | 11 ++++----- 5 files changed, 33 insertions(+), 49 deletions(-) diff --git a/src/conf/storage_adapter_conf.h b/src/conf/storage_adapter_conf.h index 81d73ea889..4c7da7c8d9 100644 --- a/src/conf/storage_adapter_conf.h +++ b/src/conf/storage_adapter_conf.h @@ -17,12 +17,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_STORAGE_ADAPTER_CONF_H -# define LIBVIRT_STORAGE_ADAPTER_CONF_H +#pragma once -# include "virpci.h" -# include "virxml.h" -# include "virenum.h" +#include "virpci.h" +#include "virxml.h" +#include "virenum.h" typedef enum { @@ -81,5 +80,3 @@ virStorageAdapterValidate(virStorageAdapterPtr adapter); void virStorageAdapterFormat(virBufferPtr buf, virStorageAdapterPtr adapter); - -#endif /* LIBVIRT_STORAGE_ADAPTER_CONF_H */ diff --git a/src/conf/storage_capabilities.h b/src/conf/storage_capabilities.h index daeb496909..948e5bed5b 100644 --- a/src/conf/storage_capabilities.h +++ b/src/conf/storage_capabilities.h @@ -18,10 +18,9 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_STORAGE_CAPABILITIES_H -# define LIBVIRT_STORAGE_CAPABILITIES_H +#pragma once -# include "internal.h" +#include "internal.h" typedef struct _virStoragePoolCaps virStoragePoolCaps; typedef virStoragePoolCaps *virStoragePoolCapsPtr; @@ -36,6 +35,3 @@ virStoragePoolCapsNew(virCapsPtr driverCaps); char * virStoragePoolCapsFormat(virStoragePoolCapsPtr const caps); - - -#endif /* LIBVIRT_STORAGE_CAPABILITIES_H */ diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index 6e4f7c689a..338e70244d 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -19,21 +19,20 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_STORAGE_CONF_H -# define LIBVIRT_STORAGE_CONF_H - -# include "internal.h" -# include "virstorageencryption.h" -# include "virstoragefile.h" -# include "virbitmap.h" -# include "virthread.h" -# include "device_conf.h" -# include "object_event.h" -# include "storage_adapter_conf.h" -# include "virautoclean.h" -# include "virenum.h" - -# include <libxml/tree.h> +#pragma once + +#include "internal.h" +#include "virstorageencryption.h" +#include "virstoragefile.h" +#include "virbitmap.h" +#include "virthread.h" +#include "device_conf.h" +#include "object_event.h" +#include "storage_adapter_conf.h" +#include "virautoclean.h" +#include "virenum.h" + +#include <libxml/tree.h> /* Various callbacks needed to parse/create Storage Pool XML's using * a private namespace */ @@ -460,19 +459,19 @@ typedef enum { } virStoragePartedFsType; VIR_ENUM_DECL(virStoragePartedFs); -# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ACTIVE \ +#define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ACTIVE \ (VIR_CONNECT_LIST_STORAGE_POOLS_ACTIVE | \ VIR_CONNECT_LIST_STORAGE_POOLS_INACTIVE) -# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_PERSISTENT \ +#define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_PERSISTENT \ (VIR_CONNECT_LIST_STORAGE_POOLS_PERSISTENT | \ VIR_CONNECT_LIST_STORAGE_POOLS_TRANSIENT) -# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_AUTOSTART \ +#define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_AUTOSTART \ (VIR_CONNECT_LIST_STORAGE_POOLS_AUTOSTART | \ VIR_CONNECT_LIST_STORAGE_POOLS_NO_AUTOSTART) -# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_POOL_TYPE \ +#define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_POOL_TYPE \ (VIR_CONNECT_LIST_STORAGE_POOLS_DIR | \ VIR_CONNECT_LIST_STORAGE_POOLS_FS | \ VIR_CONNECT_LIST_STORAGE_POOLS_NETFS | \ @@ -487,7 +486,7 @@ VIR_ENUM_DECL(virStoragePartedFs); VIR_CONNECT_LIST_STORAGE_POOLS_ZFS | \ VIR_CONNECT_LIST_STORAGE_POOLS_VSTORAGE) -# define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ALL \ +#define VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ALL \ (VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ACTIVE | \ VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_PERSISTENT | \ VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_AUTOSTART | \ @@ -496,5 +495,3 @@ VIR_ENUM_DECL(virStoragePartedFs); VIR_DEFINE_AUTOPTR_FUNC(virStoragePoolSource, virStoragePoolSourceFree); VIR_DEFINE_AUTOPTR_FUNC(virStoragePoolDef, virStoragePoolDefFree); VIR_DEFINE_AUTOPTR_FUNC(virStorageVolDef, virStorageVolDefFree); - -#endif /* LIBVIRT_STORAGE_CONF_H */ diff --git a/src/conf/storage_event.h b/src/conf/storage_event.h index fd6c10969c..3e67ad5ccf 100644 --- a/src/conf/storage_event.h +++ b/src/conf/storage_event.h @@ -20,12 +20,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_STORAGE_EVENT_H -# define LIBVIRT_STORAGE_EVENT_H +#pragma once -# include "internal.h" -# include "object_event.h" -# include "object_event_private.h" +#include "internal.h" +#include "object_event.h" +#include "object_event_private.h" int virStoragePoolEventStateRegisterID(virConnectPtr conn, @@ -60,5 +59,3 @@ virStoragePoolEventLifecycleNew(const char *name, virObjectEventPtr virStoragePoolEventRefreshNew(const char *name, const unsigned char *uuid); - -#endif /* LIBVIRT_STORAGE_EVENT_H */ diff --git a/src/conf/virstorageobj.h b/src/conf/virstorageobj.h index c41d4c16ad..92d229f9b4 100644 --- a/src/conf/virstorageobj.h +++ b/src/conf/virstorageobj.h @@ -17,14 +17,13 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRSTORAGEOBJ_H -# define LIBVIRT_VIRSTORAGEOBJ_H +#pragma once -# include "internal.h" +#include "internal.h" -# include "storage_conf.h" +#include "storage_conf.h" -# include "capabilities.h" +#include "capabilities.h" typedef struct _virStoragePoolObj virStoragePoolObj; typedef virStoragePoolObj *virStoragePoolObjPtr; @@ -256,5 +255,3 @@ virStoragePoolObjListExport(virConnectPtr conn, virStoragePoolPtr **pools, virStoragePoolObjListFilter filter, unsigned int flags); - -#endif /* LIBVIRT_VIRSTORAGEOBJ_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/conf/capabilities.h | 23 +++++++++----------- src/conf/cpu_conf.h | 23 +++++++++----------- src/conf/device_conf.h | 33 +++++++++++++---------------- src/conf/interface_conf.h | 23 +++++++++----------- src/conf/moment_conf.h | 11 ++++------ src/conf/numa_conf.h | 18 ++++++---------- src/conf/object_event.h | 11 ++++------ src/conf/object_event_private.h | 7 ++---- src/conf/secret_conf.h | 15 ++++++------- src/conf/secret_event.h | 11 ++++------ src/conf/snapshot_conf.h | 13 +++++------- src/conf/virchrdev.h | 9 +++----- src/conf/virconftypes.h | 5 +---- src/conf/virdomainmomentobjlist.h | 17 ++++++--------- src/conf/virdomainobjlist.h | 21 ++++++++---------- src/conf/virdomainsnapshotobjlist.h | 21 ++++++++---------- src/conf/virinterfaceobj.h | 7 ++---- src/conf/virsavecookie.h | 13 +++++------- src/conf/virsecretobj.h | 11 ++++------ 19 files changed, 117 insertions(+), 175 deletions(-) diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h index a6331b081c..28b398891a 100644 --- a/src/conf/capabilities.h +++ b/src/conf/capabilities.h @@ -19,19 +19,18 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_CAPABILITIES_H -# define LIBVIRT_CAPABILITIES_H +#pragma once -# include "internal.h" -# include "virconftypes.h" -# include "virbuffer.h" -# include "cpu_conf.h" -# include "virarch.h" -# include "virmacaddr.h" -# include "virobject.h" -# include "virresctrl.h" +#include "internal.h" +#include "virconftypes.h" +#include "virbuffer.h" +#include "cpu_conf.h" +#include "virarch.h" +#include "virmacaddr.h" +#include "virobject.h" +#include "virresctrl.h" -# include <libxml/xpath.h> +#include <libxml/xpath.h> struct _virCapsGuestFeature { char *name; @@ -328,5 +327,3 @@ void virCapsHostCacheBankFree(virCapsHostCacheBankPtr ptr); int virCapabilitiesInitCaches(virCapsPtr caps); void virCapabilitiesHostInitIOMMU(virCapsPtr caps); - -#endif /* LIBVIRT_CAPABILITIES_H */ diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h index 51bf744fab..562e0de531 100644 --- a/src/conf/cpu_conf.h +++ b/src/conf/cpu_conf.h @@ -18,19 +18,18 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_CPU_CONF_H -# define LIBVIRT_CPU_CONF_H +#pragma once -# include "virutil.h" -# include "virbuffer.h" -# include "virxml.h" -# include "virbitmap.h" -# include "virarch.h" -# include "numa_conf.h" -# include "virenum.h" -# include "virhostcpu.h" +#include "virutil.h" +#include "virbuffer.h" +#include "virxml.h" +#include "virbitmap.h" +#include "virarch.h" +#include "numa_conf.h" +#include "virenum.h" +#include "virhostcpu.h" -# define VIR_CPU_VENDOR_ID_LENGTH 12 +#define VIR_CPU_VENDOR_ID_LENGTH 12 typedef enum { VIR_CPU_TYPE_HOST, @@ -226,5 +225,3 @@ virCPUDefListParse(const char **xmlCPUs, virCPUType cpuType); void virCPUDefListFree(virCPUDefPtr *cpus); - -#endif /* LIBVIRT_CPU_CONF_H */ diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index b3299ac69d..06f7f365ad 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -18,20 +18,19 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_DEVICE_CONF_H -# define LIBVIRT_DEVICE_CONF_H +#pragma once -# include <libxml/parser.h> -# include <libxml/tree.h> -# include <libxml/xpath.h> +#include <libxml/parser.h> +#include <libxml/tree.h> +#include <libxml/xpath.h> -# include "internal.h" -# include "virutil.h" -# include "virthread.h" -# include "virbuffer.h" -# include "virpci.h" -# include "virnetdev.h" -# include "virenum.h" +#include "internal.h" +#include "virutil.h" +#include "virthread.h" +#include "virbuffer.h" +#include "virpci.h" +#include "virnetdev.h" +#include "virenum.h" typedef enum { VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE, @@ -69,9 +68,9 @@ struct _virDomainDeviceVirtioSerialAddress { unsigned int port; }; -# define VIR_DOMAIN_DEVICE_CCW_MAX_CSSID 254 -# define VIR_DOMAIN_DEVICE_CCW_MAX_SSID 3 -# define VIR_DOMAIN_DEVICE_CCW_MAX_DEVNO 65535 +#define VIR_DOMAIN_DEVICE_CCW_MAX_CSSID 254 +#define VIR_DOMAIN_DEVICE_CCW_MAX_SSID 3 +#define VIR_DOMAIN_DEVICE_CCW_MAX_DEVNO 65535 typedef struct _virDomainDeviceCCWAddress virDomainDeviceCCWAddress; typedef virDomainDeviceCCWAddress *virDomainDeviceCCWAddressPtr; @@ -89,7 +88,7 @@ struct _virDomainDeviceCcidAddress { unsigned int slot; }; -# define VIR_DOMAIN_DEVICE_USB_MAX_PORT_DEPTH 4 +#define VIR_DOMAIN_DEVICE_USB_MAX_PORT_DEPTH 4 typedef struct _virDomainDeviceUSBAddress virDomainDeviceUSBAddress; typedef virDomainDeviceUSBAddress *virDomainDeviceUSBAddressPtr; @@ -231,5 +230,3 @@ int virInterfaceLinkParseXML(xmlNodePtr node, int virInterfaceLinkFormat(virBufferPtr buf, const virNetDevIfLink *lnk); - -#endif /* LIBVIRT_DEVICE_CONF_H */ diff --git a/src/conf/interface_conf.h b/src/conf/interface_conf.h index e56b158b6d..ce405e5b15 100644 --- a/src/conf/interface_conf.h +++ b/src/conf/interface_conf.h @@ -18,18 +18,17 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_INTERFACE_CONF_H -# define LIBVIRT_INTERFACE_CONF_H +#pragma once -# include <libxml/parser.h> -# include <libxml/tree.h> -# include <libxml/xpath.h> +#include <libxml/parser.h> +#include <libxml/tree.h> +#include <libxml/xpath.h> -# include "internal.h" -# include "virutil.h" -# include "virthread.h" -# include "device_conf.h" -# include "virenum.h" +#include "internal.h" +#include "virutil.h" +#include "virthread.h" +#include "device_conf.h" +#include "virenum.h" /* There is currently 3 types of interfaces */ @@ -175,8 +174,6 @@ virInterfaceDefParseNode(xmlDocPtr xml, char * virInterfaceDefFormat(const virInterfaceDef *def); -# define VIR_CONNECT_LIST_INTERFACES_FILTERS_ACTIVE \ +#define VIR_CONNECT_LIST_INTERFACES_FILTERS_ACTIVE \ (VIR_CONNECT_LIST_INTERFACES_ACTIVE | \ VIR_CONNECT_LIST_INTERFACES_INACTIVE) - -#endif /* LIBVIRT_INTERFACE_CONF_H */ diff --git a/src/conf/moment_conf.h b/src/conf/moment_conf.h index 00ec1c1904..9fdbef2172 100644 --- a/src/conf/moment_conf.h +++ b/src/conf/moment_conf.h @@ -20,12 +20,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_MOMENT_CONF_H -# define LIBVIRT_MOMENT_CONF_H +#pragma once -# include "internal.h" -# include "virconftypes.h" -# include "virobject.h" +#include "internal.h" +#include "virconftypes.h" +#include "virobject.h" /* Base class for a domain moment */ struct _virDomainMomentDef { @@ -43,5 +42,3 @@ struct _virDomainMomentDef { virClassPtr virClassForDomainMomentDef(void); int virDomainMomentDefPostParse(virDomainMomentDefPtr def); - -#endif /* LIBVIRT_MOMENT_CONF_H */ diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h index ae1793a950..e76a09c20c 100644 --- a/src/conf/numa_conf.h +++ b/src/conf/numa_conf.h @@ -18,16 +18,15 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_NUMA_CONF_H -# define LIBVIRT_NUMA_CONF_H +#pragma once -# include <libxml/xpath.h> +#include <libxml/xpath.h> -# include "internal.h" -# include "virutil.h" -# include "virbitmap.h" -# include "virbuffer.h" -# include "virenum.h" +#include "internal.h" +#include "virutil.h" +#include "virbitmap.h" +#include "virbuffer.h" +#include "virenum.h" typedef struct _virDomainNuma virDomainNuma; @@ -185,6 +184,3 @@ int virDomainNumaDefCPUParseXML(virDomainNumaPtr def, xmlXPathContextPtr ctxt); int virDomainNumaDefCPUFormatXML(virBufferPtr buf, virDomainNumaPtr def); unsigned int virDomainNumaGetCPUCountTotal(virDomainNumaPtr numa); - - -#endif /* LIBVIRT_NUMA_CONF_H */ diff --git a/src/conf/object_event.h b/src/conf/object_event.h index bbeaa3aae7..63b0818613 100644 --- a/src/conf/object_event.h +++ b/src/conf/object_event.h @@ -20,12 +20,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_OBJECT_EVENT_H -# define LIBVIRT_OBJECT_EVENT_H +#pragma once -# include "internal.h" +#include "internal.h" -# include "virobject.h" +#include "virobject.h" /** * Dispatching domain events that come in while @@ -54,7 +53,7 @@ typedef void (*virConnectObjectEventGenericCallback)(virConnectPtr conn, void *obj, void *opaque); -# define VIR_OBJECT_EVENT_CALLBACK(cb) \ +#define VIR_OBJECT_EVENT_CALLBACK(cb) \ ((virConnectObjectEventGenericCallback)(cb)) void @@ -88,5 +87,3 @@ virObjectEventStateSetRemote(virConnectPtr conn, int callbackID, int remoteID) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); - -#endif /* LIBVIRT_OBJECT_EVENT_H */ diff --git a/src/conf/object_event_private.h b/src/conf/object_event_private.h index 5000b99504..b31441c53a 100644 --- a/src/conf/object_event_private.h +++ b/src/conf/object_event_private.h @@ -20,10 +20,9 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_OBJECT_EVENT_PRIVATE_H -# define LIBVIRT_OBJECT_EVENT_PRIVATE_H +#pragma once -# include "datatypes.h" +#include "datatypes.h" struct _virObjectMeta { int id; @@ -105,5 +104,3 @@ virObjectEventNew(virClassPtr klass, const char *key) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(7); - -#endif /* LIBVIRT_OBJECT_EVENT_PRIVATE_H */ diff --git a/src/conf/secret_conf.h b/src/conf/secret_conf.h index 1a48f12dd9..de1c28e187 100644 --- a/src/conf/secret_conf.h +++ b/src/conf/secret_conf.h @@ -18,11 +18,10 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_SECRET_CONF_H -# define LIBVIRT_SECRET_CONF_H +#pragma once -# include "internal.h" -# include "virutil.h" +#include "internal.h" +#include "virutil.h" typedef struct _virSecretDef virSecretDef; typedef virSecretDef *virSecretDefPtr; @@ -40,16 +39,14 @@ virSecretDefPtr virSecretDefParseString(const char *xml); virSecretDefPtr virSecretDefParseFile(const char *filename); char *virSecretDefFormat(const virSecretDef *def); -# define VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL \ +#define VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL \ (VIR_CONNECT_LIST_SECRETS_EPHEMERAL | \ VIR_CONNECT_LIST_SECRETS_NO_EPHEMERAL) -# define VIR_CONNECT_LIST_SECRETS_FILTERS_PRIVATE \ +#define VIR_CONNECT_LIST_SECRETS_FILTERS_PRIVATE \ (VIR_CONNECT_LIST_SECRETS_PRIVATE | \ VIR_CONNECT_LIST_SECRETS_NO_PRIVATE) -# define VIR_CONNECT_LIST_SECRETS_FILTERS_ALL \ +#define VIR_CONNECT_LIST_SECRETS_FILTERS_ALL \ (VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL | \ VIR_CONNECT_LIST_SECRETS_FILTERS_PRIVATE) - -#endif /* LIBVIRT_SECRET_CONF_H */ diff --git a/src/conf/secret_event.h b/src/conf/secret_event.h index 83a432d5a6..3fe80521b9 100644 --- a/src/conf/secret_event.h +++ b/src/conf/secret_event.h @@ -20,12 +20,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_SECRET_EVENT_H -# define LIBVIRT_SECRET_EVENT_H +#pragma once -# include "internal.h" -# include "object_event.h" -# include "object_event_private.h" +#include "internal.h" +#include "object_event.h" +#include "object_event_private.h" int virSecretEventStateRegisterID(virConnectPtr conn, @@ -61,5 +60,3 @@ virObjectEventPtr virSecretEventValueChangedNew(const unsigned char *uuid, int usage_type, const char *usage_id); - -#endif /* LIBVIRT_SECRET_EVENT_H */ diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h index 55b7487cfb..08b2a3b955 100644 --- a/src/conf/snapshot_conf.h +++ b/src/conf/snapshot_conf.h @@ -19,13 +19,12 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_SNAPSHOT_CONF_H -# define LIBVIRT_SNAPSHOT_CONF_H +#pragma once -# include "internal.h" -# include "domain_conf.h" -# include "moment_conf.h" -# include "virenum.h" +#include "internal.h" +#include "domain_conf.h" +#include "moment_conf.h" +#include "virenum.h" /* Items related to snapshot state */ @@ -143,5 +142,3 @@ int virDomainSnapshotRedefineValidate(virDomainSnapshotDefPtr def, VIR_ENUM_DECL(virDomainSnapshotLocation); VIR_ENUM_DECL(virDomainSnapshotState); - -#endif /* LIBVIRT_SNAPSHOT_CONF_H */ diff --git a/src/conf/virchrdev.h b/src/conf/virchrdev.h index 42306ff933..e218ea7203 100644 --- a/src/conf/virchrdev.h +++ b/src/conf/virchrdev.h @@ -19,11 +19,10 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRCHRDEV_H -# define LIBVIRT_VIRCHRDEV_H +#pragma once -# include "internal.h" -# include "domain_conf.h" +#include "internal.h" +#include "domain_conf.h" typedef struct _virChrdevs virChrdevs; typedef virChrdevs *virChrdevsPtr; @@ -33,5 +32,3 @@ void virChrdevFree(virChrdevsPtr devs); int virChrdevOpen(virChrdevsPtr devs, virDomainChrSourceDefPtr source, virStreamPtr st, bool force); - -#endif /* LIBVIRT_VIRCHRDEV_H */ diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h index 6a8267c422..b8f553f7fb 100644 --- a/src/conf/virconftypes.h +++ b/src/conf/virconftypes.h @@ -20,8 +20,7 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRCONFTYPES_H -# define LIBVIRT_VIRCONFTYPES_H +#pragma once /* forward declarations of various types required in src/conf */ @@ -345,5 +344,3 @@ typedef virDomainXMLPrivateDataCallbacks *virDomainXMLPrivateDataCallbacksPtr; typedef struct _virDomainXenbusControllerOpts virDomainXenbusControllerOpts; typedef virDomainXenbusControllerOpts *virDomainXenbusControllerOptsPtr; - -#endif /* LIBVIRT_VIRCONFTYPES_H */ diff --git a/src/conf/virdomainmomentobjlist.h b/src/conf/virdomainmomentobjlist.h index 6481c771de..68f00a114f 100644 --- a/src/conf/virdomainmomentobjlist.h +++ b/src/conf/virdomainmomentobjlist.h @@ -20,12 +20,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRDOMAINMOMENTOBJLIST_H -# define LIBVIRT_VIRDOMAINMOMENTOBJLIST_H +#pragma once -# include "internal.h" -# include "virconftypes.h" -# include "virhash.h" +#include "internal.h" +#include "virconftypes.h" +#include "virhash.h" /* Filter that returns true if a given moment matches the filter flags */ typedef bool (*virDomainMomentObjListFilter)(virDomainMomentObjPtr obj, @@ -83,15 +82,15 @@ typedef enum { VIR_DOMAIN_MOMENT_LIST_NO_METADATA = (1 << 5), } virDomainMomentFilters; -# define VIR_DOMAIN_MOMENT_FILTERS_METADATA \ +#define VIR_DOMAIN_MOMENT_FILTERS_METADATA \ (VIR_DOMAIN_MOMENT_LIST_METADATA | \ VIR_DOMAIN_MOMENT_LIST_NO_METADATA) -# define VIR_DOMAIN_MOMENT_FILTERS_LEAVES \ +#define VIR_DOMAIN_MOMENT_FILTERS_LEAVES \ (VIR_DOMAIN_MOMENT_LIST_LEAVES | \ VIR_DOMAIN_MOMENT_LIST_NO_LEAVES) -# define VIR_DOMAIN_MOMENT_FILTERS_ALL \ +#define VIR_DOMAIN_MOMENT_FILTERS_ALL \ (VIR_DOMAIN_MOMENT_LIST_ROOTS | \ VIR_DOMAIN_MOMENT_LIST_TOPOLOGICAL | \ VIR_DOMAIN_MOMENT_FILTERS_METADATA | \ @@ -118,5 +117,3 @@ int virDomainMomentForEach(virDomainMomentObjListPtr moments, virHashIterator iter, void *data); int virDomainMomentUpdateRelations(virDomainMomentObjListPtr moments); - -#endif /* LIBVIRT_VIRDOMAINMOMENTOBJLIST_H */ diff --git a/src/conf/virdomainobjlist.h b/src/conf/virdomainobjlist.h index c1ffee76ad..bf3ab396fa 100644 --- a/src/conf/virdomainobjlist.h +++ b/src/conf/virdomainobjlist.h @@ -20,10 +20,9 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRDOMAINOBJLIST_H -# define LIBVIRT_VIRDOMAINOBJLIST_H +#pragma once -# include "domain_conf.h" +#include "domain_conf.h" typedef struct _virDomainObjList virDomainObjList; typedef virDomainObjList *virDomainObjListPtr; @@ -95,33 +94,33 @@ int virDomainObjListForEach(virDomainObjListPtr doms, virDomainObjListIterator callback, void *opaque); -# define VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE \ +#define VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE \ (VIR_CONNECT_LIST_DOMAINS_ACTIVE | \ VIR_CONNECT_LIST_DOMAINS_INACTIVE) -# define VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT \ +#define VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT \ (VIR_CONNECT_LIST_DOMAINS_PERSISTENT | \ VIR_CONNECT_LIST_DOMAINS_TRANSIENT) -# define VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE \ +#define VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE \ (VIR_CONNECT_LIST_DOMAINS_RUNNING | \ VIR_CONNECT_LIST_DOMAINS_PAUSED | \ VIR_CONNECT_LIST_DOMAINS_SHUTOFF | \ VIR_CONNECT_LIST_DOMAINS_OTHER) -# define VIR_CONNECT_LIST_DOMAINS_FILTERS_MANAGEDSAVE \ +#define VIR_CONNECT_LIST_DOMAINS_FILTERS_MANAGEDSAVE \ (VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE | \ VIR_CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE) -# define VIR_CONNECT_LIST_DOMAINS_FILTERS_AUTOSTART \ +#define VIR_CONNECT_LIST_DOMAINS_FILTERS_AUTOSTART \ (VIR_CONNECT_LIST_DOMAINS_AUTOSTART | \ VIR_CONNECT_LIST_DOMAINS_NO_AUTOSTART) -# define VIR_CONNECT_LIST_DOMAINS_FILTERS_SNAPSHOT \ +#define VIR_CONNECT_LIST_DOMAINS_FILTERS_SNAPSHOT \ (VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT | \ VIR_CONNECT_LIST_DOMAINS_NO_SNAPSHOT) -# define VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL \ +#define VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL \ (VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE | \ VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT | \ VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE | \ @@ -149,5 +148,3 @@ int virDomainObjListConvert(virDomainObjListPtr domlist, virDomainObjListACLFilter filter, unsigned int flags, bool skip_missing); - -#endif /* LIBVIRT_VIRDOMAINOBJLIST_H */ diff --git a/src/conf/virdomainsnapshotobjlist.h b/src/conf/virdomainsnapshotobjlist.h index b83f7a4ba9..26fa456730 100644 --- a/src/conf/virdomainsnapshotobjlist.h +++ b/src/conf/virdomainsnapshotobjlist.h @@ -20,12 +20,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRDOMAINSNAPSHOTOBJLIST_H -# define LIBVIRT_VIRDOMAINSNAPSHOTOBJLIST_H +#pragma once -# include "internal.h" -# include "virdomainmomentobjlist.h" -# include "virbuffer.h" +#include "internal.h" +#include "virdomainmomentobjlist.h" +#include "virbuffer.h" virDomainSnapshotObjListPtr virDomainSnapshotObjListNew(void); void virDomainSnapshotObjListFree(virDomainSnapshotObjListPtr snapshots); @@ -54,24 +53,24 @@ int virDomainSnapshotForEach(virDomainSnapshotObjListPtr snapshots, void *data); int virDomainSnapshotUpdateRelations(virDomainSnapshotObjListPtr snapshots); -# define VIR_DOMAIN_SNAPSHOT_FILTERS_METADATA \ +#define VIR_DOMAIN_SNAPSHOT_FILTERS_METADATA \ (VIR_DOMAIN_SNAPSHOT_LIST_METADATA | \ VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA) -# define VIR_DOMAIN_SNAPSHOT_FILTERS_LEAVES \ +#define VIR_DOMAIN_SNAPSHOT_FILTERS_LEAVES \ (VIR_DOMAIN_SNAPSHOT_LIST_LEAVES | \ VIR_DOMAIN_SNAPSHOT_LIST_NO_LEAVES) -# define VIR_DOMAIN_SNAPSHOT_FILTERS_STATUS \ +#define VIR_DOMAIN_SNAPSHOT_FILTERS_STATUS \ (VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE | \ VIR_DOMAIN_SNAPSHOT_LIST_ACTIVE | \ VIR_DOMAIN_SNAPSHOT_LIST_DISK_ONLY) -# define VIR_DOMAIN_SNAPSHOT_FILTERS_LOCATION \ +#define VIR_DOMAIN_SNAPSHOT_FILTERS_LOCATION \ (VIR_DOMAIN_SNAPSHOT_LIST_INTERNAL | \ VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL) -# define VIR_DOMAIN_SNAPSHOT_FILTERS_ALL \ +#define VIR_DOMAIN_SNAPSHOT_FILTERS_ALL \ (VIR_DOMAIN_SNAPSHOT_FILTERS_METADATA | \ VIR_DOMAIN_SNAPSHOT_FILTERS_LEAVES | \ VIR_DOMAIN_SNAPSHOT_FILTERS_STATUS | \ @@ -89,5 +88,3 @@ virDomainSnapshotObjGetDef(virDomainMomentObjPtr obj) { return (virDomainSnapshotDefPtr) obj->def; } - -#endif /* LIBVIRT_VIRDOMAINSNAPSHOTOBJLIST_H */ diff --git a/src/conf/virinterfaceobj.h b/src/conf/virinterfaceobj.h index 6ad331af4f..6142fb9f53 100644 --- a/src/conf/virinterfaceobj.h +++ b/src/conf/virinterfaceobj.h @@ -17,10 +17,9 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRINTERFACEOBJ_H -# define LIBVIRT_VIRINTERFACEOBJ_H +#pragma once -# include "internal.h" +#include "internal.h" typedef struct _virInterfaceObj virInterfaceObj; typedef virInterfaceObj *virInterfaceObjPtr; @@ -88,5 +87,3 @@ virInterfaceObjListExport(virConnectPtr conn, virInterfacePtr **ifaces, virInterfaceObjListFilter filter, unsigned int flags); - -#endif /* LIBVIRT_VIRINTERFACEOBJ_H */ diff --git a/src/conf/virsavecookie.h b/src/conf/virsavecookie.h index a5e41e7acb..eafffbed66 100644 --- a/src/conf/virsavecookie.h +++ b/src/conf/virsavecookie.h @@ -18,14 +18,13 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRSAVECOOKIE_H -# define LIBVIRT_VIRSAVECOOKIE_H +#pragma once -# include <libxml/xpath.h> +#include <libxml/xpath.h> -# include "internal.h" -# include "virobject.h" -# include "virbuffer.h" +#include "internal.h" +#include "virobject.h" +#include "virbuffer.h" typedef int (*virSaveCookieParseFunc)(xmlXPathContextPtr ctxt, @@ -59,5 +58,3 @@ virSaveCookieFormatBuf(virBufferPtr buf, char * virSaveCookieFormat(virObjectPtr obj, virSaveCookieCallbacksPtr saveCookie); - -#endif /* LIBVIRT_VIRSAVECOOKIE_H */ diff --git a/src/conf/virsecretobj.h b/src/conf/virsecretobj.h index 1563fa8ca7..09ee19f603 100644 --- a/src/conf/virsecretobj.h +++ b/src/conf/virsecretobj.h @@ -18,13 +18,12 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_VIRSECRETOBJ_H -# define LIBVIRT_VIRSECRETOBJ_H +#pragma once -# include "internal.h" +#include "internal.h" -# include "secret_conf.h" -# include "virobject.h" +#include "secret_conf.h" +#include "virobject.h" typedef struct _virSecretObj virSecretObj; typedef virSecretObj *virSecretObjPtr; @@ -117,5 +116,3 @@ virSecretObjSetValueSize(virSecretObjPtr obj, int virSecretLoadAllConfigs(virSecretObjListPtr secrets, const char *configDir); - -#endif /* LIBVIRT_VIRSECRETOBJ_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/cpu/cpu.h | 19 ++++++------- src/cpu/cpu_arm.h | 7 ++--- src/cpu/cpu_map.h | 7 ++--- src/cpu/cpu_ppc64.h | 7 ++--- src/cpu/cpu_ppc64_data.h | 8 ++---- src/cpu/cpu_s390.h | 7 ++--- src/cpu/cpu_x86.h | 9 +++---- src/cpu/cpu_x86_data.h | 58 +++++++++++++++++++--------------------- 8 files changed, 48 insertions(+), 74 deletions(-) diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 3446627e18..7cc9e7d9db 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -18,16 +18,15 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_CPU_H -# define LIBVIRT_CPU_H +#pragma once -# include "virerror.h" -# include "datatypes.h" -# include "virarch.h" -# include "domain_capabilities.h" -# include "cpu_conf.h" -# include "cpu_x86_data.h" -# include "cpu_ppc64_data.h" +#include "virerror.h" +#include "datatypes.h" +#include "virarch.h" +#include "domain_capabilities.h" +#include "cpu_conf.h" +#include "cpu_x86_data.h" +#include "cpu_ppc64_data.h" typedef struct _virCPUData virCPUData; @@ -264,5 +263,3 @@ char *virCPUDataFormat(const virCPUData *data) ATTRIBUTE_NONNULL(1); virCPUDataPtr virCPUDataParse(const char *xmlStr) ATTRIBUTE_NONNULL(1); - -#endif /* LIBVIRT_CPU_H */ diff --git a/src/cpu/cpu_arm.h b/src/cpu/cpu_arm.h index c1a8939a61..a182a832c7 100644 --- a/src/cpu/cpu_arm.h +++ b/src/cpu/cpu_arm.h @@ -18,11 +18,8 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_CPU_ARM_H -# define LIBVIRT_CPU_ARM_H +#pragma once -# include "cpu.h" +#include "cpu.h" extern struct cpuArchDriver cpuDriverArm; - -#endif /* LIBVIRT_CPU_ARM_H */ diff --git a/src/cpu/cpu_map.h b/src/cpu/cpu_map.h index a7a7509b7e..2d95cdb8e8 100644 --- a/src/cpu/cpu_map.h +++ b/src/cpu/cpu_map.h @@ -18,10 +18,9 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_CPU_MAP_H -# define LIBVIRT_CPU_MAP_H +#pragma once -# include "virxml.h" +#include "virxml.h" typedef int (*cpuMapLoadCallback) (xmlXPathContextPtr ctxt, @@ -34,5 +33,3 @@ cpuMapLoad(const char *arch, cpuMapLoadCallback featureCB, cpuMapLoadCallback modelCB, void *data); - -#endif /* LIBVIRT_CPU_MAP_H */ diff --git a/src/cpu/cpu_ppc64.h b/src/cpu/cpu_ppc64.h index 18b8376bb7..fade97ba93 100644 --- a/src/cpu/cpu_ppc64.h +++ b/src/cpu/cpu_ppc64.h @@ -18,11 +18,8 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_CPU_PPC64_H -# define LIBVIRT_CPU_PPC64_H +#pragma once -# include "cpu.h" +#include "cpu.h" extern struct cpuArchDriver cpuDriverPPC64; - -#endif /* LIBVIRT_CPU_PPC64_H */ diff --git a/src/cpu/cpu_ppc64_data.h b/src/cpu/cpu_ppc64_data.h index 2018cbbb6f..59aa13562f 100644 --- a/src/cpu/cpu_ppc64_data.h +++ b/src/cpu/cpu_ppc64_data.h @@ -18,9 +18,7 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_CPU_PPC64_DATA_H -# define LIBVIRT_CPU_PPC64_DATA_H - +#pragma once typedef struct _virCPUppc64PVR virCPUppc64PVR; struct _virCPUppc64PVR { @@ -28,12 +26,10 @@ struct _virCPUppc64PVR { uint32_t mask; }; -# define VIR_CPU_PPC64_DATA_INIT { 0 } +#define VIR_CPU_PPC64_DATA_INIT { 0 } typedef struct _virCPUppc64Data virCPUppc64Data; struct _virCPUppc64Data { size_t len; virCPUppc64PVR *pvr; }; - -#endif /* LIBVIRT_CPU_PPC64_DATA_H */ diff --git a/src/cpu/cpu_s390.h b/src/cpu/cpu_s390.h index 4c45e1b32c..2a3bafa5b8 100644 --- a/src/cpu/cpu_s390.h +++ b/src/cpu/cpu_s390.h @@ -18,11 +18,8 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_CPU_S390_H -# define LIBVIRT_CPU_S390_H +#pragma once -# include "cpu.h" +#include "cpu.h" extern struct cpuArchDriver cpuDriverS390; - -#endif /* LIBVIRT_CPU_S390_H */ diff --git a/src/cpu/cpu_x86.h b/src/cpu/cpu_x86.h index cd44cbe4f3..29037d4afa 100644 --- a/src/cpu/cpu_x86.h +++ b/src/cpu/cpu_x86.h @@ -18,11 +18,10 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_CPU_X86_H -# define LIBVIRT_CPU_X86_H +#pragma once -# include "cpu.h" -# include "cpu_x86_data.h" +#include "cpu.h" +#include "cpu_x86_data.h" extern struct cpuArchDriver cpuDriverX86; @@ -44,5 +43,3 @@ int virCPUx86DataSetVendor(virCPUDataPtr cpuData, int virCPUx86DataAddFeature(virCPUDataPtr cpuData, const char *name); - -#endif /* LIBVIRT_CPU_X86_H */ diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index 4600870c4c..f3f4d7ab9c 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -18,9 +18,7 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_CPU_X86_DATA_H -# define LIBVIRT_CPU_X86_DATA_H - +#pragma once typedef struct _virCPUx86CPUID virCPUx86CPUID; typedef virCPUx86CPUID *virCPUx86CPUIDPtr; @@ -41,41 +39,41 @@ struct _virCPUx86MSR { uint32_t edx; }; -# define CPUX86_BASIC 0x0 -# define CPUX86_KVM 0x40000000 -# define CPUX86_EXTENDED 0x80000000 +#define CPUX86_BASIC 0x0 +#define CPUX86_KVM 0x40000000 +#define CPUX86_EXTENDED 0x80000000 -# define VIR_CPU_x86_KVM_CLOCKSOURCE "__kvm_clocksource" -# define VIR_CPU_x86_KVM_NOP_IO_DELAY "__kvm_no_io_delay" -# define VIR_CPU_x86_KVM_MMU_OP "__kvm_mmu_op" -# define VIR_CPU_x86_KVM_CLOCKSOURCE2 "__kvm_clocksource2" -# define VIR_CPU_x86_KVM_ASYNC_PF "__kvm_async_pf" -# define VIR_CPU_x86_KVM_STEAL_TIME "__kvm_steal_time" -# define VIR_CPU_x86_KVM_PV_EOI "__kvm_pv_eoi" -# define VIR_CPU_x86_KVM_PV_UNHALT "__kvm_pv_unhalt" -# define VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT "__kvm_clocksource_stable" +#define VIR_CPU_x86_KVM_CLOCKSOURCE "__kvm_clocksource" +#define VIR_CPU_x86_KVM_NOP_IO_DELAY "__kvm_no_io_delay" +#define VIR_CPU_x86_KVM_MMU_OP "__kvm_mmu_op" +#define VIR_CPU_x86_KVM_CLOCKSOURCE2 "__kvm_clocksource2" +#define VIR_CPU_x86_KVM_ASYNC_PF "__kvm_async_pf" +#define VIR_CPU_x86_KVM_STEAL_TIME "__kvm_steal_time" +#define VIR_CPU_x86_KVM_PV_EOI "__kvm_pv_eoi" +#define VIR_CPU_x86_KVM_PV_UNHALT "__kvm_pv_unhalt" +#define VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT "__kvm_clocksource_stable" /* * The following HyperV feature names suffixes must exactly match corresponding * ones defined for virDomainHyperv in domain_conf.c. * E.g "__kvm_runtime" -> "runtime", "__kvm_hv_spinlocks" -> "spinlocks" etc. */ -# define VIR_CPU_x86_KVM_HV_RUNTIME "__kvm_hv_runtime" -# define VIR_CPU_x86_KVM_HV_SYNIC "__kvm_hv_synic" -# define VIR_CPU_x86_KVM_HV_STIMER "__kvm_hv_stimer" -# define VIR_CPU_x86_KVM_HV_RELAXED "__kvm_hv_relaxed" -# define VIR_CPU_x86_KVM_HV_SPINLOCKS "__kvm_hv_spinlocks" -# define VIR_CPU_x86_KVM_HV_VAPIC "__kvm_hv_vapic" -# define VIR_CPU_x86_KVM_HV_VPINDEX "__kvm_hv_vpindex" -# define VIR_CPU_x86_KVM_HV_RESET "__kvm_hv_reset" -# define VIR_CPU_x86_KVM_HV_FREQUENCIES "__kvm_hv_frequencies" -# define VIR_CPU_x86_KVM_HV_REENLIGHTENMENT "__kvm_hv_reenlightenment" -# define VIR_CPU_x86_KVM_HV_TLBFLUSH "__kvm_hv_tlbflush" -# define VIR_CPU_x86_KVM_HV_IPI "__kvm_hv_ipi" -# define VIR_CPU_x86_KVM_HV_EVMCS "__kvm_hv_evmcs" +#define VIR_CPU_x86_KVM_HV_RUNTIME "__kvm_hv_runtime" +#define VIR_CPU_x86_KVM_HV_SYNIC "__kvm_hv_synic" +#define VIR_CPU_x86_KVM_HV_STIMER "__kvm_hv_stimer" +#define VIR_CPU_x86_KVM_HV_RELAXED "__kvm_hv_relaxed" +#define VIR_CPU_x86_KVM_HV_SPINLOCKS "__kvm_hv_spinlocks" +#define VIR_CPU_x86_KVM_HV_VAPIC "__kvm_hv_vapic" +#define VIR_CPU_x86_KVM_HV_VPINDEX "__kvm_hv_vpindex" +#define VIR_CPU_x86_KVM_HV_RESET "__kvm_hv_reset" +#define VIR_CPU_x86_KVM_HV_FREQUENCIES "__kvm_hv_frequencies" +#define VIR_CPU_x86_KVM_HV_REENLIGHTENMENT "__kvm_hv_reenlightenment" +#define VIR_CPU_x86_KVM_HV_TLBFLUSH "__kvm_hv_tlbflush" +#define VIR_CPU_x86_KVM_HV_IPI "__kvm_hv_ipi" +#define VIR_CPU_x86_KVM_HV_EVMCS "__kvm_hv_evmcs" -# define VIR_CPU_X86_DATA_INIT { 0 } +#define VIR_CPU_X86_DATA_INIT { 0 } typedef enum { VIR_CPU_X86_DATA_NONE = 0, @@ -98,5 +96,3 @@ struct _virCPUx86Data { size_t len; virCPUx86DataItem *items; }; - -#endif /* LIBVIRT_CPU_X86_DATA_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/datatypes.h | 89 ++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 46 deletions(-) diff --git a/src/datatypes.h b/src/datatypes.h index 87f3d5e095..36d4cb9314 100644 --- a/src/datatypes.h +++ b/src/datatypes.h @@ -19,15 +19,14 @@ * */ -#ifndef LIBVIRT_DATATYPES_H -# define LIBVIRT_DATATYPES_H +#pragma once -# include "internal.h" +#include "internal.h" -# include "driver.h" -# include "virthread.h" -# include "virobject.h" -# include "viruuid.h" +#include "driver.h" +#include "virthread.h" +#include "virobject.h" +#include "viruuid.h" extern virClassPtr virConnectClass; extern virClassPtr virDomainClass; @@ -47,7 +46,7 @@ extern virClassPtr virAdmConnectClass; extern virClassPtr virAdmServerClass; extern virClassPtr virAdmClientClass; -# define virCheckConnectReturn(obj, retval) \ +#define virCheckConnectReturn(obj, retval) \ do { \ if (!virObjectIsClass(obj, virConnectClass)) { \ virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \ @@ -57,7 +56,7 @@ extern virClassPtr virAdmClientClass; return retval; \ } \ } while (0) -# define virCheckConnectGoto(obj, label) \ +#define virCheckConnectGoto(obj, label) \ do { \ if (!virObjectIsClass(obj, virConnectClass)) { \ virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \ @@ -67,7 +66,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckDomainReturn(obj, retval) \ +#define virCheckDomainReturn(obj, retval) \ do { \ virDomainPtr _dom = (obj); \ if (!virObjectIsClass(_dom, virDomainClass) || \ @@ -79,7 +78,7 @@ extern virClassPtr virAdmClientClass; return retval; \ } \ } while (0) -# define virCheckDomainGoto(obj, label) \ +#define virCheckDomainGoto(obj, label) \ do { \ virDomainPtr _dom = (obj); \ if (!virObjectIsClass(_dom, virDomainClass) || \ @@ -91,7 +90,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckNetworkReturn(obj, retval) \ +#define virCheckNetworkReturn(obj, retval) \ do { \ virNetworkPtr _net = (obj); \ if (!virObjectIsClass(_net, virNetworkClass) || \ @@ -104,7 +103,7 @@ extern virClassPtr virAdmClientClass; return retval; \ } \ } while (0) -# define virCheckNetworkGoto(obj, label) \ +#define virCheckNetworkGoto(obj, label) \ do { \ virNetworkPtr _net = (obj); \ if (!virObjectIsClass(_net, virNetworkClass) || \ @@ -117,7 +116,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckInterfaceReturn(obj, retval) \ +#define virCheckInterfaceReturn(obj, retval) \ do { \ virInterfacePtr _iface = (obj); \ if (!virObjectIsClass(_iface, virInterfaceClass) || \ @@ -131,7 +130,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckStoragePoolReturn(obj, retval) \ +#define virCheckStoragePoolReturn(obj, retval) \ do { \ virStoragePoolPtr _pool = (obj); \ if (!virObjectIsClass(_pool, virStoragePoolClass) || \ @@ -145,7 +144,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckStoragePoolGoto(obj, label) \ +#define virCheckStoragePoolGoto(obj, label) \ do { \ virStoragePoolPtr _pool= (obj); \ if (!virObjectIsClass(_pool, virStoragePoolClass) || \ @@ -158,7 +157,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckStorageVolReturn(obj, retval) \ +#define virCheckStorageVolReturn(obj, retval) \ do { \ virStorageVolPtr _vol = (obj); \ if (!virObjectIsClass(_vol, virStorageVolClass) || \ @@ -171,7 +170,7 @@ extern virClassPtr virAdmClientClass; return retval; \ } \ } while (0) -# define virCheckStorageVolGoto(obj, label) \ +#define virCheckStorageVolGoto(obj, label) \ do { \ virStorageVolPtr _vol = (obj); \ if (!virObjectIsClass(_vol, virStorageVolClass) || \ @@ -184,7 +183,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckNodeDeviceReturn(obj, retval) \ +#define virCheckNodeDeviceReturn(obj, retval) \ do { \ virNodeDevicePtr _node = (obj); \ if (!virObjectIsClass(_node, virNodeDeviceClass) || \ @@ -198,7 +197,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckNodeDeviceGoto(obj, label) \ +#define virCheckNodeDeviceGoto(obj, label) \ do { \ virNodeDevicePtr _dev= (obj); \ if (!virObjectIsClass(_dev, virNodeDeviceClass) || \ @@ -211,7 +210,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckSecretReturn(obj, retval) \ +#define virCheckSecretReturn(obj, retval) \ do { \ virSecretPtr _secret = (obj); \ if (!virObjectIsClass(_secret, virSecretClass) || \ @@ -225,7 +224,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckSecretGoto(obj, label) \ +#define virCheckSecretGoto(obj, label) \ do { \ virSecretPtr _secret = (obj); \ if (!virObjectIsClass(_secret, virSecretClass) || \ @@ -239,7 +238,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckStreamReturn(obj, retval) \ +#define virCheckStreamReturn(obj, retval) \ do { \ virStreamPtr _st = (obj); \ if (!virObjectIsClass(_st, virStreamClass) || \ @@ -252,7 +251,7 @@ extern virClassPtr virAdmClientClass; return retval; \ } \ } while (0) -# define virCheckStreamGoto(obj, label) \ +#define virCheckStreamGoto(obj, label) \ do { \ virStreamPtr _st = (obj); \ if (!virObjectIsClass(_st, virStreamClass) || \ @@ -265,7 +264,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckNWFilterReturn(obj, retval) \ +#define virCheckNWFilterReturn(obj, retval) \ do { \ virNWFilterPtr _nw = (obj); \ if (!virObjectIsClass(_nw, virNWFilterClass) || \ @@ -279,7 +278,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckNWFilterBindingReturn(obj, retval) \ +#define virCheckNWFilterBindingReturn(obj, retval) \ do { \ virNWFilterBindingPtr _nw = (obj); \ if (!virObjectIsClass(_nw, virNWFilterBindingClass) || \ @@ -293,7 +292,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckDomainCheckpointReturn(obj, retval) \ +#define virCheckDomainCheckpointReturn(obj, retval) \ do { \ virDomainCheckpointPtr _check = (obj); \ if (!virObjectIsClass(_check, virDomainCheckpointClass) || \ @@ -308,7 +307,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckDomainSnapshotReturn(obj, retval) \ +#define virCheckDomainSnapshotReturn(obj, retval) \ do { \ virDomainSnapshotPtr _snap = (obj); \ if (!virObjectIsClass(_snap, virDomainSnapshotClass) || \ @@ -332,29 +331,29 @@ extern virClassPtr virAdmClientClass; * "define a(b,...) b,##__VA_ARGS__" as a means of eliding a comma * when no var-args are present, but we don't want to require gcc. */ -# define VIR_ARG15(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ - _11, _12, _13, _14, _15, ...) _15 -# define VIR_HAS_COMMA(...) VIR_ARG15(__VA_ARGS__, \ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0) +#define VIR_ARG15(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ + _11, _12, _13, _14, _15, ...) _15 +#define VIR_HAS_COMMA(...) VIR_ARG15(__VA_ARGS__, \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0) /* Form the name VIR_DOMAIN_DEBUG_[01], then call that macro, * according to how many arguments are present. Two-phase due to * macro expansion rules. */ -# define VIR_DOMAIN_DEBUG_EXPAND(a, b, ...) \ +#define VIR_DOMAIN_DEBUG_EXPAND(a, b, ...) \ VIR_DOMAIN_DEBUG_PASTE(a, b, __VA_ARGS__) -# define VIR_DOMAIN_DEBUG_PASTE(a, b, ...) \ +#define VIR_DOMAIN_DEBUG_PASTE(a, b, ...) \ a##b(__VA_ARGS__) /* Internal use only, when VIR_DOMAIN_DEBUG has one argument. */ -# define VIR_DOMAIN_DEBUG_0(dom) \ +#define VIR_DOMAIN_DEBUG_0(dom) \ VIR_DOMAIN_DEBUG_2(dom, "%s", "") /* Internal use only, when VIR_DOMAIN_DEBUG has three or more arguments. */ -# define VIR_DOMAIN_DEBUG_1(dom, fmt, ...) \ +#define VIR_DOMAIN_DEBUG_1(dom, fmt, ...) \ VIR_DOMAIN_DEBUG_2(dom, ", " fmt, __VA_ARGS__) /* Internal use only, with final format. */ -# define VIR_DOMAIN_DEBUG_2(dom, fmt, ...) \ +#define VIR_DOMAIN_DEBUG_2(dom, fmt, ...) \ do { \ char _uuidstr[VIR_UUID_STRING_BUFLEN]; \ const char *_domname = NULL; \ @@ -370,7 +369,7 @@ extern virClassPtr virAdmClientClass; dom, NULLSTR(_domname), _uuidstr, __VA_ARGS__); \ } while (0) -# define virCheckAdmConnectReturn(obj, retval) \ +#define virCheckAdmConnectReturn(obj, retval) \ do { \ if (!virObjectIsClass(obj, virAdmConnectClass)) { \ virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \ @@ -380,7 +379,7 @@ extern virClassPtr virAdmClientClass; return retval; \ } \ } while (0) -# define virCheckAdmConnectGoto(obj, label) \ +#define virCheckAdmConnectGoto(obj, label) \ do { \ if (!virObjectIsClass(obj, virAdmConnectClass)) { \ virReportErrorHelper(VIR_FROM_THIS, VIR_ERR_INVALID_CONN, \ @@ -390,7 +389,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0) -# define virCheckAdmServerReturn(obj, retval) \ +#define virCheckAdmServerReturn(obj, retval) \ do { \ virAdmServerPtr _srv = (obj); \ if (!virObjectIsClass(_srv, virAdmServerClass) || \ @@ -402,7 +401,7 @@ extern virClassPtr virAdmClientClass; return retval; \ } \ } while (0) -# define virCheckAdmServerGoto(obj, label) \ +#define virCheckAdmServerGoto(obj, label) \ do { \ virAdmServerPtr _srv = (obj); \ if (!virObjectIsClass(_srv, virAdmServerClass) || \ @@ -414,7 +413,7 @@ extern virClassPtr virAdmClientClass; } \ } while (0); -# define virCheckAdmClientReturn(obj, retval) \ +#define virCheckAdmClientReturn(obj, retval) \ do { \ virAdmClientPtr _clt = (obj); \ if (!virObjectIsClass(_clt, virAdmClientClass) || \ @@ -427,7 +426,7 @@ extern virClassPtr virAdmClientClass; return retval; \ } \ } while (0) -# define virCheckAdmClientGoto(obj, label) \ +#define virCheckAdmClientGoto(obj, label) \ do { \ virAdmClientPtr _clt = (obj); \ if (!virObjectIsClass(_clt, virAdmClientClass) || \ @@ -446,7 +445,7 @@ extern virClassPtr virAdmClientClass; * @fmt: optional format for additional information * @...: optional arguments corresponding to @fmt. */ -# define VIR_DOMAIN_DEBUG(...) \ +#define VIR_DOMAIN_DEBUG(...) \ VIR_DOMAIN_DEBUG_EXPAND(VIR_DOMAIN_DEBUG_, \ VIR_HAS_COMMA(__VA_ARGS__), \ __VA_ARGS__) @@ -808,5 +807,3 @@ int virAdmConnectCloseCallbackDataRegister(virAdmConnectCloseCallbackDataPtr cbd virFreeCallback freecb); int virAdmConnectCloseCallbackDataUnregister(virAdmConnectCloseCallbackDataPtr cbdata, virAdmConnectCloseFunc cb); - -#endif /* LIBVIRT_DATATYPES_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/esx/esx_driver.h | 5 +--- src/esx/esx_interface_driver.h | 7 ++---- src/esx/esx_network_driver.h | 7 ++---- src/esx/esx_private.h | 15 +++++------- src/esx/esx_storage_backend_iscsi.h | 7 ++---- src/esx/esx_storage_backend_vmfs.h | 7 ++---- src/esx/esx_storage_driver.h | 7 ++---- src/esx/esx_stream.h | 9 +++---- src/esx/esx_util.h | 13 ++++------ src/esx/esx_vi.h | 37 +++++++++++++---------------- src/esx/esx_vi_methods.h | 11 ++++----- src/esx/esx_vi_types.h | 13 ++++------ 12 files changed, 51 insertions(+), 87 deletions(-) diff --git a/src/esx/esx_driver.h b/src/esx/esx_driver.h index 6c8f32c9d6..f37fec4867 100644 --- a/src/esx/esx_driver.h +++ b/src/esx/esx_driver.h @@ -20,9 +20,6 @@ * */ -#ifndef LIBVIRT_ESX_DRIVER_H -# define LIBVIRT_ESX_DRIVER_H +#pragma once int esxRegister(void); - -#endif /* LIBVIRT_ESX_DRIVER_H */ diff --git a/src/esx/esx_interface_driver.h b/src/esx/esx_interface_driver.h index 20e4fe60d0..014e9d06d4 100644 --- a/src/esx/esx_interface_driver.h +++ b/src/esx/esx_interface_driver.h @@ -20,11 +20,8 @@ * */ -#ifndef LIBVIRT_ESX_INTERFACE_DRIVER_H -# define LIBVIRT_ESX_INTERFACE_DRIVER_H +#pragma once -# include "driver.h" +#include "driver.h" extern virInterfaceDriver esxInterfaceDriver; - -#endif /* LIBVIRT_ESX_INTERFACE_DRIVER_H */ diff --git a/src/esx/esx_network_driver.h b/src/esx/esx_network_driver.h index c977a1abcf..b15e160c69 100644 --- a/src/esx/esx_network_driver.h +++ b/src/esx/esx_network_driver.h @@ -20,11 +20,8 @@ * */ -#ifndef LIBVIRT_ESX_NETWORK_DRIVER_H -# define LIBVIRT_ESX_NETWORK_DRIVER_H +#pragma once -# include "driver.h" +#include "driver.h" extern virNetworkDriver esxNetworkDriver; - -#endif /* LIBVIRT_ESX_NETWORK_DRIVER_H */ diff --git a/src/esx/esx_private.h b/src/esx/esx_private.h index abb4567e8f..15edab4aa1 100644 --- a/src/esx/esx_private.h +++ b/src/esx/esx_private.h @@ -19,14 +19,13 @@ * */ -#ifndef LIBVIRT_ESX_PRIVATE_H -# define LIBVIRT_ESX_PRIVATE_H +#pragma once -# include "internal.h" -# include "virerror.h" -# include "capabilities.h" -# include "domain_conf.h" -# include "esx_vi.h" +#include "internal.h" +#include "virerror.h" +#include "capabilities.h" +#include "domain_conf.h" +#include "esx_vi.h" typedef struct _esxPrivate { esxVI_Context *primary; /* points to host or vCenter */ @@ -41,5 +40,3 @@ typedef struct _esxPrivate { esxVI_Boolean supportsScreenshot; int32_t usedCpuTimeCounterId; } esxPrivate; - -#endif /* LIBVIRT_ESX_PRIVATE_H */ diff --git a/src/esx/esx_storage_backend_iscsi.h b/src/esx/esx_storage_backend_iscsi.h index 09ca4ac813..7d62060122 100644 --- a/src/esx/esx_storage_backend_iscsi.h +++ b/src/esx/esx_storage_backend_iscsi.h @@ -19,11 +19,8 @@ * */ -#ifndef LIBVIRT_ESX_STORAGE_BACKEND_ISCSI_H -# define LIBVIRT_ESX_STORAGE_BACKEND_ISCSI_H +#pragma once -# include "driver.h" +#include "driver.h" extern virStorageDriver esxStorageBackendISCSI; - -#endif /* LIBVIRT_ESX_STORAGE_BACKEND_ISCSI_H */ diff --git a/src/esx/esx_storage_backend_vmfs.h b/src/esx/esx_storage_backend_vmfs.h index 67b8af38cc..153996d6c6 100644 --- a/src/esx/esx_storage_backend_vmfs.h +++ b/src/esx/esx_storage_backend_vmfs.h @@ -20,11 +20,8 @@ * */ -#ifndef LIBVIRT_ESX_STORAGE_BACKEND_VMFS_H -# define LIBVIRT_ESX_STORAGE_BACKEND_VMFS_H +#pragma once -# include "driver.h" +#include "driver.h" extern virStorageDriver esxStorageBackendVMFS; - -#endif /* LIBVIRT_ESX_STORAGE_BACKEND_VMFS_H */ diff --git a/src/esx/esx_storage_driver.h b/src/esx/esx_storage_driver.h index 73110cf8e6..3c487355c8 100644 --- a/src/esx/esx_storage_driver.h +++ b/src/esx/esx_storage_driver.h @@ -20,11 +20,8 @@ * */ -#ifndef LIBVIRT_ESX_STORAGE_DRIVER_H -# define LIBVIRT_ESX_STORAGE_DRIVER_H +#pragma once -# include "driver.h" +#include "driver.h" extern virStorageDriver esxStorageDriver; - -#endif /* LIBVIRT_ESX_STORAGE_DRIVER_H */ diff --git a/src/esx/esx_stream.h b/src/esx/esx_stream.h index f00b4443aa..29ca014c67 100644 --- a/src/esx/esx_stream.h +++ b/src/esx/esx_stream.h @@ -19,14 +19,11 @@ * */ -#ifndef LIBVIRT_ESX_STREAM_H -# define LIBVIRT_ESX_STREAM_H +#pragma once -# include "internal.h" -# include "esx_private.h" +#include "internal.h" +#include "esx_private.h" int esxStreamOpenUpload(virStreamPtr stream, esxPrivate *priv, const char *url); int esxStreamOpenDownload(virStreamPtr stream, esxPrivate *priv, const char *url, unsigned long long offset, unsigned long long length); - -#endif /* LIBVIRT_ESX_STREAM_H */ diff --git a/src/esx/esx_util.h b/src/esx/esx_util.h index 163626688e..d80093dcb5 100644 --- a/src/esx/esx_util.h +++ b/src/esx/esx_util.h @@ -19,14 +19,13 @@ * */ -#ifndef LIBVIRT_ESX_UTIL_H -# define LIBVIRT_ESX_UTIL_H +#pragma once -# include <netdb.h> -# include "internal.h" -# include "viruri.h" +#include <netdb.h> +#include "internal.h" +#include "viruri.h" -# define ESX_VI_CHECK_ARG_LIST(val) \ +#define ESX_VI_CHECK_ARG_LIST(val) \ do { \ if (!val || *val) { \ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); \ @@ -69,5 +68,3 @@ void esxUtil_ReplaceSpecialWindowsPathChars(char *string); char *esxUtil_EscapeDatastoreItem(const char *string); char *esxUtil_EscapeForXml(const char *string); - -#endif /* LIBVIRT_ESX_UTIL_H */ diff --git a/src/esx/esx_vi.h b/src/esx/esx_vi.h index ff2abfb034..bff2782ba1 100644 --- a/src/esx/esx_vi.h +++ b/src/esx/esx_vi.h @@ -20,25 +20,24 @@ * */ -#ifndef LIBVIRT_ESX_VI_H -# define LIBVIRT_ESX_VI_H +#pragma once -# include <libxml/tree.h> -# include <libxml/xpath.h> -# include <curl/curl.h> +#include <libxml/tree.h> +#include <libxml/xpath.h> +#include <curl/curl.h> -# include "internal.h" -# include "virerror.h" -# include "datatypes.h" -# include "esx_vi_types.h" -# include "esx_util.h" +#include "internal.h" +#include "virerror.h" +#include "datatypes.h" +#include "esx_vi_types.h" +#include "esx_util.h" /* curl_multi_wait was added in libcurl 7.28.0, emulate it on older versions */ -# define ESX_EMULATE_CURL_MULTI_WAIT (LIBCURL_VERSION_NUM < 0x071C00) +#define ESX_EMULATE_CURL_MULTI_WAIT (LIBCURL_VERSION_NUM < 0x071C00) -# define ESX_VI__SOAP__REQUEST_HEADER \ +#define ESX_VI__SOAP__REQUEST_HEADER \ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" \ "<soapenv:Envelope\n" \ " xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n" \ @@ -49,13 +48,13 @@ -# define ESX_VI__SOAP__REQUEST_FOOTER \ +#define ESX_VI__SOAP__REQUEST_FOOTER \ "</soapenv:Body>\n" \ "</soapenv:Envelope>" -# define ESV_VI__XML_TAG__OPEN(_buffer, _element, _type) \ +#define ESV_VI__XML_TAG__OPEN(_buffer, _element, _type) \ do { \ virBufferAddLit(_buffer, "<"); \ virBufferAdd(_buffer, _element, -1); \ @@ -66,7 +65,7 @@ -# define ESV_VI__XML_TAG__CLOSE(_buffer, _element) \ +#define ESV_VI__XML_TAG__CLOSE(_buffer, _element) \ do { \ virBufferAddLit(_buffer, "</"); \ virBufferAdd(_buffer, _element, -1); \ @@ -160,11 +159,11 @@ int esxVI_SharedCURL_Remove(esxVI_SharedCURL *shared, esxVI_CURL *curl); struct _esxVI_MultiCURL { CURLM *handle; size_t count; /* number of added easy handle */ -# if ESX_EMULATE_CURL_MULTI_WAIT +#if ESX_EMULATE_CURL_MULTI_WAIT struct pollfd *pollfds; size_t npollfds; bool timeoutPending; -# endif +#endif }; int esxVI_MultiCURL_Alloc(esxVI_MultiCURL **multi); @@ -530,6 +529,4 @@ int esxVI_LookupHostScsiTopologyLunListByTargetName int esxVI_LookupStoragePoolNameByScsiLunKey(esxVI_Context *ctx, const char *key, char **poolName); -# include "esx_vi.generated.h" - -#endif /* LIBVIRT_ESX_VI_H */ +#include "esx_vi.generated.h" diff --git a/src/esx/esx_vi_methods.h b/src/esx/esx_vi_methods.h index b09f64ba48..3f0823dbd1 100644 --- a/src/esx/esx_vi_methods.h +++ b/src/esx/esx_vi_methods.h @@ -19,11 +19,10 @@ * */ -#ifndef LIBVIRT_ESX_VI_METHODS_H -# define LIBVIRT_ESX_VI_METHODS_H +#pragma once -# include "esx_vi.h" -# include "esx_vi_types.h" +#include "esx_vi.h" +#include "esx_vi_types.h" @@ -44,6 +43,4 @@ int esxVI_ValidateMigration esxVI_ManagedObjectReference *host, /* optional */ esxVI_Event **output); /* optional, list */ -# include "esx_vi_methods.generated.h" - -#endif /* LIBVIRT_ESX_VI_METHODS_H */ +#include "esx_vi_methods.generated.h" diff --git a/src/esx/esx_vi_types.h b/src/esx/esx_vi_types.h index d43e825a48..956c43df9a 100644 --- a/src/esx/esx_vi_types.h +++ b/src/esx/esx_vi_types.h @@ -19,10 +19,9 @@ * */ -#ifndef LIBVIRT_ESX_VI_TYPES_H -# define LIBVIRT_ESX_VI_TYPES_H +#pragma once -# include "virbuffer.h" +#include "virbuffer.h" typedef enum _esxVI_Type esxVI_Type; typedef struct _esxVI_Object esxVI_Object; @@ -60,7 +59,7 @@ typedef struct _esxVI_MethodFault esxVI_MethodFault; typedef struct _esxVI_ManagedObjectReference esxVI_ManagedObjectReference; typedef struct _esxVI_Event esxVI_Event; -# include "esx_vi_types.generated.typedef" +#include "esx_vi_types.generated.typedef" @@ -83,7 +82,7 @@ enum _esxVI_Type { esxVI_Type_ManagedObjectReference, esxVI_Type_Event, -# include "esx_vi_types.generated.typeenum" +#include "esx_vi_types.generated.typeenum" esxVI_Type_Other, }; @@ -409,7 +408,7 @@ int esxVI_Event_DeserializeList(xmlNodePtr node, esxVI_Event **list); -# include "esx_vi_types.generated.h" +#include "esx_vi_types.generated.h" @@ -419,5 +418,3 @@ int esxVI_Event_DeserializeList(xmlNodePtr node, esxVI_Event **list); int esxVI_VirtualMachinePowerState_ConvertToLibvirt (esxVI_VirtualMachinePowerState powerState); - -#endif /* LIBVIRT_ESX_VI_TYPES_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/hyperv/hyperv_driver.h | 5 +---- src/hyperv/hyperv_private.h | 13 +++++------- src/hyperv/hyperv_util.h | 9 +++------ src/hyperv/hyperv_wmi.h | 21 +++++++++----------- src/hyperv/hyperv_wmi_classes.h | 27 +++++++++++-------------- src/hyperv/openwsman.h | 35 +++++++++++++++------------------ 6 files changed, 46 insertions(+), 64 deletions(-) diff --git a/src/hyperv/hyperv_driver.h b/src/hyperv/hyperv_driver.h index f333fba3e1..8099b5714b 100644 --- a/src/hyperv/hyperv_driver.h +++ b/src/hyperv/hyperv_driver.h @@ -20,9 +20,6 @@ * */ -#ifndef LIBVIRT_HYPERV_DRIVER_H -# define LIBVIRT_HYPERV_DRIVER_H +#pragma once int hypervRegister(void); - -#endif /* LIBVIRT_HYPERV_DRIVER_H */ diff --git a/src/hyperv/hyperv_private.h b/src/hyperv/hyperv_private.h index f8d8f7deff..b502e71d83 100644 --- a/src/hyperv/hyperv_private.h +++ b/src/hyperv/hyperv_private.h @@ -20,13 +20,12 @@ * */ -#ifndef LIBVIRT_HYPERV_PRIVATE_H -# define LIBVIRT_HYPERV_PRIVATE_H +#pragma once -# include "internal.h" -# include "virerror.h" -# include "hyperv_util.h" -# include "openwsman.h" +#include "internal.h" +#include "virerror.h" +#include "hyperv_util.h" +#include "openwsman.h" typedef enum _hypervWmiVersion hypervWmiVersion; enum _hypervWmiVersion { @@ -40,5 +39,3 @@ struct _hypervPrivate { WsManClient *client; hypervWmiVersion wmiVersion; }; - -#endif /* LIBVIRT_HYPERV_PRIVATE_H */ diff --git a/src/hyperv/hyperv_util.h b/src/hyperv/hyperv_util.h index c72a308da9..67d698450d 100644 --- a/src/hyperv/hyperv_util.h +++ b/src/hyperv/hyperv_util.h @@ -19,11 +19,10 @@ * */ -#ifndef LIBVIRT_HYPERV_UTIL_H -# define LIBVIRT_HYPERV_UTIL_H +#pragma once -# include "internal.h" -# include "viruri.h" +#include "internal.h" +#include "viruri.h" typedef struct _hypervParsedUri hypervParsedUri; @@ -34,5 +33,3 @@ struct _hypervParsedUri { int hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri); void hypervFreeParsedUri(hypervParsedUri **parsedUri); - -#endif /* LIBVIRT_HYPERV_UTIL_H */ diff --git a/src/hyperv/hyperv_wmi.h b/src/hyperv/hyperv_wmi.h index e3ace01131..74a74e0e09 100644 --- a/src/hyperv/hyperv_wmi.h +++ b/src/hyperv/hyperv_wmi.h @@ -21,21 +21,20 @@ * */ -#ifndef LIBVIRT_HYPERV_WMI_H -# define LIBVIRT_HYPERV_WMI_H +#pragma once -# include "virbuffer.h" -# include "hyperv_private.h" -# include "hyperv_wmi_classes.h" -# include "openwsman.h" -# include "virhash.h" +#include "virbuffer.h" +#include "hyperv_private.h" +#include "hyperv_wmi_classes.h" +#include "openwsman.h" +#include "virhash.h" -# define HYPERV_WQL_QUERY_INITIALIZER { NULL, NULL } +#define HYPERV_WQL_QUERY_INITIALIZER { NULL, NULL } -# define HYPERV_DEFAULT_PARAM_COUNT 5 +#define HYPERV_DEFAULT_PARAM_COUNT 5 -# define MSVM_VIRTUALSYSTEMMANAGEMENTSERVICE_SELECTOR \ +#define MSVM_VIRTUALSYSTEMMANAGEMENTSERVICE_SELECTOR \ "CreationClassName=Msvm_VirtualSystemManagementService" int hypervVerifyResponse(WsManClient *client, WsXmlDocH response, @@ -252,5 +251,3 @@ int hypervMsvmComputerSystemToDomain(virConnectPtr conn, int hypervMsvmComputerSystemFromDomain(virDomainPtr domain, Msvm_ComputerSystem **computerSystem); - -#endif /* LIBVIRT_HYPERV_WMI_H */ diff --git a/src/hyperv/hyperv_wmi_classes.h b/src/hyperv/hyperv_wmi_classes.h index cf2ae75447..a19b6a656d 100644 --- a/src/hyperv/hyperv_wmi_classes.h +++ b/src/hyperv/hyperv_wmi_classes.h @@ -21,21 +21,20 @@ * */ -#ifndef LIBVIRT_HYPERV_WMI_CLASSES_H -# define LIBVIRT_HYPERV_WMI_CLASSES_H +#pragma once -# include "internal.h" -# include "openwsman.h" +#include "internal.h" +#include "openwsman.h" -# include "hyperv_wmi_classes.generated.typedef" +#include "hyperv_wmi_classes.generated.typedef" -# define ROOT_CIMV2 \ +#define ROOT_CIMV2 \ "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/*" -# define ROOT_VIRTUALIZATION \ +#define ROOT_VIRTUALIZATION \ "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/*" -# define ROOT_VIRTUALIZATION_V2 \ +#define ROOT_VIRTUALIZATION_V2 \ "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/virtualization/v2/*" @@ -44,16 +43,16 @@ * Msvm_ComputerSystem */ -# define MSVM_COMPUTERSYSTEM_WQL_VIRTUAL \ +#define MSVM_COMPUTERSYSTEM_WQL_VIRTUAL \ "Description = \"Microsoft Virtual Machine\" " -# define MSVM_COMPUTERSYSTEM_WQL_PHYSICAL \ +#define MSVM_COMPUTERSYSTEM_WQL_PHYSICAL \ "Description = \"Microsoft Hosting Computer System\" " -# define MSVM_COMPUTERSYSTEM_WQL_ACTIVE \ +#define MSVM_COMPUTERSYSTEM_WQL_ACTIVE \ "(EnabledState != 0 and EnabledState != 3 and EnabledState != 32769) " -# define MSVM_COMPUTERSYSTEM_WQL_INACTIVE \ +#define MSVM_COMPUTERSYSTEM_WQL_INACTIVE \ "(EnabledState = 0 or EnabledState = 3 or EnabledState = 32769) " enum _Msvm_ComputerSystem_EnabledState { @@ -138,6 +137,4 @@ struct _hypervWmiClassInfoList { hypervWmiClassInfoPtr *objs; }; -# include "hyperv_wmi_classes.generated.h" - -#endif /* LIBVIRT_HYPERV_WMI_CLASSES_H */ +#include "hyperv_wmi_classes.generated.h" diff --git a/src/hyperv/openwsman.h b/src/hyperv/openwsman.h index 3f19a8f890..cd7660ac2e 100644 --- a/src/hyperv/openwsman.h +++ b/src/hyperv/openwsman.h @@ -19,32 +19,29 @@ * */ -#ifndef LIBVIRT_OPENWSMAN_H -# define LIBVIRT_OPENWSMAN_H +#pragma once /* Workaround openwsman <= 2.2.6 unconditionally defining optarg. Just pretend * that u/os.h was already included. Need to explicitly include time.h because * wsman-xml-serializer.h needs it and u/os.h would have included it. */ -# include <time.h> -# define _LIBU_OS_H_ -# include <wsman-api.h> +#include <time.h> +#define _LIBU_OS_H_ +#include <wsman-api.h> /* wsman-xml-serializer.h in openwsman <= 2.2.6 is missing this defines */ -# ifndef SER_NS_INT8 -# define SER_NS_INT8(ns, n, x) SER_NS_INT8_FLAGS(ns, n, x, 0) -# endif -# ifndef SER_NS_INT16 -# define SER_NS_INT16(ns, n, x) SER_NS_INT16_FLAGS(ns, n, x, 0) -# endif -# ifndef SER_NS_INT32 -# define SER_NS_INT32(ns, n, x) SER_NS_INT32_FLAGS(ns, n, x, 0) -# endif -# ifndef SER_NS_INT64 -# define SER_NS_INT64(ns, n, x) SER_NS_INT64_FLAGS(ns, n, x, 0) -# endif +#ifndef SER_NS_INT8 +# define SER_NS_INT8(ns, n, x) SER_NS_INT8_FLAGS(ns, n, x, 0) +#endif +#ifndef SER_NS_INT16 +# define SER_NS_INT16(ns, n, x) SER_NS_INT16_FLAGS(ns, n, x, 0) +#endif +#ifndef SER_NS_INT32 +# define SER_NS_INT32(ns, n, x) SER_NS_INT32_FLAGS(ns, n, x, 0) +#endif +#ifndef SER_NS_INT64 +# define SER_NS_INT64(ns, n, x) SER_NS_INT64_FLAGS(ns, n, x, 0) +#endif /* wsman-xml.h */ WsXmlDocH ws_xml_create_doc(const char *rootNsUri, const char *rootName); WsXmlNodeH xml_parser_get_root(WsXmlDocH doc); - -#endif /* LIBVIRT_OPENWSMAN_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/interface/interface_driver.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/interface/interface_driver.h b/src/interface/interface_driver.h index 242e00a824..eee01d4aec 100644 --- a/src/interface/interface_driver.h +++ b/src/interface/interface_driver.h @@ -18,12 +18,9 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_INTERFACE_DRIVER_H -# define LIBVIRT_INTERFACE_DRIVER_H +#pragma once int interfaceRegister(void); int netcfIfaceRegister(void); int udevIfaceRegister(void); - -#endif /* LIBVIRT_INTERFACE_DRIVER_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/internal.h | 295 ++++++++++++++++++++++++------------------------- 1 file changed, 146 insertions(+), 149 deletions(-) diff --git a/src/internal.h b/src/internal.h index 5a868bb00c..f718895460 100644 --- a/src/internal.h +++ b/src/internal.h @@ -18,101 +18,100 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_INTERNAL_H -# define LIBVIRT_INTERNAL_H - -# include <errno.h> -# include <limits.h> -# include <verify.h> -# include <stdbool.h> -# include <stdint.h> -# include <stdio.h> -# include <string.h> - -# if STATIC_ANALYSIS -# undef NDEBUG /* Don't let a prior NDEBUG definition cause trouble. */ -# include <assert.h> -# define sa_assert(expr) assert (expr) -# else -# define sa_assert(expr) /* empty */ -# endif +#pragma once + +#include <errno.h> +#include <limits.h> +#include <verify.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdio.h> +#include <string.h> + +#if STATIC_ANALYSIS +# undef NDEBUG /* Don't let a prior NDEBUG definition cause trouble. */ +# include <assert.h> +# define sa_assert(expr) assert (expr) +#else +# define sa_assert(expr) /* empty */ +#endif /* The library itself is allowed to use deprecated functions / * variables, so effectively undefine the deprecated attribute * which would otherwise be defined in libvirt.h. */ -# undef VIR_DEPRECATED -# define VIR_DEPRECATED /*empty*/ +#undef VIR_DEPRECATED +#define VIR_DEPRECATED /*empty*/ /* The library itself needs to know enum sizes. */ -# define VIR_ENUM_SENTINELS - -# ifdef HAVE_LIBINTL_H -# define DEFAULT_TEXT_DOMAIN PACKAGE -# include <libintl.h> -# define _(str) dgettext(PACKAGE, str) -# else /* HAVE_LIBINTL_H */ -# define _(str) str -# endif /* HAVE_LIBINTL_H */ -# define N_(str) str - -# include "libvirt/libvirt.h" -# include "libvirt/libvirt-lxc.h" -# include "libvirt/libvirt-qemu.h" -# include "libvirt/libvirt-admin.h" -# include "libvirt/virterror.h" - -# include "c-strcase.h" -# include "ignore-value.h" -# include "count-leading-zeros.h" +#define VIR_ENUM_SENTINELS + +#ifdef HAVE_LIBINTL_H +# define DEFAULT_TEXT_DOMAIN PACKAGE +# include <libintl.h> +# define _(str) dgettext(PACKAGE, str) +#else /* HAVE_LIBINTL_H */ +# define _(str) str +#endif /* HAVE_LIBINTL_H */ +#define N_(str) str + +#include "libvirt/libvirt.h" +#include "libvirt/libvirt-lxc.h" +#include "libvirt/libvirt-qemu.h" +#include "libvirt/libvirt-admin.h" +#include "libvirt/virterror.h" + +#include "c-strcase.h" +#include "ignore-value.h" +#include "count-leading-zeros.h" /* String equality tests, suggested by Jim Meyering. */ -# define STREQ(a, b) (strcmp(a, b) == 0) -# define STRCASEEQ(a, b) (c_strcasecmp(a, b) == 0) -# define STRNEQ(a, b) (strcmp(a, b) != 0) -# define STRCASENEQ(a, b) (c_strcasecmp(a, b) != 0) -# define STREQLEN(a, b, n) (strncmp(a, b, n) == 0) -# define STRCASEEQLEN(a, b, n) (c_strncasecmp(a, b, n) == 0) -# define STRNEQLEN(a, b, n) (strncmp(a, b, n) != 0) -# define STRCASENEQLEN(a, b, n) (c_strncasecmp(a, b, n) != 0) -# define STRPREFIX(a, b) (strncmp(a, b, strlen(b)) == 0) -# define STRCASEPREFIX(a, b) (c_strncasecmp(a, b, strlen(b)) == 0) -# define STRSKIP(a, b) (STRPREFIX(a, b) ? (a) + strlen(b) : NULL) - -# define STREQ_NULLABLE(a, b) \ +#define STREQ(a, b) (strcmp(a, b) == 0) +#define STRCASEEQ(a, b) (c_strcasecmp(a, b) == 0) +#define STRNEQ(a, b) (strcmp(a, b) != 0) +#define STRCASENEQ(a, b) (c_strcasecmp(a, b) != 0) +#define STREQLEN(a, b, n) (strncmp(a, b, n) == 0) +#define STRCASEEQLEN(a, b, n) (c_strncasecmp(a, b, n) == 0) +#define STRNEQLEN(a, b, n) (strncmp(a, b, n) != 0) +#define STRCASENEQLEN(a, b, n) (c_strncasecmp(a, b, n) != 0) +#define STRPREFIX(a, b) (strncmp(a, b, strlen(b)) == 0) +#define STRCASEPREFIX(a, b) (c_strncasecmp(a, b, strlen(b)) == 0) +#define STRSKIP(a, b) (STRPREFIX(a, b) ? (a) + strlen(b) : NULL) + +#define STREQ_NULLABLE(a, b) \ ((a) ? (b) && STREQ((a), (b)) : !(b)) -# define STRNEQ_NULLABLE(a, b) \ +#define STRNEQ_NULLABLE(a, b) \ ((a) ? !(b) || STRNEQ((a), (b)) : !!(b)) -# define NUL_TERMINATE(buf) do { (buf)[sizeof(buf)-1] = '\0'; } while (0) -# define ARRAY_CARDINALITY(Array) (sizeof(Array) / sizeof(*(Array))) +#define NUL_TERMINATE(buf) do { (buf)[sizeof(buf)-1] = '\0'; } while (0) +#define ARRAY_CARDINALITY(Array) (sizeof(Array) / sizeof(*(Array))) /** * ATTRIBUTE_UNUSED: * * Macro to flag consciously unused parameters to functions */ -# ifndef ATTRIBUTE_UNUSED -# define ATTRIBUTE_UNUSED __attribute__((__unused__)) -# endif +#ifndef ATTRIBUTE_UNUSED +# define ATTRIBUTE_UNUSED __attribute__((__unused__)) +#endif /** * ATTRIBUTE_NORETURN: * * Macro to indicate that a function won't return to the caller */ -# ifndef ATTRIBUTE_NORETURN -# define ATTRIBUTE_NORETURN __attribute__((__noreturn__)) -# endif +#ifndef ATTRIBUTE_NORETURN +# define ATTRIBUTE_NORETURN __attribute__((__noreturn__)) +#endif /** * ATTRIBUTE_SENTINEL: * * Macro to check for NULL-terminated varargs lists */ -# ifndef ATTRIBUTE_SENTINEL -# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__)) -# endif +#ifndef ATTRIBUTE_SENTINEL +# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__)) +#endif /** * ATTRIBUTE_NOINLINE: @@ -120,9 +119,9 @@ * Force compiler not to inline a method. Should be used if * the method need to be overridable by test mocks. */ -# ifndef ATTRIBUTE_NOINLINE -# define ATTRIBUTE_NOINLINE __attribute__((__noinline__)) -# endif +#ifndef ATTRIBUTE_NOINLINE +# define ATTRIBUTE_NOINLINE __attribute__((__noinline__)) +#endif /** * ATTRIBUTE_FMT_PRINTF @@ -134,19 +133,19 @@ * printf format specifiers even on broken Win32 platforms * hence we have to force 'gnu_printf' for new GCC */ -# ifndef ATTRIBUTE_FMT_PRINTF -# ifndef __clang__ -# define ATTRIBUTE_FMT_PRINTF(fmtpos, argpos) \ +#ifndef ATTRIBUTE_FMT_PRINTF +# ifndef __clang__ +# define ATTRIBUTE_FMT_PRINTF(fmtpos, argpos) \ __attribute__((__format__ (__gnu_printf__, fmtpos, argpos))) -# else -# define ATTRIBUTE_FMT_PRINTF(fmtpos, argpos) \ +# else +# define ATTRIBUTE_FMT_PRINTF(fmtpos, argpos) \ __attribute__((__format__ (__printf__, fmtpos, argpos))) -# endif # endif +#endif -# ifndef ATTRIBUTE_RETURN_CHECK -# define ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__)) -# endif +#ifndef ATTRIBUTE_RETURN_CHECK +# define ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__)) +#endif /** * ATTRIBUTE_PACKED @@ -157,9 +156,9 @@ * ethernet packets. * Others compiler than gcc may use something different e.g. #pragma pack(1) */ -# ifndef ATTRIBUTE_PACKED -# define ATTRIBUTE_PACKED __attribute__((packed)) -# endif +#ifndef ATTRIBUTE_PACKED +# define ATTRIBUTE_PACKED __attribute__((packed)) +#endif /* gcc's handling of attribute nonnull is less than stellar - it does * NOT improve diagnostics, and merely allows gcc to optimize away @@ -170,97 +169,97 @@ * based on whether we are compiling for real or for analysis, while * still requiring correct gcc syntax when it is turned off. See also * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17308 */ -# ifndef ATTRIBUTE_NONNULL -# if STATIC_ANALYSIS -# define ATTRIBUTE_NONNULL(m) __attribute__((__nonnull__(m))) -# else -# define ATTRIBUTE_NONNULL(m) __attribute__(()) -# endif +#ifndef ATTRIBUTE_NONNULL +# if STATIC_ANALYSIS +# define ATTRIBUTE_NONNULL(m) __attribute__((__nonnull__(m))) +# else +# define ATTRIBUTE_NONNULL(m) __attribute__(()) # endif +#endif -# ifndef ATTRIBUTE_FALLTHROUGH -# if __GNUC_PREREQ (7, 0) -# define ATTRIBUTE_FALLTHROUGH __attribute__((fallthrough)) -# else -# define ATTRIBUTE_FALLTHROUGH do {} while(0) -# endif +#ifndef ATTRIBUTE_FALLTHROUGH +# if __GNUC_PREREQ (7, 0) +# define ATTRIBUTE_FALLTHROUGH __attribute__((fallthrough)) +# else +# define ATTRIBUTE_FALLTHROUGH do {} while(0) # endif +#endif -# if WORKING_PRAGMA_PUSH -# define VIR_WARNINGS_NO_CAST_ALIGN \ +#if WORKING_PRAGMA_PUSH +# define VIR_WARNINGS_NO_CAST_ALIGN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wcast-align\"") -# define VIR_WARNINGS_NO_DEPRECATED \ +# define VIR_WARNINGS_NO_DEPRECATED \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -# if HAVE_SUGGEST_ATTRIBUTE_FORMAT -# define VIR_WARNINGS_NO_PRINTF \ +# if HAVE_SUGGEST_ATTRIBUTE_FORMAT +# define VIR_WARNINGS_NO_PRINTF \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=format\"") -# else -# define VIR_WARNINGS_NO_PRINTF \ +# else +# define VIR_WARNINGS_NO_PRINTF \ _Pragma ("GCC diagnostic push") -# endif +# endif /* Workaround bogus GCC 6.0 for logical 'or' equal expression warnings. * (GCC bz 69602) */ -# if BROKEN_GCC_WLOGICALOP_EQUAL_EXPR -# define VIR_WARNINGS_NO_WLOGICALOP_EQUAL_EXPR \ +# if BROKEN_GCC_WLOGICALOP_EQUAL_EXPR +# define VIR_WARNINGS_NO_WLOGICALOP_EQUAL_EXPR \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wlogical-op\"") -# else -# define VIR_WARNINGS_NO_WLOGICALOP_EQUAL_EXPR \ +# else +# define VIR_WARNINGS_NO_WLOGICALOP_EQUAL_EXPR \ _Pragma ("GCC diagnostic push") -# endif +# endif -# define VIR_WARNINGS_RESET \ +# define VIR_WARNINGS_RESET \ _Pragma ("GCC diagnostic pop") -# else -# define VIR_WARNINGS_NO_CAST_ALIGN -# define VIR_WARNINGS_NO_DEPRECATED -# define VIR_WARNINGS_NO_PRINTF -# define VIR_WARNINGS_NO_WLOGICALOP_EQUAL_EXPR -# define VIR_WARNINGS_RESET -# endif +#else +# define VIR_WARNINGS_NO_CAST_ALIGN +# define VIR_WARNINGS_NO_DEPRECATED +# define VIR_WARNINGS_NO_PRINTF +# define VIR_WARNINGS_NO_WLOGICALOP_EQUAL_EXPR +# define VIR_WARNINGS_RESET +#endif /* Workaround bogus GCC < 4.6 that produces false -Wlogical-op warnings for * strchr(). Those old GCCs don't support push/pop. */ -# if BROKEN_GCC_WLOGICALOP_STRCHR -# define VIR_WARNINGS_NO_WLOGICALOP_STRCHR \ +#if BROKEN_GCC_WLOGICALOP_STRCHR +# define VIR_WARNINGS_NO_WLOGICALOP_STRCHR \ _Pragma ("GCC diagnostic ignored \"-Wlogical-op\"") -# else -# define VIR_WARNINGS_NO_WLOGICALOP_STRCHR -# endif +#else +# define VIR_WARNINGS_NO_WLOGICALOP_STRCHR +#endif /* * Use this when passing possibly-NULL strings to printf-a-likes. */ -# define NULLSTR(s) ((s) ? (s) : "<null>") +#define NULLSTR(s) ((s) ? (s) : "<null>") /* * Turn a NULL string into an empty string */ -# define NULLSTR_EMPTY(s) ((s) ? (s) : "") +#define NULLSTR_EMPTY(s) ((s) ? (s) : "") /* * Turn a NULL string into a star */ -# define NULLSTR_STAR(s) ((s) ? (s) : "*") +#define NULLSTR_STAR(s) ((s) ? (s) : "*") /* * Turn a NULL string into a minus sign */ -# define NULLSTR_MINUS(s) ((s) ? (s) : "-") +#define NULLSTR_MINUS(s) ((s) ? (s) : "-") /** * SWAP: * * In place exchange of two values */ -# define SWAP(a, b) \ +#define SWAP(a, b) \ do { \ (a) = (a) ^ (b); \ (b) = (a) ^ (b); \ @@ -273,7 +272,7 @@ * Steals pointer passed as second argument into the first argument. Second * argument must not have side effects. */ -# define VIR_STEAL_PTR(a, b) \ +#define VIR_STEAL_PTR(a, b) \ do { \ (a) = (b); \ (b) = NULL; \ @@ -287,7 +286,7 @@ * freed by using VIR_AUTOPTR can be easily passed back to the caller without * any temporary variable. @ptr is evaluated more than once. */ -# define VIR_RETURN_PTR(ptr) \ +#define VIR_RETURN_PTR(ptr) \ do { \ typeof(ptr) virTemporaryReturnPointer = (ptr); \ (ptr) = NULL; \ @@ -305,7 +304,7 @@ * Returns nothing. Exits the caller function if unsupported flags were * passed to it. */ -# define virCheckFlags(supported, retval) \ +#define virCheckFlags(supported, retval) \ do { \ unsigned long __unsuppflags = flags & ~(supported); \ if (__unsuppflags) { \ @@ -327,7 +326,7 @@ * Returns nothing. Jumps to a label if unsupported flags were * passed to it. */ -# define virCheckFlagsGoto(supported, label) \ +#define virCheckFlagsGoto(supported, label) \ do { \ unsigned long __unsuppflags = flags & ~(supported); \ if (__unsuppflags) { \ @@ -353,7 +352,7 @@ * This helper does an early return and therefore it has to be called * before anything that would require cleanup. */ -# define VIR_EXCLUSIVE_FLAGS_RET(FLAG1, FLAG2, RET) \ +#define VIR_EXCLUSIVE_FLAGS_RET(FLAG1, FLAG2, RET) \ do { \ if ((flags & FLAG1) && (flags & FLAG2)) { \ virReportInvalidArg(ctl, \ @@ -377,7 +376,7 @@ * Returns nothing. Jumps to a label if unsupported flags were * passed to it. */ -# define VIR_EXCLUSIVE_FLAGS_GOTO(FLAG1, FLAG2, LABEL) \ +#define VIR_EXCLUSIVE_FLAGS_GOTO(FLAG1, FLAG2, LABEL) \ do { \ if ((flags & FLAG1) && (flags & FLAG2)) { \ virReportInvalidArg(ctl, \ @@ -403,7 +402,7 @@ * This helper does an early return and therefore it has to be called * before anything that would require cleanup. */ -# define VIR_REQUIRE_FLAG_RET(FLAG1, FLAG2, RET) \ +#define VIR_REQUIRE_FLAG_RET(FLAG1, FLAG2, RET) \ do { \ if ((flags & FLAG1) && !(flags & FLAG2)) { \ virReportInvalidArg(ctl, \ @@ -425,7 +424,7 @@ * * Returns nothing. Jumps to a label if required flag is not set. */ -# define VIR_REQUIRE_FLAG_GOTO(FLAG1, FLAG2, LABEL) \ +#define VIR_REQUIRE_FLAG_GOTO(FLAG1, FLAG2, LABEL) \ do { \ if ((flags & FLAG1) && !(flags & FLAG2)) { \ virReportInvalidArg(ctl, \ @@ -435,28 +434,28 @@ } \ } while (0) -# define virCheckNonNullArgReturn(argname, retval) \ +#define virCheckNonNullArgReturn(argname, retval) \ do { \ if (argname == NULL) { \ virReportInvalidNonNullArg(argname); \ return retval; \ } \ } while (0) -# define virCheckNullArgGoto(argname, label) \ +#define virCheckNullArgGoto(argname, label) \ do { \ if (argname != NULL) { \ virReportInvalidNullArg(argname); \ goto label; \ } \ } while (0) -# define virCheckNonNullArgGoto(argname, label) \ +#define virCheckNonNullArgGoto(argname, label) \ do { \ if (argname == NULL) { \ virReportInvalidNonNullArg(argname); \ goto label; \ } \ } while (0) -# define virCheckNonEmptyStringArgGoto(argname, label) \ +#define virCheckNonEmptyStringArgGoto(argname, label) \ do { \ if (argname == NULL) { \ virReportInvalidNonNullArg(argname); \ @@ -467,42 +466,42 @@ goto label; \ } \ } while (0) -# define virCheckPositiveArgGoto(argname, label) \ +#define virCheckPositiveArgGoto(argname, label) \ do { \ if (argname <= 0) { \ virReportInvalidPositiveArg(argname); \ goto label; \ } \ } while (0) -# define virCheckPositiveArgReturn(argname, retval) \ +#define virCheckPositiveArgReturn(argname, retval) \ do { \ if (argname <= 0) { \ virReportInvalidPositiveArg(argname); \ return retval; \ } \ } while (0) -# define virCheckNonZeroArgGoto(argname, label) \ +#define virCheckNonZeroArgGoto(argname, label) \ do { \ if (argname == 0) { \ virReportInvalidNonZeroArg(argname); \ goto label; \ } \ } while (0) -# define virCheckZeroArgGoto(argname, label) \ +#define virCheckZeroArgGoto(argname, label) \ do { \ if (argname != 0) { \ virReportInvalidNonZeroArg(argname); \ goto label; \ } \ } while (0) -# define virCheckNonNegativeArgGoto(argname, label) \ +#define virCheckNonNegativeArgGoto(argname, label) \ do { \ if (argname < 0) { \ virReportInvalidNonNegativeArg(argname); \ goto label; \ } \ } while (0) -# define virCheckReadOnlyGoto(flags, label) \ +#define virCheckReadOnlyGoto(flags, label) \ do { \ if ((flags) & VIR_CONNECT_RO) { \ virReportRestrictedError(_("read only access prevents %s"), \ @@ -514,14 +513,14 @@ /* divide value by size, rounding up */ -# define VIR_DIV_UP(value, size) (((value) + (size) - 1) / (size)) +#define VIR_DIV_UP(value, size) (((value) + (size) - 1) / (size)) /* round up value to the closest multiple of size */ -# define VIR_ROUND_UP(value, size) (VIR_DIV_UP(value, size) * (size)) +#define VIR_ROUND_UP(value, size) (VIR_DIV_UP(value, size) * (size)) /* Round up to the next closest power of 2. It will return rounded number or 0 * for 0 or number more than 2^31 (for 32bit unsigned int). */ -# define VIR_ROUND_UP_POWER_OF_TWO(value) \ +#define VIR_ROUND_UP_POWER_OF_TWO(value) \ ((value) > 0 && (value) <= 1U << (sizeof(unsigned int) * 8 - 1) ? \ 1U << (sizeof(unsigned int) * 8 - count_leading_zeros((value) - 1)) : 0) @@ -534,8 +533,6 @@ enum { EXIT_ENOENT = 127, /* Could not find program to exec */ }; -# ifndef ENODATA -# define ENODATA EIO -# endif - -#endif /* LIBVIRT_INTERNAL_H */ +#ifndef ENODATA +# define ENODATA EIO +#endif -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/libvirt_internal.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h index 8be1257814..3f012fdd4b 100644 --- a/src/libvirt_internal.h +++ b/src/libvirt_internal.h @@ -22,10 +22,9 @@ * include/libvirt/libvirt.h apply. ie this file is *append* only */ -#ifndef LIBVIRT_LIBVIRT_INTERNAL_H -# define LIBVIRT_LIBVIRT_INTERNAL_H +#pragma once -# include "internal.h" +#include "internal.h" typedef void (*virStateInhibitCallback)(bool inhibit, void *opaque); @@ -297,5 +296,3 @@ virTypedParameterValidateSet(virConnectPtr conn, int virStreamInData(virStreamPtr stream, int *data, long long *length); - -#endif /* LIBVIRT_LIBVIRT_INTERNAL_H */ -- 2.20.1

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- 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

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com> --- src/logging/log_daemon.h | 9 +++------ src/logging/log_daemon_config.h | 7 ++----- src/logging/log_daemon_dispatch.h | 7 ++----- src/logging/log_handler.h | 9 +++------ src/logging/log_manager.h | 9 +++------ 5 files changed, 13 insertions(+), 28 deletions(-) diff --git a/src/logging/log_daemon.h b/src/logging/log_daemon.h index 27f6af72cf..fa661e1793 100644 --- a/src/logging/log_daemon.h +++ b/src/logging/log_daemon.h @@ -18,11 +18,10 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_LOG_DAEMON_H -# define LIBVIRT_LOG_DAEMON_H +#pragma once -# include "virthread.h" -# include "log_handler.h" +#include "virthread.h" +#include "log_handler.h" typedef struct _virLogDaemon virLogDaemon; typedef virLogDaemon *virLogDaemonPtr; @@ -39,5 +38,3 @@ struct _virLogDaemonClient { extern virLogDaemonPtr logDaemon; virLogHandlerPtr virLogDaemonGetHandler(virLogDaemonPtr dmn); - -#endif /* LIBVIRT_LOG_DAEMON_H */ diff --git a/src/logging/log_daemon_config.h b/src/logging/log_daemon_config.h index 2508e4c918..957c20c893 100644 --- a/src/logging/log_daemon_config.h +++ b/src/logging/log_daemon_config.h @@ -19,10 +19,9 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_LOG_DAEMON_CONFIG_H -# define LIBVIRT_LOG_DAEMON_CONFIG_H +#pragma once -# include "internal.h" +#include "internal.h" typedef struct _virLogDaemonConfig virLogDaemonConfig; typedef virLogDaemonConfig *virLogDaemonConfigPtr; @@ -45,5 +44,3 @@ void virLogDaemonConfigFree(virLogDaemonConfigPtr data); int virLogDaemonConfigLoadFile(virLogDaemonConfigPtr data, const char *filename, bool allow_missing); - -#endif /* LIBVIRT_LOG_DAEMON_CONFIG_H */ diff --git a/src/logging/log_daemon_dispatch.h b/src/logging/log_daemon_dispatch.h index 8471d6798f..7738f62c70 100644 --- a/src/logging/log_daemon_dispatch.h +++ b/src/logging/log_daemon_dispatch.h @@ -18,12 +18,9 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_LOG_DAEMON_DISPATCH_H -# define LIBVIRT_LOG_DAEMON_DISPATCH_H +#pragma once -# include "rpc/virnetserverprogram.h" +#include "rpc/virnetserverprogram.h" extern virNetServerProgramProc virLogManagerProtocolProcs[]; extern size_t virLogManagerProtocolNProcs; - -#endif /* LIBVIRT_LOG_DAEMON_DISPATCH_H */ diff --git a/src/logging/log_handler.h b/src/logging/log_handler.h index db202f7091..8c8562e0c5 100644 --- a/src/logging/log_handler.h +++ b/src/logging/log_handler.h @@ -18,11 +18,10 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_LOG_HANDLER_H -# define LIBVIRT_LOG_HANDLER_H +#pragma once -# include "internal.h" -# include "virjson.h" +#include "internal.h" +#include "virjson.h" typedef struct _virLogHandler virLogHandler; typedef virLogHandler *virLogHandlerPtr; @@ -76,5 +75,3 @@ int virLogHandlerDomainAppendLogFile(virLogHandlerPtr handler, unsigned int flags); virJSONValuePtr virLogHandlerPreExecRestart(virLogHandlerPtr handler); - -#endif /* LIBVIRT_LOG_HANDLER_H */ diff --git a/src/logging/log_manager.h b/src/logging/log_manager.h index d796971ef8..cca1573841 100644 --- a/src/logging/log_manager.h +++ b/src/logging/log_manager.h @@ -18,12 +18,11 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBVIRT_LOG_MANAGER_H -# define LIBVIRT_LOG_MANAGER_H +#pragma once -# include "internal.h" +#include "internal.h" -# include "logging/log_protocol.h" +#include "logging/log_protocol.h" typedef struct _virLogManager virLogManager; typedef virLogManager *virLogManagerPtr; @@ -61,5 +60,3 @@ int virLogManagerDomainAppendMessage(virLogManagerPtr mgr, const char *path, const char *message, unsigned int flags); - -#endif /* LIBVIRT_LOG_MANAGER_H */ -- 2.20.1

On Fri, Jun 07, 2019 at 03:20:11PM -0500, Jonathon Jongsma wrote:
Hi all,
Welcome,
I'm trying to get up to speed with libvirt code,
please if you have something you wish we mentioned in our HACKING page or elsewhere to make the first contribution easier, let us know.
so I decided to start out with a slightly "mindless" task. I grabbed the '#pragma once' task from https://wiki.libvirt.org/page/BiteSizedTasks. This series covers the first part of the conversion. I chatted with Daniel Berrange briefly on IRC before starting, and he suggested that I should try to keep patches under 100k, and maybe each driver's source files as a single patch.
I had a bit of difficulty deciding where to split the src/conf/ and src/util/ directories. So some of the files with more changes ended up being single-file patches. I tried to combine some related source files into patches, but at a certain point I ran out of obvious files to combine, so I combined a bunch of smaller miscellaneous files into one larger patch. It may not be ideal, but it's the best I could come up with. Alternative suggestions welcome.
I'll follow up with the remaining changes if this division looks acceptable.
Jonathon Jongsma (19): Use #pragma once in driver headers src/access: use #pragma once in headers src/admin: use #pragma once in headers src/bhyve: use #pragma once in headers conf: domain: use #pragma once in headers conf: network: use #pragma once in headers conf: nwfilter: use #pragma once in headers conf: node device: use #pragma once in headers conf: storage: use #pragma once in headers conf: misc: use #pragma once in headers src/cpu: use #pragma once in headers src/datatypes.h: use #pragma once src/esx: use #pragma once in headers src/hyperv: use #pragma once in headers src/interface: use #pragma once in headers src/internal.h: use #pragma once src/libvirt_internal.h: use #pragma once src/libxl: use #pragma once in headers src/logging: use #pragma once in headers
src/access/viraccessdriver.h | 10 +- src/access/viraccessdrivernop.h | 7 +- [...] src/logging/log_daemon_dispatch.h | 7 +- src/logging/log_handler.h | 9 +- src/logging/log_manager.h | 9 +- 117 files changed, 928 insertions(+), 1296 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> and pushed. Jano

On 6/13/19 10:06 AM, Ján Tomko wrote:
Jonathon Jongsma (19): Use #pragma once in driver headers src/access: use #pragma once in headers src/admin: use #pragma once in headers src/bhyve: use #pragma once in headers conf: domain: use #pragma once in headers conf: network: use #pragma once in headers conf: nwfilter: use #pragma once in headers conf: node device: use #pragma once in headers conf: storage: use #pragma once in headers conf: misc: use #pragma once in headers src/cpu: use #pragma once in headers src/datatypes.h: use #pragma once src/esx: use #pragma once in headers src/hyperv: use #pragma once in headers src/interface: use #pragma once in headers src/internal.h: use #pragma once src/libvirt_internal.h: use #pragma once src/libxl: use #pragma once in headers src/logging: use #pragma once in headers
Does this series add a syntax-check rule to prevent reversion back to older styles when new files are introduced? For example, I now have to rebase my pending incremental backup work on top of this, which adds new files, but without a syntax-check rule addition, I can't quickly identify which files I plan to add that need a tweak.
Reviewed-by: Ján Tomko <jtomko@redhat.com> and pushed.
Thus, it would be a nice followup patch for you to work on. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org

On Thu, 2019-06-13 at 10:23 -0500, Eric Blake wrote:
On 6/13/19 10:06 AM, Ján Tomko wrote:
Jonathon Jongsma (19): Use #pragma once in driver headers src/access: use #pragma once in headers src/admin: use #pragma once in headers src/bhyve: use #pragma once in headers conf: domain: use #pragma once in headers conf: network: use #pragma once in headers conf: nwfilter: use #pragma once in headers conf: node device: use #pragma once in headers conf: storage: use #pragma once in headers conf: misc: use #pragma once in headers src/cpu: use #pragma once in headers src/datatypes.h: use #pragma once src/esx: use #pragma once in headers src/hyperv: use #pragma once in headers src/interface: use #pragma once in headers src/internal.h: use #pragma once src/libvirt_internal.h: use #pragma once src/libxl: use #pragma once in headers src/logging: use #pragma once in headers
Does this series add a syntax-check rule to prevent reversion back to older styles when new files are introduced? For example, I now have to rebase my pending incremental backup work on top of this, which adds new files, but without a syntax-check rule addition, I can't quickly identify which files I plan to add that need a tweak.
Good point. I did not add a syntax check yet. In fact, this is not even the complete patch series. The whole patch series is actually about 60 patches, but I didn't want to flood the mailing list right away on my first submission. So I just sent the first 20 or so in case people wanted to split them up differently. I can try to add a syntax check to include when I send the rest of the series.
Reviewed-by: Ján Tomko <jtomko@redhat.com> and pushed. Thus, it would be a nice followup patch for you to work on.
Sure thing. Jonathon

On 6/13/19 2:33 PM, Jonathon Jongsma wrote:
Does this series add a syntax-check rule to prevent reversion back to older styles when new files are introduced? For example, I now have to rebase my pending incremental backup work on top of this, which adds new files, but without a syntax-check rule addition, I can't quickly identify which files I plan to add that need a tweak.
Good point. I did not add a syntax check yet. In fact, this is not even the complete patch series. The whole patch series is actually about 60 patches, but I didn't want to flood the mailing list right away on my first submission. So I just sent the first 20 or so in case people wanted to split them up differently. I can try to add a syntax check to include when I send the rest of the series.
Reviewed-by: Ján Tomko <jtomko@redhat.com> and pushed. Thus, it would be a nice followup patch for you to work on.
Sure thing.
In fact, if you're not done patching things, a syntax check would fire prematurely :) So it must be last in your series, but it's also nice knowing that there is more to come. If nothing else, you can test that applying the syntax check early flags things you still need to fix, and that applying it at the end of your work finds nothing wrong. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org

On Thu, Jun 13, 2019 at 10:23:30AM -0500, Eric Blake wrote:
On 6/13/19 10:06 AM, Ján Tomko wrote:
Jonathon Jongsma (19): Use #pragma once in driver headers src/access: use #pragma once in headers src/admin: use #pragma once in headers src/bhyve: use #pragma once in headers conf: domain: use #pragma once in headers conf: network: use #pragma once in headers conf: nwfilter: use #pragma once in headers conf: node device: use #pragma once in headers conf: storage: use #pragma once in headers conf: misc: use #pragma once in headers src/cpu: use #pragma once in headers src/datatypes.h: use #pragma once src/esx: use #pragma once in headers src/hyperv: use #pragma once in headers src/interface: use #pragma once in headers src/internal.h: use #pragma once src/libvirt_internal.h: use #pragma once src/libxl: use #pragma once in headers src/logging: use #pragma once in headers
Does this series add a syntax-check rule to prevent reversion back to older styles when new files are introduced? For example, I now have to rebase my pending incremental backup work on top of this, which adds new files, but without a syntax-check rule addition, I can't quickly identify which files I plan to add that need a tweak.
Note that we do have syntax-check for this, it had to be loosened in: commit ac41ffb8fa1235c226377397842c6c240a677d87 Author: Cole Robinson <crobinso@redhat.com> AuthorDate: 2019-04-03 17:45:02 -0400 Commit: Cole Robinson <crobinso@redhat.com> CommitDate: 2019-04-04 18:42:09 -0400 build-aux: header-ifdef: Handle #pragma once If we see it, skip all remaining header guard checks Acked-by: Eric Blake <eblake@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com> But currently it accepts both variants. Jano
Reviewed-by: Ján Tomko <jtomko@redhat.com> and pushed.
Thus, it would be a nice followup patch for you to work on.
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org

On Fri, 2019-06-14 at 08:07 +0200, Ján Tomko wrote:
On Thu, Jun 13, 2019 at 10:23:30AM -0500, Eric Blake wrote:
On 6/13/19 10:06 AM, Ján Tomko wrote:
Jonathon Jongsma (19): Use #pragma once in driver headers src/access: use #pragma once in headers src/admin: use #pragma once in headers src/bhyve: use #pragma once in headers conf: domain: use #pragma once in headers conf: network: use #pragma once in headers conf: nwfilter: use #pragma once in headers conf: node device: use #pragma once in headers conf: storage: use #pragma once in headers conf: misc: use #pragma once in headers src/cpu: use #pragma once in headers src/datatypes.h: use #pragma once src/esx: use #pragma once in headers src/hyperv: use #pragma once in headers src/interface: use #pragma once in headers src/internal.h: use #pragma once src/libvirt_internal.h: use #pragma once src/libxl: use #pragma once in headers src/logging: use #pragma once in headers
Does this series add a syntax-check rule to prevent reversion back to older styles when new files are introduced? For example, I now have to rebase my pending incremental backup work on top of this, which adds new files, but without a syntax-check rule addition, I can't quickly identify which files I plan to add that need a tweak.
Note that we do have syntax-check for this, it had to be loosened in: commit ac41ffb8fa1235c226377397842c6c240a677d87 Author: Cole Robinson <crobinso@redhat.com> AuthorDate: 2019-04-03 17:45:02 -0400 Commit: Cole Robinson <crobinso@redhat.com> CommitDate: 2019-04-04 18:42:09 -0400
build-aux: header-ifdef: Handle #pragma once
If we see it, skip all remaining header guard checks
Acked-by: Eric Blake <eblake@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
But currently it accepts both variants.
Jano
Out of curiosity, do we want to use #pragma once in the public headers as well, or only the internal ones? Jonathon

On 6/14/19 11:18 AM, Jonathon Jongsma wrote:
Note that we do have syntax-check for this, it had to be loosened in: commit ac41ffb8fa1235c226377397842c6c240a677d87 Author: Cole Robinson <crobinso@redhat.com> AuthorDate: 2019-04-03 17:45:02 -0400 Commit: Cole Robinson <crobinso@redhat.com> CommitDate: 2019-04-04 18:42:09 -0400
build-aux: header-ifdef: Handle #pragma once
If we see it, skip all remaining header guard checks
Acked-by: Eric Blake <eblake@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
But currently it accepts both variants.
Jano
Out of curiosity, do we want to use #pragma once in the public headers as well, or only the internal ones?
Only internal. Our public headers (in theory) should be usable from any non-gcc/clang C99 compiler. #pragma once is a non-portable compiler extension that happens to be portable to the only two compilers we admit for building libvirt itself, but that does not imply that we are going to force other projects using the public headers to do the same. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
participants (3)
-
Eric Blake
-
Jonathon Jongsma
-
Ján Tomko