From 07729eedf3599c255c9d6ed50e4a212612bacd48 Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Fri, 7 Jun 2019 15:20:25 -0500 Subject: [PATCH] src/hyperv: use #pragma once in headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonathon Jongsma Reviewed-by: Ján Tomko Signed-off-by: Ján Tomko --- 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 -# define _LIBU_OS_H_ -# include +#include +#define _LIBU_OS_H_ +#include /* 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 */