src/hyperv: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jonathon Jongsma 2019-06-07 15:20:25 -05:00 committed by Ján Tomko
parent a037259055
commit 07729eedf3
6 changed files with 46 additions and 64 deletions

View File

@ -20,9 +20,6 @@
*
*/
#ifndef LIBVIRT_HYPERV_DRIVER_H
# define LIBVIRT_HYPERV_DRIVER_H
#pragma once
int hypervRegister(void);
#endif /* LIBVIRT_HYPERV_DRIVER_H */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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"

View File

@ -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 */