diff --git a/src/util/virarptable.h b/src/util/virarptable.h
index 4437b3544f0f469ea2c90e7b1f7a2a365de2d808..812524d7213d24e4214b2b5612d45957b06b6e70 100644
--- a/src/util/virarptable.h
+++ b/src/util/virarptable.h
@@ -18,10 +18,9 @@
* .
*/
-#ifndef LIBVIRT_VIRARPTABLE_H
-# define LIBVIRT_VIRARPTABLE_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
typedef struct _virArpTableEntry virArpTableEntry;
typedef virArpTableEntry *virArpTableEntryPtr;
@@ -40,5 +39,3 @@ struct _virArpTable {
virArpTablePtr virArpTableGet(void);
void virArpTableFree(virArpTablePtr table);
-
-#endif /* LIBVIRT_VIRARPTABLE_H */
diff --git a/src/util/viraudit.h b/src/util/viraudit.h
index 66605b16b5af6f904f23e1e10da811e5a54e8ebd..51e152ad1e311123563f6366e6dbadf69b9c2be3 100644
--- a/src/util/viraudit.h
+++ b/src/util/viraudit.h
@@ -19,11 +19,10 @@
*
*/
-#ifndef LIBVIRT_VIRAUDIT_H
-# define LIBVIRT_VIRAUDIT_H
+#pragma once
-# include "internal.h"
-# include "virlog.h"
+#include "internal.h"
+#include "virlog.h"
typedef enum {
VIR_AUDIT_RECORD_MACHINE_CONTROL,
@@ -46,15 +45,13 @@ char *virAuditEncode(const char *key, const char *value);
void virAuditClose(void);
-# define VIR_AUDIT(type, success, ...) \
+#define VIR_AUDIT(type, success, ...) \
virAuditSend(&virLogSelf, __FILE__, __LINE__, __func__, \
NULL, NULL, type, success, __VA_ARGS__);
-# define VIR_AUDIT_USER(type, success, clienttty, clientaddr, ...) \
+#define VIR_AUDIT_USER(type, success, clienttty, clientaddr, ...) \
virAuditSend(&virLogSelf, __FILE__, __LINE__, __func__, \
clienttty, clientaddr, type, success, __VA_ARGS__);
-# define VIR_AUDIT_STR(str) \
+#define VIR_AUDIT_STR(str) \
((str) ? (str) : "?")
-
-#endif /* LIBVIRT_VIRAUDIT_H */
diff --git a/src/util/virauth.h b/src/util/virauth.h
index ebcca2cc019faa8087cfcfe9d86a8757480bd585..d91a545ed2439ef08661a164212d27bbd221275f 100644
--- a/src/util/virauth.h
+++ b/src/util/virauth.h
@@ -20,11 +20,10 @@
*
*/
-#ifndef LIBVIRT_VIRAUTH_H
-# define LIBVIRT_VIRAUTH_H
+#pragma once
-# include "internal.h"
-# include "viruri.h"
+#include "internal.h"
+#include "viruri.h"
int virAuthGetConfigFilePath(virConnectPtr conn,
char **path);
@@ -53,4 +52,3 @@ char * virAuthGetPasswordPath(const char *path,
const char *servicename,
const char *username,
const char *hostname);
-#endif /* LIBVIRT_VIRAUTH_H */
diff --git a/src/util/virauthconfig.h b/src/util/virauthconfig.h
index cc30affa33e26709baf6da0e56fa3af02c0fc7b1..3de5e36030640e4e877ad6c9d1cb600cc56aeba3 100644
--- a/src/util/virauthconfig.h
+++ b/src/util/virauthconfig.h
@@ -18,11 +18,10 @@
* .
*/
-#ifndef LIBVIRT_VIRAUTHCONFIG_H
-# define LIBVIRT_VIRAUTHCONFIG_H
+#pragma once
-# include "internal.h"
-# include "virautoclean.h"
+#include "internal.h"
+#include "virautoclean.h"
typedef struct _virAuthConfig virAuthConfig;
typedef virAuthConfig *virAuthConfigPtr;
@@ -42,5 +41,3 @@ int virAuthConfigLookup(virAuthConfigPtr auth,
const char **value);
VIR_DEFINE_AUTOPTR_FUNC(virAuthConfig, virAuthConfigFree);
-
-#endif /* LIBVIRT_VIRAUTHCONFIG_H */
diff --git a/src/util/virautoclean.h b/src/util/virautoclean.h
index b632023c7332c01f13ddee9e971e951087297e8c..6da288e67d3da2b9076518df136c1fe50ddb134b 100644
--- a/src/util/virautoclean.h
+++ b/src/util/virautoclean.h
@@ -18,10 +18,9 @@
*
*/
-#ifndef LIBVIRT_VIRAUTOCLEAN_H
-# define LIBVIRT_VIRAUTOCLEAN_H
+#pragma once
-# define VIR_AUTOPTR_FUNC_NAME(type) type##AutoPtrFree
+#define VIR_AUTOPTR_FUNC_NAME(type) type##AutoPtrFree
/**
* VIR_DEFINE_AUTOPTR_FUNC:
@@ -32,7 +31,7 @@
* resources allocated to a variable of type @type. This newly
* defined function works as a necessary wrapper around @func.
*/
-# define VIR_DEFINE_AUTOPTR_FUNC(type, func) \
+#define VIR_DEFINE_AUTOPTR_FUNC(type, func) \
static inline void VIR_AUTOPTR_FUNC_NAME(type)(type **_ptr) \
{ \
if (*_ptr) \
@@ -40,7 +39,7 @@
*_ptr = NULL; \
}
-# define VIR_AUTOCLEAN_FUNC_NAME(type) type##AutoClean
+#define VIR_AUTOCLEAN_FUNC_NAME(type) type##AutoClean
/**
* VIR_DEFINE_AUTOCLEAN_FUNC:
@@ -51,7 +50,7 @@
* resources in a stack'd variable of type @type. Note that @func must
* take pointer to @type.
*/
-# define VIR_DEFINE_AUTOCLEAN_FUNC(type, func) \
+#define VIR_DEFINE_AUTOCLEAN_FUNC(type, func) \
static inline void VIR_AUTOCLEAN_FUNC_NAME(type)(type *_ptr) \
{ \
(func)(_ptr); \
@@ -69,7 +68,7 @@
* Note that this macro must NOT be used with vectors! The freeing function
* will not free any elements beyond the first.
*/
-# define VIR_AUTOPTR(type) \
+#define VIR_AUTOPTR(type) \
__attribute__((cleanup(VIR_AUTOPTR_FUNC_NAME(type)))) type *
/**
@@ -84,7 +83,5 @@
* Note that this macro must NOT be used with vectors! The cleaning function
* will not clean any elements beyond the first.
*/
-# define VIR_AUTOCLEAN(type) \
+#define VIR_AUTOCLEAN(type) \
__attribute__((cleanup(VIR_AUTOCLEAN_FUNC_NAME(type)))) type
-
-#endif /* LIBVIRT_VIRAUTOCLEAN_H */
diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h
index 8696214da815dc1c6a3e8c98e8bc068c26299d68..46696e0c70d3bb60fca5d3300fef605f8aceaaa2 100644
--- a/src/util/virbitmap.h
+++ b/src/util/virbitmap.h
@@ -19,13 +19,12 @@
* .
*/
-#ifndef LIBVIRT_VIRBITMAP_H
-# define LIBVIRT_VIRBITMAP_H
+#pragma once
-# include "internal.h"
-# include "virautoclean.h"
+#include "internal.h"
+#include "virautoclean.h"
-# include
+#include
typedef struct _virBitmap virBitmap;
@@ -159,5 +158,3 @@ void virBitmapSubtract(virBitmapPtr a, virBitmapPtr b)
void virBitmapShrink(virBitmapPtr map, size_t b);
VIR_DEFINE_AUTOPTR_FUNC(virBitmap, virBitmapFree);
-
-#endif /* LIBVIRT_VIRBITMAP_H */
diff --git a/src/util/virbuffer.h b/src/util/virbuffer.h
index dd9d4ab3d468552b62abaf5430affbd105179a42..d5a7a8dc33bba9bb8d851cddccc6b0f658fb7f90 100644
--- a/src/util/virbuffer.h
+++ b/src/util/virbuffer.h
@@ -18,13 +18,12 @@
* .
*/
-#ifndef LIBVIRT_VIRBUFFER_H
-# define LIBVIRT_VIRBUFFER_H
+#pragma once
-# include
+#include
-# include "internal.h"
-# include "virautoclean.h"
+#include "internal.h"
+#include "virautoclean.h"
/**
@@ -35,7 +34,7 @@
typedef struct _virBuffer virBuffer;
typedef virBuffer *virBufferPtr;
-# define VIR_BUFFER_INITIALIZER { 0, 0, 0, 0, NULL }
+#define VIR_BUFFER_INITIALIZER { 0, 0, 0, 0, NULL }
struct _virBuffer {
size_t size;
@@ -66,7 +65,7 @@ VIR_DEFINE_AUTOCLEAN_FUNC(virBuffer, virBufferFreeAndReset);
* Returns 0 if no error has occurred, otherwise an error is reported
* and -1 is returned.
*/
-# define virBufferCheckError(buf) \
+#define virBufferCheckError(buf) \
virBufferCheckErrorInternal(buf, VIR_FROM_THIS, __FILE__, __FUNCTION__, \
__LINE__)
size_t virBufferUse(const virBuffer *buf);
@@ -96,7 +95,7 @@ void virBufferEscapeSQL(virBufferPtr buf,
void virBufferEscapeShell(virBufferPtr buf, const char *str);
void virBufferURIEncodeString(virBufferPtr buf, const char *str);
-# define virBufferAddLit(buf_, literal_string_) \
+#define virBufferAddLit(buf_, literal_string_) \
virBufferAdd(buf_, "" literal_string_ "", sizeof(literal_string_) - 1)
void virBufferAdjustIndent(virBufferPtr buf, int indent);
@@ -108,12 +107,10 @@ void virBufferSetIndent(virBufferPtr, int indent);
* Gets the parent indentation, increments it by 2 and sets it to
* child buffer.
*/
-# define virBufferSetChildIndent(childBuf_, parentBuf_) \
+#define virBufferSetChildIndent(childBuf_, parentBuf_) \
virBufferSetIndent(childBuf_, virBufferGetIndent(parentBuf_, false) + 2)
int virBufferGetIndent(const virBuffer *buf, bool dynamic);
void virBufferTrim(virBufferPtr buf, const char *trim, int len);
void virBufferAddStr(virBufferPtr buf, const char *str);
-
-#endif /* LIBVIRT_VIRBUFFER_H */
diff --git a/src/util/virclosecallbacks.h b/src/util/virclosecallbacks.h
index e756c79a90f8916f17f900f691c9efc4716ac25a..98fc2c4a94a3d05a3023770a91f56ee1c9f23d84 100644
--- a/src/util/virclosecallbacks.h
+++ b/src/util/virclosecallbacks.h
@@ -18,10 +18,9 @@
* .
*/
-#ifndef LIBVIRT_VIRCLOSECALLBACKS_H
-# define LIBVIRT_VIRCLOSECALLBACKS_H
+#pragma once
-# include "conf/virdomainobjlist.h"
+#include "conf/virdomainobjlist.h"
typedef struct _virCloseCallbacks virCloseCallbacks;
typedef virCloseCallbacks *virCloseCallbacksPtr;
@@ -49,4 +48,3 @@ virCloseCallbacksRun(virCloseCallbacksPtr closeCallbacks,
virConnectPtr conn,
virDomainObjListPtr domains,
void *opaque);
-#endif /* LIBVIRT_VIRCLOSECALLBACKS_H */
diff --git a/src/util/virconf.h b/src/util/virconf.h
index d692e4a80599be529206b7349121b29191c21877..ed9d404a1e854fa300869a2c86643bf45bc69e34 100644
--- a/src/util/virconf.h
+++ b/src/util/virconf.h
@@ -18,11 +18,10 @@
* .
*/
-#ifndef LIBVIRT_VIRCONF_H
-# define LIBVIRT_VIRCONF_H
+#pragma once
-# include "virutil.h"
-# include "virenum.h"
+#include "virutil.h"
+#include "virenum.h"
/**
* virConfType:
@@ -128,5 +127,3 @@ int virConfWriteMem(char *memory,
int *len,
virConfPtr conf);
int virConfLoadConfig(virConfPtr *conf, const char *name);
-
-#endif /* LIBVIRT_VIRCONF_H */
diff --git a/src/util/vircrypto.h b/src/util/vircrypto.h
index f816ab54355101962d4749a41f1aacbdb6d78ffe..826169276e9976f080cc755b6134c3158110fe59 100644
--- a/src/util/vircrypto.h
+++ b/src/util/vircrypto.h
@@ -18,13 +18,12 @@
* .
*/
-#ifndef LIBVIRT_VIRCRYPTO_H
-# define LIBVIRT_VIRCRYPTO_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
-# define VIR_CRYPTO_HASH_SIZE_MD5 16
-# define VIR_CRYPTO_HASH_SIZE_SHA256 32
+#define VIR_CRYPTO_HASH_SIZE_MD5 16
+#define VIR_CRYPTO_HASH_SIZE_SHA256 32
typedef enum {
VIR_CRYPTO_HASH_MD5, /* Don't use this except for historic compat */
@@ -64,5 +63,3 @@ int virCryptoEncryptData(virCryptoCipher algorithm,
uint8_t **ciphertext, size_t *ciphertextlen)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(6)
ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(9) ATTRIBUTE_RETURN_CHECK;
-
-#endif /* LIBVIRT_VIRCRYPTO_H */
diff --git a/src/util/virdevmapper.h b/src/util/virdevmapper.h
index d9e1c1775ad6cb2eae709c463207fa0de4b7e308..e576d2bf7e0afcc590bd4f3f0fdf675cee6af901 100644
--- a/src/util/virdevmapper.h
+++ b/src/util/virdevmapper.h
@@ -18,11 +18,8 @@
* .
*/
-#ifndef LIBVIRT_VIRDEVMAPPER_H
-# define LIBVIRT_VIRDEVMAPPER_H
+#pragma once
int
virDevMapperGetTargets(const char *path,
char ***devPaths);
-
-#endif /* LIBVIRT_VIRDEVMAPPER_H */
diff --git a/src/util/virdnsmasq.h b/src/util/virdnsmasq.h
index 74774743fa27b2204a16d14cfc0beef489b9052c..ff0e56d63519a12fcdb3df7fae4b4878a145702c 100644
--- a/src/util/virdnsmasq.h
+++ b/src/util/virdnsmasq.h
@@ -21,11 +21,10 @@
* based on iptables.h
*/
-#ifndef LIBVIRT_VIRDNSMASQ_H
-# define LIBVIRT_VIRDNSMASQ_H
+#pragma once
-# include "virobject.h"
-# include "virsocketaddr.h"
+#include "virobject.h"
+#include "virsocketaddr.h"
typedef struct
{
@@ -106,17 +105,16 @@ bool dnsmasqCapsGet(dnsmasqCapsPtr caps, dnsmasqCapsFlags flag);
const char *dnsmasqCapsGetBinaryPath(dnsmasqCapsPtr caps);
unsigned long dnsmasqCapsGetVersion(dnsmasqCapsPtr caps);
-# define DNSMASQ_DHCPv6_MAJOR_REQD 2
-# define DNSMASQ_DHCPv6_MINOR_REQD 64
-# define DNSMASQ_RA_MAJOR_REQD 2
-# define DNSMASQ_RA_MINOR_REQD 64
+#define DNSMASQ_DHCPv6_MAJOR_REQD 2
+#define DNSMASQ_DHCPv6_MINOR_REQD 64
+#define DNSMASQ_RA_MAJOR_REQD 2
+#define DNSMASQ_RA_MINOR_REQD 64
-# define DNSMASQ_DHCPv6_SUPPORT(CAPS) \
+#define DNSMASQ_DHCPv6_SUPPORT(CAPS) \
(dnsmasqCapsGetVersion(CAPS) >= \
(DNSMASQ_DHCPv6_MAJOR_REQD * 1000000) + \
(DNSMASQ_DHCPv6_MINOR_REQD * 1000))
-# define DNSMASQ_RA_SUPPORT(CAPS) \
+#define DNSMASQ_RA_SUPPORT(CAPS) \
(dnsmasqCapsGetVersion(CAPS) >= \
(DNSMASQ_RA_MAJOR_REQD * 1000000) + \
(DNSMASQ_RA_MINOR_REQD * 1000))
-#endif /* LIBVIRT_VIRDNSMASQ_H */
diff --git a/src/util/virebtables.h b/src/util/virebtables.h
index 87bb3a3708b626909d2737a1ccf6b126878c0b16..9c878971c5ef4099234c6266945c8af7e4cd1b5c 100644
--- a/src/util/virebtables.h
+++ b/src/util/virebtables.h
@@ -19,10 +19,9 @@
* .
*/
-#ifndef LIBVIRT_VIREBTABLES_H
-# define LIBVIRT_VIREBTABLES_H
+#pragma once
-# include "virmacaddr.h"
+#include "virmacaddr.h"
typedef struct _ebtablesContext ebtablesContext;
@@ -37,5 +36,3 @@ int ebtablesRemoveForwardAllowIn (ebtablesContext *ctx,
const virMacAddr *mac);
int ebtablesAddForwardPolicyReject(ebtablesContext *ctx);
-
-#endif /* LIBVIRT_VIREBTABLES_H */
diff --git a/src/util/virendian.h b/src/util/virendian.h
index 4a92b1822da8645482426add0107a6a3d823e494..e5b82026ac8559a260b4e4edb11920b3e3d6436d 100644
--- a/src/util/virendian.h
+++ b/src/util/virendian.h
@@ -19,10 +19,9 @@
*
*/
-#ifndef LIBVIRT_VIRENDIAN_H
-# define LIBVIRT_VIRENDIAN_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
/* The interfaces in this file are provided as macros for speed. */
@@ -34,7 +33,7 @@
* Read 8 bytes at BUF as a big-endian 64-bit number. Caller is
* responsible to avoid reading beyond array bounds.
*/
-# define virReadBufInt64BE(buf) \
+#define virReadBufInt64BE(buf) \
(((uint64_t)(uint8_t)((buf)[0]) << 56) | \
((uint64_t)(uint8_t)((buf)[1]) << 48) | \
((uint64_t)(uint8_t)((buf)[2]) << 40) | \
@@ -52,7 +51,7 @@
* Read 8 bytes at BUF as a little-endian 64-bit number. Caller is
* responsible to avoid reading beyond array bounds.
*/
-# define virReadBufInt64LE(buf) \
+#define virReadBufInt64LE(buf) \
((uint64_t)(uint8_t)((buf)[0]) | \
((uint64_t)(uint8_t)((buf)[1]) << 8) | \
((uint64_t)(uint8_t)((buf)[2]) << 16) | \
@@ -70,7 +69,7 @@
* Read 4 bytes at BUF as a big-endian 32-bit number. Caller is
* responsible to avoid reading beyond array bounds.
*/
-# define virReadBufInt32BE(buf) \
+#define virReadBufInt32BE(buf) \
(((uint32_t)(uint8_t)((buf)[0]) << 24) | \
((uint32_t)(uint8_t)((buf)[1]) << 16) | \
((uint32_t)(uint8_t)((buf)[2]) << 8) | \
@@ -84,7 +83,7 @@
* Read 4 bytes at BUF as a little-endian 32-bit number. Caller is
* responsible to avoid reading beyond array bounds.
*/
-# define virReadBufInt32LE(buf) \
+#define virReadBufInt32LE(buf) \
((uint32_t)(uint8_t)((buf)[0]) | \
((uint32_t)(uint8_t)((buf)[1]) << 8) | \
((uint32_t)(uint8_t)((buf)[2]) << 16) | \
@@ -98,7 +97,7 @@
* Read 2 bytes at BUF as a big-endian 16-bit number. Caller is
* responsible to avoid reading beyond array bounds.
*/
-# define virReadBufInt16BE(buf) \
+#define virReadBufInt16BE(buf) \
(((uint16_t)(uint8_t)((buf)[0]) << 8) | \
(uint16_t)(uint8_t)((buf)[1]))
@@ -110,8 +109,6 @@
* Read 2 bytes at BUF as a little-endian 16-bit number. Caller is
* responsible to avoid reading beyond array bounds.
*/
-# define virReadBufInt16LE(buf) \
+#define virReadBufInt16LE(buf) \
((uint16_t)(uint8_t)((buf)[0]) | \
((uint16_t)(uint8_t)((buf)[1]) << 8))
-
-#endif /* LIBVIRT_VIRENDIAN_H */
diff --git a/src/util/virenum.h b/src/util/virenum.h
index 3ae1a70b72f396b249422bf60a49f15efc358b9e..ab443aa5286f56a49eef61a5e50227badc23e232 100644
--- a/src/util/virenum.h
+++ b/src/util/virenum.h
@@ -16,10 +16,9 @@
* .
*/
-#ifndef LIBVIRT_VIRENUM_H
-# define LIBVIRT_VIRENUM_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
int
virEnumFromString(const char * const *types,
@@ -31,7 +30,7 @@ virEnumToString(const char * const *types,
unsigned int ntypes,
int type);
-# define VIR_ENUM_IMPL(name, lastVal, ...) \
+#define VIR_ENUM_IMPL(name, lastVal, ...) \
static const char *const name ## TypeList[] = { __VA_ARGS__ }; \
const char *name ## TypeToString(int type) { \
return virEnumToString(name ## TypeList, \
@@ -45,7 +44,7 @@ virEnumToString(const char * const *types,
} \
verify(ARRAY_CARDINALITY(name ## TypeList) == lastVal)
-# define VIR_ENUM_DECL(name) \
+#define VIR_ENUM_DECL(name) \
const char *name ## TypeToString(int type); \
int name ## TypeFromString(const char*type)
@@ -76,5 +75,3 @@ virTristateSwitch virTristateSwitchFromBool(bool val);
verify((int)VIR_TRISTATE_BOOL_YES == (int)VIR_TRISTATE_SWITCH_ON);
verify((int)VIR_TRISTATE_BOOL_NO == (int)VIR_TRISTATE_SWITCH_OFF);
verify((int)VIR_TRISTATE_BOOL_ABSENT == (int)VIR_TRISTATE_SWITCH_ABSENT);
-
-#endif /* LIBVIRT_VIRENUM_H */
diff --git a/src/util/virevent.h b/src/util/virevent.h
index 37d70709352253da275f9b458fa328e46ef634ae..0b4f7d2b1b20b7ff67d93ce6974c831afb06c5a3 100644
--- a/src/util/virevent.h
+++ b/src/util/virevent.h
@@ -19,8 +19,5 @@
* .
*/
-#ifndef LIBVIRT_VIREVENT_H
-# define LIBVIRT_VIREVENT_H
-# include "internal.h"
-
-#endif /* LIBVIRT_VIREVENT_H */
+#pragma once
+#include "internal.h"
diff --git a/src/util/vireventpoll.h b/src/util/vireventpoll.h
index ad1ee56e7c57fad58cc437920ca465737e37955c..7f0c84776871166b8a3f03ad3c8afa697d04f610 100644
--- a/src/util/vireventpoll.h
+++ b/src/util/vireventpoll.h
@@ -19,10 +19,9 @@
* .
*/
-#ifndef LIBVIRT_VIREVENTPOLL_H
-# define LIBVIRT_VIREVENTPOLL_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
/**
* virEventPollAddHandle: register a callback for monitoring file handle events
@@ -125,6 +124,3 @@ int virEventPollToNativeEvents(int events);
* return -1 if wakeup failed
*/
int virEventPollInterrupt(void);
-
-
-#endif /* LIBVIRT_VIREVENTPOLL_H */
diff --git a/src/util/virfcp.h b/src/util/virfcp.h
index 16a6b2d42ebbdab1c7a6e322e9899760675e8990..6364f05ebcc25f01a3550774cf04088c2dbdec87 100644
--- a/src/util/virfcp.h
+++ b/src/util/virfcp.h
@@ -18,8 +18,7 @@
* .
*/
-#ifndef LIBVIRT_VIRFCP_H
-# define LIBVIRT_VIRFCP_H
+#pragma once
bool
virFCIsCapableRport(const char *rport);
@@ -28,5 +27,3 @@ int
virFCReadRportValue(const char *rport,
const char *entry,
char **result);
-
-#endif /* LIBVIRT_VIRFCP_H */
diff --git a/src/util/virfdstream.h b/src/util/virfdstream.h
index 093db303ff6822558efe45700068b341fd7c34d7..d7204a4dc36c9925114b84cf73456ff362a6a26a 100644
--- a/src/util/virfdstream.h
+++ b/src/util/virfdstream.h
@@ -19,10 +19,9 @@
*
*/
-#ifndef LIBVIRT_VIRFDSTREAM_H
-# define LIBVIRT_VIRFDSTREAM_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
/* internal callback, the generic one is used up by daemon stream driver */
/* the close callback is called with fdstream private data locked */
@@ -65,4 +64,3 @@ int virFDStreamSetInternalCloseCb(virStreamPtr st,
virFDStreamInternalCloseCb cb,
void *opaque,
virFDStreamInternalCloseCbFreeOpaque fcb);
-#endif /* LIBVIRT_VIRFDSTREAM_H */
diff --git a/src/util/virfilecache.h b/src/util/virfilecache.h
index 70c8a4bffe55954cea247ba51d3f1122622928ba..006a9717cbae7b5e11c3a630f9179f2bd006180e 100644
--- a/src/util/virfilecache.h
+++ b/src/util/virfilecache.h
@@ -19,13 +19,12 @@
*
*/
-#ifndef LIBVIRT_VIRFILECACHE_H
-# define LIBVIRT_VIRFILECACHE_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
-# include "virobject.h"
-# include "virhash.h"
+#include "virobject.h"
+#include "virhash.h"
typedef struct _virFileCache virFileCache;
typedef virFileCache *virFileCachePtr;
@@ -133,5 +132,3 @@ int
virFileCacheInsertData(virFileCachePtr cache,
const char *name,
void *data);
-
-#endif /* LIBVIRT_VIRFILECACHE_H */
diff --git a/src/util/virfirmware.h b/src/util/virfirmware.h
index 784e34cc65268e192df4afb1424164d3ccdbd23c..ed59f341026d89c81649961824938196e60458c4 100644
--- a/src/util/virfirmware.h
+++ b/src/util/virfirmware.h
@@ -18,10 +18,9 @@
* .
*/
-#ifndef LIBVIRT_VIRFIRMWARE_H
-# define LIBVIRT_VIRFIRMWARE_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
typedef struct _virFirmware virFirmware;
typedef virFirmware *virFirmwarePtr;
@@ -44,6 +43,3 @@ virFirmwareParseList(const char *list,
virFirmwarePtr **firmwares,
size_t *nfirmwares)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
-
-
-#endif /* LIBVIRT_VIRFIRMWARE_H */
diff --git a/src/util/virgettext.h b/src/util/virgettext.h
index fe5daa3fe2751d512b0caf68696147764e148a54..3142124bbeda4a3c67428d304bee16680a62b2c1 100644
--- a/src/util/virgettext.h
+++ b/src/util/virgettext.h
@@ -18,9 +18,6 @@
* .
*/
-#ifndef LIBVIRT_VIRGETTEXT_H
-# define LIBVIRT_VIRGETTEXT_H
+#pragma once
int virGettextInitialize(void);
-
-#endif /* LIBVIRT_VIRGETTEXT_H */
diff --git a/src/util/virgic.h b/src/util/virgic.h
index e54d7ec9d28440c859b27d2623103f7f7b1e79cb..6552ab53f84a772327de3ba5a572dd8ef1374492 100644
--- a/src/util/virgic.h
+++ b/src/util/virgic.h
@@ -18,11 +18,10 @@
* .
*/
-#ifndef LIBVIRT_VIRGIC_H
-# define LIBVIRT_VIRGIC_H
+#pragma once
-# include "virutil.h"
-# include "virenum.h"
+#include "virutil.h"
+#include "virenum.h"
typedef enum {
VIR_GIC_VERSION_NONE = 0,
@@ -46,5 +45,3 @@ struct _virGICCapability {
virGICVersion version;
virGICImplementation implementation;
};
-
-#endif /* LIBVIRT_VIRGIC_H */
diff --git a/src/util/virhook.h b/src/util/virhook.h
index fa188c89e3171831585ddb0c28f82ae4e8506625..f91cb87b1031d7f021ed3b93acf2c3fbda800beb 100644
--- a/src/util/virhook.h
+++ b/src/util/virhook.h
@@ -19,10 +19,9 @@
* .
*/
-#ifndef LIBVIRT_VIRHOOK_H
-# define LIBVIRT_VIRHOOK_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
typedef enum {
VIR_HOOK_DRIVER_DAEMON = 0, /* Daemon related events */
@@ -104,5 +103,3 @@ int virHookPresent(int driver);
int virHookCall(int driver, const char *id, int op, int sub_op,
const char *extra, const char *input, char **output);
-
-#endif /* LIBVIRT_VIRHOOK_H */
diff --git a/src/util/viridentity.h b/src/util/viridentity.h
index e385eda62256a33f920dfd99e5ae2ce789246446..0fde3207ca8534eea91e4ffa81899ac4da802b8c 100644
--- a/src/util/viridentity.h
+++ b/src/util/viridentity.h
@@ -19,10 +19,9 @@
*
*/
-#ifndef LIBVIRT_VIRIDENTITY_H
-# define LIBVIRT_VIRIDENTITY_H
+#pragma once
-# include "virobject.h"
+#include "virobject.h"
typedef struct _virIdentity virIdentity;
typedef virIdentity *virIdentityPtr;
@@ -103,6 +102,3 @@ int virIdentitySetX509DName(virIdentityPtr ident,
const char *dname);
int virIdentitySetSELinuxContext(virIdentityPtr ident,
const char *context);
-
-
-#endif /* LIBVIRT_VIRIDENTITY_H */
diff --git a/src/util/virinitctl.h b/src/util/virinitctl.h
index 14dda98b5b0969f871251bfca54ca4f3cfce2755..46b2935a39caf43c75c6a616896a0dfcb5eff2fe 100644
--- a/src/util/virinitctl.h
+++ b/src/util/virinitctl.h
@@ -18,8 +18,7 @@
* .
*/
-#ifndef LIBVIRT_VIRINITCTL_H
-# define LIBVIRT_VIRINITCTL_H
+#pragma once
typedef enum {
VIR_INITCTL_RUNLEVEL_POWEROFF = 0,
@@ -38,5 +37,3 @@ extern const char *virInitctlFifos[];
int virInitctlSetRunLevel(const char *fifo,
virInitctlRunLevel level);
-
-#endif /* LIBVIRT_VIRINITCTL_H */
diff --git a/src/util/viriptables.h b/src/util/viriptables.h
index e680407ec827513586c357600dfdce7b7c2e6f94..feea988acd169bd8e825bf655caf035639c53a9f 100644
--- a/src/util/viriptables.h
+++ b/src/util/viriptables.h
@@ -18,11 +18,10 @@
* .
*/
-#ifndef LIBVIRT_VIRIPTABLES_H
-# define LIBVIRT_VIRIPTABLES_H
+#pragma once
-# include "virsocketaddr.h"
-# include "virfirewall.h"
+#include "virsocketaddr.h"
+#include "virfirewall.h"
int iptablesSetupPrivateChains (virFirewallLayer layer);
@@ -148,5 +147,3 @@ void iptablesAddOutputFixUdpChecksum (virFirewallPtr fw,
void iptablesRemoveOutputFixUdpChecksum (virFirewallPtr fw,
const char *iface,
int port);
-
-#endif /* LIBVIRT_VIRIPTABLES_H */
diff --git a/src/util/viriscsi.h b/src/util/viriscsi.h
index acf9ab18eb791f033d095e181b939e0a80517703..6eddb504a25d103ebd22ad89f4b6dfaaeec4eda7 100644
--- a/src/util/viriscsi.h
+++ b/src/util/viriscsi.h
@@ -19,10 +19,9 @@
*
*/
-#ifndef LIBVIRT_VIRISCSI_H
-# define LIBVIRT_VIRISCSI_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
char *
virISCSIGetSession(const char *devpath,
@@ -68,5 +67,3 @@ virISCSINodeUpdate(const char *portal,
const char *value)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
-
-#endif /* LIBVIRT_VIRISCSI_H */
diff --git a/src/util/virjson.h b/src/util/virjson.h
index fa8329af26690a4ad326fc37b5fc96c0f426399e..41404a9a3efc281909b94c52efed0942dd2d123e 100644
--- a/src/util/virjson.h
+++ b/src/util/virjson.h
@@ -20,15 +20,14 @@
*
*/
-#ifndef LIBVIRT_VIRJSON_H
-# define LIBVIRT_VIRJSON_H
+#pragma once
-# include "internal.h"
-# include "virbitmap.h"
-# include "virbuffer.h"
-# include "virautoclean.h"
+#include "internal.h"
+#include "virbitmap.h"
+#include "virbuffer.h"
+#include "virautoclean.h"
-# include
+#include
typedef enum {
@@ -164,5 +163,3 @@ char *virJSONStringReformat(const char *jsonstr, bool pretty);
virJSONValuePtr virJSONValueObjectDeflatten(virJSONValuePtr json);
VIR_DEFINE_AUTOPTR_FUNC(virJSONValue, virJSONValueFree);
-
-#endif /* LIBVIRT_VIRJSON_H */
diff --git a/src/util/virkeycode.h b/src/util/virkeycode.h
index 9e94d6f61e4888e38de0c6b7fc8c5bf599e52bea..b8d167ff142b3d39d68fa646cca7e97275cb50db 100644
--- a/src/util/virkeycode.h
+++ b/src/util/virkeycode.h
@@ -19,16 +19,13 @@
*
*/
-#ifndef LIBVIRT_VIRKEYCODE_H
-# define LIBVIRT_VIRKEYCODE_H
+#pragma once
-# include "virutil.h"
-# include "virenum.h"
+#include "virutil.h"
+#include "virenum.h"
VIR_ENUM_DECL(virKeycodeSet);
int virKeycodeValueFromString(virKeycodeSet codeset, const char *keyname);
int virKeycodeValueTranslate(virKeycodeSet from_codeset,
virKeycodeSet to_offset,
int key_value);
-
-#endif /* LIBVIRT_VIRKEYCODE_H */
diff --git a/src/util/virkeyfile.h b/src/util/virkeyfile.h
index ad82bd02d50aa151847ce7b0883218cc8e4d109a..4cae4331fcea85b206b235bfe069ac3625e4eedc 100644
--- a/src/util/virkeyfile.h
+++ b/src/util/virkeyfile.h
@@ -18,10 +18,9 @@
* .
*/
-#ifndef LIBVIRT_VIRKEYFILE_H
-# define LIBVIRT_VIRKEYFILE_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
/**
* virKeyFilePtr:
@@ -57,5 +56,3 @@ const char *virKeyFileGetValueString(virKeyFilePtr conf,
const char *groupname,
const char *valuename)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
-
-#endif /* LIBVIRT_VIRKEYFILE_H */
diff --git a/src/util/virkmod.h b/src/util/virkmod.h
index 059af4fd5f00833135173c5f76d6fbcb66e6a5c5..f05cf83cf681886e69ef011b9ca9f39a24a4065e 100644
--- a/src/util/virkmod.h
+++ b/src/util/virkmod.h
@@ -19,10 +19,9 @@
*
*/
-#ifndef LIBVIRT_VIRKMOD_H
-# define LIBVIRT_VIRKMOD_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
char *virKModConfig(void);
char *virKModLoad(const char *, bool)
@@ -31,4 +30,3 @@ char *virKModUnload(const char *)
ATTRIBUTE_NONNULL(1);
bool virKModIsBlacklisted(const char *)
ATTRIBUTE_NONNULL(1);
-#endif /* LIBVIRT_VIRKMOD_H */
diff --git a/src/util/virlease.h b/src/util/virlease.h
index 9aa8095f834acdbdcc0f5edcbdfb486446eeb72c..98a3a5854d3d90ce04316d250ae101cafaa16f93 100644
--- a/src/util/virlease.h
+++ b/src/util/virlease.h
@@ -20,10 +20,9 @@
*
*/
-#ifndef LIBVIRT_VIRLEASE_H
-# define LIBVIRT_VIRLEASE_H
+#pragma once
-# include "virjson.h"
+#include "virjson.h"
int virLeaseReadCustomLeaseFile(virJSONValuePtr leases_array_new,
const char *custom_lease_file,
@@ -41,5 +40,3 @@ int virLeaseNew(virJSONValuePtr *lease_ret,
const char *hostname,
const char *iaid,
const char *server_duid);
-
-#endif /* LIBVIRT_VIRLEASE_H */
diff --git a/src/util/virlockspace.h b/src/util/virlockspace.h
index 8e6b61d486e4eb6cab260052ac4968ed5a4ccf0c..7f4833c35c0bb30a61288a927c85e23f4530ef4f 100644
--- a/src/util/virlockspace.h
+++ b/src/util/virlockspace.h
@@ -19,11 +19,10 @@
*
*/
-#ifndef LIBVIRT_VIRLOCKSPACE_H
-# define LIBVIRT_VIRLOCKSPACE_H
+#pragma once
-# include "internal.h"
-# include "virjson.h"
+#include "internal.h"
+#include "virjson.h"
typedef struct _virLockSpace virLockSpace;
typedef virLockSpace *virLockSpacePtr;
@@ -58,5 +57,3 @@ int virLockSpaceReleaseResource(virLockSpacePtr lockspace,
int virLockSpaceReleaseResourcesForOwner(virLockSpacePtr lockspace,
pid_t owner);
-
-#endif /* LIBVIRT_VIRLOCKSPACE_H */
diff --git a/src/util/virmdev.h b/src/util/virmdev.h
index 784cee5bcec06e278f61878aa9aa29261ea7e1e1..fb125e70564256a10a94110aee3508884b59ad6f 100644
--- a/src/util/virmdev.h
+++ b/src/util/virmdev.h
@@ -16,14 +16,13 @@
* .
*/
-#ifndef LIBVIRT_VIRMDEV_H
-# define LIBVIRT_VIRMDEV_H
+#pragma once
-# include "internal.h"
-# include "virobject.h"
-# include "virutil.h"
-# include "virautoclean.h"
-# include "virenum.h"
+#include "internal.h"
+#include "virobject.h"
+#include "virutil.h"
+#include "virautoclean.h"
+#include "virenum.h"
typedef enum {
VIR_MDEV_MODEL_TYPE_VFIO_PCI = 0,
@@ -140,5 +139,3 @@ virMediatedDeviceTypeReadAttrs(const char *sysfspath,
VIR_DEFINE_AUTOPTR_FUNC(virMediatedDevice, virMediatedDeviceFree);
VIR_DEFINE_AUTOPTR_FUNC(virMediatedDeviceType, virMediatedDeviceTypeFree);
-
-#endif /* LIBVIRT_VIRMDEV_H */
diff --git a/src/util/virmodule.h b/src/util/virmodule.h
index de9f8ec07e5157aec01d561f90b5796b781d276a..ca59d837d65c107a8739b31384dc2deb40077640 100644
--- a/src/util/virmodule.h
+++ b/src/util/virmodule.h
@@ -19,11 +19,8 @@
*
*/
-#ifndef LIBVIRT_VIRMODULE_H
-# define LIBVIRT_VIRMODULE_H
+#pragma once
int virModuleLoad(const char *path,
const char *regfunc,
bool required);
-
-#endif /* LIBVIRT_VIRMODULE_H */
diff --git a/src/util/virnodesuspend.h b/src/util/virnodesuspend.h
index c3e600ff8871c7454eaac04a84f89fb4a10a8bc2..f767961bff96a1decacaef3a4f636d24c05c90b9 100644
--- a/src/util/virnodesuspend.h
+++ b/src/util/virnodesuspend.h
@@ -19,15 +19,12 @@
*
*/
-#ifndef LIBVIRT_VIRNODESUSPEND_H
-# define LIBVIRT_VIRNODESUSPEND_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
int virNodeSuspend(unsigned int target,
unsigned long long duration,
unsigned int flags);
int virNodeSuspendGetTargetMask(unsigned int *bitmask);
-
-#endif /* LIBVIRT_VIRNODESUSPEND_H */
diff --git a/src/util/virnuma.h b/src/util/virnuma.h
index 8e95011dfa0c7da9dc598aaa3ff282667656a6d9..3afccdf08fba98e5c6b6970ae4d3840527be34a6 100644
--- a/src/util/virnuma.h
+++ b/src/util/virnuma.h
@@ -19,12 +19,11 @@
*
*/
-#ifndef LIBVIRT_VIRNUMA_H
-# define LIBVIRT_VIRNUMA_H
+#pragma once
-# include "internal.h"
-# include "virbitmap.h"
-# include "virutil.h"
+#include "internal.h"
+#include "virbitmap.h"
+#include "virutil.h"
char *virNumaGetAutoPlacementAdvice(unsigned short vcpus,
@@ -66,4 +65,3 @@ int virNumaSetPagePoolSize(int node,
unsigned int page_size,
unsigned long long page_count,
bool add);
-#endif /* LIBVIRT_VIRNUMA_H */
diff --git a/src/util/virpci.h b/src/util/virpci.h
index 664e141039d6d5502ae00a7117d93ccaea6eae7b..457be3c929e5846c0b4476b420437fdcd02f4590 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -18,15 +18,14 @@
* .
*/
-#ifndef LIBVIRT_VIRPCI_H
-# define LIBVIRT_VIRPCI_H
+#pragma once
-# include "internal.h"
-# include "virmdev.h"
-# include "virobject.h"
-# include "virutil.h"
-# include "virautoclean.h"
-# include "virenum.h"
+#include "internal.h"
+#include "virmdev.h"
+#include "virobject.h"
+#include "virutil.h"
+#include "virautoclean.h"
+#include "virenum.h"
typedef struct _virPCIDevice virPCIDevice;
typedef virPCIDevice *virPCIDevicePtr;
@@ -35,8 +34,8 @@ typedef virPCIDeviceAddress *virPCIDeviceAddressPtr;
typedef struct _virPCIDeviceList virPCIDeviceList;
typedef virPCIDeviceList *virPCIDeviceListPtr;
-# define VIR_DOMAIN_DEVICE_ZPCI_MAX_UID UINT16_MAX
-# define VIR_DOMAIN_DEVICE_ZPCI_MAX_FID UINT32_MAX
+#define VIR_DOMAIN_DEVICE_ZPCI_MAX_UID UINT16_MAX
+#define VIR_DOMAIN_DEVICE_ZPCI_MAX_FID UINT32_MAX
typedef struct _virZPCIDeviceAddress virZPCIDeviceAddress;
typedef virZPCIDeviceAddress *virZPCIDeviceAddressPtr;
@@ -275,5 +274,3 @@ void virPCIDeviceAddressFree(virPCIDeviceAddressPtr address);
VIR_DEFINE_AUTOPTR_FUNC(virPCIDevice, virPCIDeviceFree);
VIR_DEFINE_AUTOPTR_FUNC(virPCIDeviceAddress, virPCIDeviceAddressFree);
VIR_DEFINE_AUTOPTR_FUNC(virPCIEDeviceInfo, virPCIEDeviceInfoFree);
-
-#endif /* LIBVIRT_VIRPCI_H */
diff --git a/src/util/virperf.h b/src/util/virperf.h
index e68baa527d7a83c9e52f85e7c692ade6be610c0f..27d04b3ea43781f53ecbe5aa21560f55d6a93b21 100644
--- a/src/util/virperf.h
+++ b/src/util/virperf.h
@@ -16,12 +16,11 @@
* .
*/
-#ifndef LIBVIRT_VIRPERF_H
-# define LIBVIRT_VIRPERF_H
+#pragma once
-# include "virutil.h"
-# include "virautoclean.h"
-# include "virenum.h"
+#include "virutil.h"
+#include "virautoclean.h"
+#include "virenum.h"
/* Some Intel processor families introduced some RDT (Resource Director
* Technology) features to monitor or control shared resource based on
@@ -84,5 +83,3 @@ int virPerfReadEvent(virPerfPtr perf,
uint64_t *value);
VIR_DEFINE_AUTOPTR_FUNC(virPerf, virPerfFree);
-
-#endif /* LIBVIRT_VIRPERF_H */
diff --git a/src/util/virpidfile.h b/src/util/virpidfile.h
index 6ff55e7b02727cad79b8e631e33ef281f5945038..a42b82ff1d64f6887c14e914dff94676d23023f8 100644
--- a/src/util/virpidfile.h
+++ b/src/util/virpidfile.h
@@ -21,11 +21,10 @@
*
*/
-#ifndef LIBVIRT_VIRPIDFILE_H
-# define LIBVIRT_VIRPIDFILE_H
+#pragma once
-# include
-# include "internal.h"
+#include
+#include "internal.h"
char *virPidFileBuildPath(const char *dir,
const char *name);
@@ -75,5 +74,3 @@ int virPidFileConstructPath(bool privileged,
char **pidfile);
int virPidFileForceCleanupPath(const char *path) ATTRIBUTE_NONNULL(1);
-
-#endif /* LIBVIRT_VIRPIDFILE_H */
diff --git a/src/util/virpolkit.h b/src/util/virpolkit.h
index f23453401542a4f7f733e2ee0020667d0b67d610..8247be33d0aeb804a3f1def0000fc58f2d0faab1 100644
--- a/src/util/virpolkit.h
+++ b/src/util/virpolkit.h
@@ -19,13 +19,12 @@
*
*/
-#ifndef LIBVIRT_VIRPOLKIT_H
-# define LIBVIRT_VIRPOLKIT_H
+#pragma once
-# include "internal.h"
-# include "vircommand.h"
+#include "internal.h"
+#include "vircommand.h"
-# define PKTTYAGENT "/usr/bin/pkttyagent"
+#define PKTTYAGENT "/usr/bin/pkttyagent"
int virPolkitCheckAuth(const char *actionid,
pid_t pid,
@@ -39,5 +38,3 @@ typedef virPolkitAgent *virPolkitAgentPtr;
void virPolkitAgentDestroy(virPolkitAgentPtr cmd);
virPolkitAgentPtr virPolkitAgentCreate(void);
-
-#endif /* LIBVIRT_VIRPOLKIT_H */
diff --git a/src/util/virportallocator.h b/src/util/virportallocator.h
index 3144b7bf98f7c5851c41b3f94953f4bf4d12f49b..e86fd0e62b845e63c7da5dd1ca3dbf2ece450fc3 100644
--- a/src/util/virportallocator.h
+++ b/src/util/virportallocator.h
@@ -19,11 +19,10 @@
*
*/
-#ifndef LIBVIRT_VIRPORTALLOCATOR_H
-# define LIBVIRT_VIRPORTALLOCATOR_H
+#pragma once
-# include "internal.h"
-# include "virobject.h"
+#include "internal.h"
+#include "virobject.h"
typedef struct _virPortAllocatorRange virPortAllocatorRange;
typedef virPortAllocatorRange *virPortAllocatorRangePtr;
@@ -41,5 +40,3 @@ int virPortAllocatorAcquire(const virPortAllocatorRange *range,
int virPortAllocatorRelease(unsigned short port);
int virPortAllocatorSetUsed(unsigned short port);
-
-#endif /* LIBVIRT_VIRPORTALLOCATOR_H */
diff --git a/src/util/virprocess.h b/src/util/virprocess.h
index 8e5b0c2127adebe9f76f4f6b69d5d24b4ea926e8..d7d191ec75914ab1b066fe5cebaabf27733afbb7 100644
--- a/src/util/virprocess.h
+++ b/src/util/virprocess.h
@@ -19,15 +19,14 @@
*
*/
-#ifndef LIBVIRT_VIRPROCESS_H
-# define LIBVIRT_VIRPROCESS_H
+#pragma once
-# include
+#include
-# include "internal.h"
-# include "virbitmap.h"
-# include "virutil.h"
-# include "virenum.h"
+#include "internal.h"
+#include "virbitmap.h"
+#include "virutil.h"
+#include "virenum.h"
typedef enum {
VIR_PROC_POLICY_NONE = 0,
@@ -125,5 +124,3 @@ typedef enum {
} virProcessNamespaceFlags;
int virProcessNamespaceAvailable(unsigned int ns);
-
-#endif /* LIBVIRT_VIRPROCESS_H */
diff --git a/src/util/virqemu.h b/src/util/virqemu.h
index dc5497b6fde1f343e1fbaf95a9ab34f9ff2a3617..227325e80e7b7078b9e8228a5a3919948cb2c172 100644
--- a/src/util/virqemu.h
+++ b/src/util/virqemu.h
@@ -20,13 +20,12 @@
*
*/
-#ifndef LIBVIRT_VIRQEMU_H
-# define LIBVIRT_VIRQEMU_H
+#pragma once
-# include "internal.h"
-# include "virbuffer.h"
-# include "virjson.h"
-# include "virstorageencryption.h"
+#include "internal.h"
+#include "virbuffer.h"
+#include "virjson.h"
+#include "virstorageencryption.h"
typedef int (*virQEMUBuildCommandLineJSONArrayFormatFunc)(const char *key,
virJSONValuePtr array,
@@ -52,5 +51,3 @@ void virQEMUBuildQemuImgKeySecretOpts(virBufferPtr buf,
virStorageEncryptionInfoDefPtr enc,
const char *alias)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
-
-#endif /* LIBVIRT_VIRQEMU_H */
diff --git a/src/util/virrandom.h b/src/util/virrandom.h
index 55cd0971ae3a77ec7e8027516c1b86d8351fda4c..c33932e8b3040d1095ec736f46419a8be8b36348 100644
--- a/src/util/virrandom.h
+++ b/src/util/virrandom.h
@@ -16,10 +16,9 @@
* .
*/
-#ifndef LIBVIRT_VIRRANDOM_H
-# define LIBVIRT_VIRRANDOM_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
uint64_t virRandomBits(int nbits) ATTRIBUTE_NOINLINE;
double virRandom(void);
@@ -27,5 +26,3 @@ uint32_t virRandomInt(uint32_t max);
int virRandomBytes(unsigned char *buf, size_t buflen)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK ATTRIBUTE_NOINLINE;
int virRandomGenerateWWN(char **wwn, const char *virt_type) ATTRIBUTE_NOINLINE;
-
-#endif /* LIBVIRT_VIRRANDOM_H */
diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h
index abdeb594eeb2358be65151a066b6bfd913cd47eb..e92f8e0ece6e4340e04df49022fb78d90357052b 100644
--- a/src/util/virresctrl.h
+++ b/src/util/virresctrl.h
@@ -16,14 +16,13 @@
* .
*/
-#ifndef LIBVIRT_VIRRESCTRL_H
-# define LIBVIRT_VIRRESCTRL_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
-# include "virbitmap.h"
-# include "virutil.h"
-# include "virenum.h"
+#include "virbitmap.h"
+#include "virutil.h"
+#include "virenum.h"
typedef enum {
VIR_CACHE_TYPE_BOTH,
@@ -235,4 +234,3 @@ virResctrlMonitorGetCacheOccupancy(virResctrlMonitorPtr monitor,
void
virResctrlMonitorFreeStats(virResctrlMonitorStatsPtr *stats,
size_t nstats);
-#endif /* LIBVIRT_VIRRESCTRL_H */
diff --git a/src/util/virresctrlpriv.h b/src/util/virresctrlpriv.h
index 5f04c0c12ea86c68b85256c4ab8f64f2f5f1164e..8aba32ab37e319e553133be08136b414fcb84bf9 100644
--- a/src/util/virresctrlpriv.h
+++ b/src/util/virresctrlpriv.h
@@ -20,12 +20,9 @@
# error "virresctrlpriv.h may only be included by virresctrl.c or test suites"
#endif /* LIBVIRT_VIRRESCTRLPRIV_H_ALLOW */
-#ifndef LIBVIRT_VIRRESCTRLPRIV_H
-# define LIBVIRT_VIRRESCTRLPRIV_H
+#pragma once
-# include "virresctrl.h"
+#include "virresctrl.h"
virResctrlAllocPtr
virResctrlAllocGetUnused(virResctrlInfoPtr resctrl);
-
-#endif /* LIBVIRT_VIRRESCTRLPRIV_H */
diff --git a/src/util/virrotatingfile.h b/src/util/virrotatingfile.h
index 1dc48fb947d23f009434aee3f962c343b53c4fba..71fbe2c38c7bc0a6c58b0ccb1a9ea2e31857019a 100644
--- a/src/util/virrotatingfile.h
+++ b/src/util/virrotatingfile.h
@@ -19,10 +19,9 @@
*
*/
-#ifndef LIBVIRT_VIRROTATINGFILE_H
-# define LIBVIRT_VIRROTATINGFILE_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
typedef struct virRotatingFileWriter virRotatingFileWriter;
typedef virRotatingFileWriter *virRotatingFileWriterPtr;
@@ -58,5 +57,3 @@ ssize_t virRotatingFileReaderConsume(virRotatingFileReaderPtr file,
void virRotatingFileWriterFree(virRotatingFileWriterPtr file);
void virRotatingFileReaderFree(virRotatingFileReaderPtr file);
-
-#endif /* LIBVIRT_VIRROTATINGFILE_H */
diff --git a/src/util/virseclabel.h b/src/util/virseclabel.h
index 4480def79e21d093082857f12b7cbea8883ca4e2..4395a73240f407e9630a2e5c8ecbf762a9036cd9 100644
--- a/src/util/virseclabel.h
+++ b/src/util/virseclabel.h
@@ -19,8 +19,7 @@
* .
*/
-#ifndef LIBVIRT_VIRSECLABEL_H
-# define LIBVIRT_VIRSECLABEL_H
+#pragma once
typedef enum {
VIR_DOMAIN_SECLABEL_DEFAULT,
@@ -67,5 +66,3 @@ virSecurityDeviceLabelDefCopy(const virSecurityDeviceLabelDef *src)
void virSecurityLabelDefFree(virSecurityLabelDefPtr def);
void virSecurityDeviceLabelDefFree(virSecurityDeviceLabelDefPtr def);
-
-#endif /* LIBVIRT_VIRSECLABEL_H */
diff --git a/src/util/virsecret.h b/src/util/virsecret.h
index aaeb204f7c0cfa9777aa70a3eda99e955424ce41..8bc8a24e0f0bd26c34fc9e347fa7f9282f8c0d2f 100644
--- a/src/util/virsecret.h
+++ b/src/util/virsecret.h
@@ -19,14 +19,13 @@
*
*/
-#ifndef LIBVIRT_VIRSECRET_H
-# define LIBVIRT_VIRSECRET_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
-# include "virutil.h"
-# include "virxml.h"
-# include "virenum.h"
+#include "virutil.h"
+#include "virxml.h"
+#include "virenum.h"
VIR_ENUM_DECL(virSecretUsage);
@@ -57,4 +56,3 @@ int virSecretLookupParseSecret(xmlNodePtr secretnode,
void virSecretLookupFormatSecret(virBufferPtr buf,
const char *secrettype,
virSecretLookupTypeDefPtr def);
-#endif /* LIBVIRT_VIRSECRET_H */
diff --git a/src/util/virsexpr.h b/src/util/virsexpr.h
index 4469207a75de2e0b22522d9548476c957ec5c282..d140659722a0adb5166447e292457baf8c7f74f3 100644
--- a/src/util/virsexpr.h
+++ b/src/util/virsexpr.h
@@ -20,11 +20,10 @@
*
*/
-#ifndef LIBVIRT_VIRSEXPR_H
-# define LIBVIRT_VIRSEXPR_H
+#pragma once
-# include "internal.h"
-# include "virbuffer.h"
+#include "internal.h"
+#include "virbuffer.h"
enum sexpr_type {
SEXPR_NIL,
@@ -65,5 +64,3 @@ int sexpr_has(const struct sexpr *sexpr, const char *node);
int sexpr_int(const struct sexpr *sexpr, const char *name);
double sexpr_float(const struct sexpr *sexpr, const char *name);
uint64_t sexpr_u64(const struct sexpr *sexpr, const char *name);
-
-#endif /* LIBVIRT_VIRSEXPR_H */
diff --git a/src/util/virsystemd.h b/src/util/virsystemd.h
index 7d9c0ebd624283d97a6d0dcdaf9c38ea3d88fe39..db4ecbff603d571c93b7aaa2e73dc04f34e838c2 100644
--- a/src/util/virsystemd.h
+++ b/src/util/virsystemd.h
@@ -19,10 +19,9 @@
*
*/
-#ifndef LIBVIRT_VIRSYSTEMD_H
-# define LIBVIRT_VIRSYSTEMD_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
char *virSystemdMakeScopeName(const char *name,
const char *drivername,
@@ -50,5 +49,3 @@ int virSystemdCanHibernate(bool *result);
int virSystemdCanHybridSleep(bool *result);
char *virSystemdGetMachineNameByPID(pid_t pid);
-
-#endif /* LIBVIRT_VIRSYSTEMD_H */
diff --git a/src/util/virsystemdpriv.h b/src/util/virsystemdpriv.h
index be96f698f31c7640ae18cfcc5ce27e49bacf1f60..a49c91e649a82dcd55fb3c60e6fa3c4fe2db4afe 100644
--- a/src/util/virsystemdpriv.h
+++ b/src/util/virsystemdpriv.h
@@ -23,11 +23,8 @@
# error "virsystemdpriv.h may only be included by virsystemd.c or test suites"
#endif /* LIBVIRT_VIRSYSTEMDPRIV_H_ALLOW */
-#ifndef LIBVIRT_VIRSYSTEMDPRIV_H
-# define LIBVIRT_VIRSYSTEMDPRIV_H
+#pragma once
-# include "virsystemd.h"
+#include "virsystemd.h"
void virSystemdHasMachinedResetCachedValue(void);
-
-#endif /* LIBVIRT_VIRSYSTEMDPRIV_H */
diff --git a/src/util/virtime.h b/src/util/virtime.h
index 01f6b0c7fa6c2c1f4afd084c1ab7025e41796f7c..b8ea38e29103f5a1257e6c5e747aceae380d07d8 100644
--- a/src/util/virtime.h
+++ b/src/util/virtime.h
@@ -18,12 +18,11 @@
* .
*/
-#ifndef LIBVIRT_VIRTIME_H
-# define LIBVIRT_VIRTIME_H
+#pragma once
-# include
+#include
-# include "internal.h"
+#include "internal.h"
/* The format string we intend to use is:
*
@@ -31,7 +30,7 @@
* %4d-%02d-%02d %02d:%02d:%02d.%03d+0000
*
*/
-# define VIR_TIME_STRING_BUFLEN \
+#define VIR_TIME_STRING_BUFLEN \
(4 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1 + 3 + 5 + 1)
/* Yr Mon Day Hour Min Sec Ms TZ NULL */
@@ -72,5 +71,3 @@ int virTimeBackOffStart(virTimeBackOffVar *var,
unsigned long long first, unsigned long long timeout);
bool virTimeBackOffWait(virTimeBackOffVar *var);
-
-#endif /* LIBVIRT_VIRTIME_H */
diff --git a/src/util/virtpm.h b/src/util/virtpm.h
index 796b9c088c6ebd7b4b1c7140f882b06a5ba02391..4408bdb2175af48ccc7bd1b05812edf9f094eb44 100644
--- a/src/util/virtpm.h
+++ b/src/util/virtpm.h
@@ -18,9 +18,6 @@
* .
*/
-#ifndef LIBVIRT_VIRTPM_H
-# define LIBVIRT_VIRTPM_H
+#pragma once
char *virTPMCreateCancelPath(const char *devpath) ATTRIBUTE_NOINLINE;
-
-#endif /* LIBVIRT_VIRTPM_H */
diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h
index 112f2a2af9d38b9e7937f4d2bf5ffd3cd245ddb6..ce4e75b3893be59d686edacf5460e533893e710a 100644
--- a/src/util/virtypedparam.h
+++ b/src/util/virtypedparam.h
@@ -19,12 +19,11 @@
*
*/
-#ifndef LIBVIRT_VIRTYPEDPARAM_H
-# define LIBVIRT_VIRTYPEDPARAM_H
+#pragma once
-# include "internal.h"
-# include "virutil.h"
-# include "virenum.h"
+#include "internal.h"
+#include "virutil.h"
+#include "virenum.h"
/**
* VIR_TYPED_PARAM_MULTIPLE:
@@ -32,7 +31,7 @@
* Flag indicating that the params has multiple occurrences of the parameter.
* Only used as a flag for @type argument of the virTypedParamsValidate.
*/
-# define VIR_TYPED_PARAM_MULTIPLE (1U << 31)
+#define VIR_TYPED_PARAM_MULTIPLE (1U << 31)
verify(!(VIR_TYPED_PARAM_LAST & VIR_TYPED_PARAM_MULTIPLE));
@@ -120,7 +119,7 @@ int virTypedParamsSerialize(virTypedParameterPtr params,
VIR_ENUM_DECL(virTypedParameter);
-# define VIR_TYPED_PARAMS_DEBUG(params, nparams) \
+#define VIR_TYPED_PARAMS_DEBUG(params, nparams) \
do { \
int _i; \
if (!params) \
@@ -134,5 +133,3 @@ VIR_ENUM_DECL(virTypedParameter);
VIR_FREE(_value); \
} \
} while (0)
-
-#endif /* LIBVIRT_VIRTYPEDPARAM_H */
diff --git a/src/util/viruri.h b/src/util/viruri.h
index f5b472860e1119961459466152afc53bdc75665a..e988582bbeea246717cb967bc4aca85f4a4caf74 100644
--- a/src/util/viruri.h
+++ b/src/util/viruri.h
@@ -18,14 +18,13 @@
* .
*/
-#ifndef LIBVIRT_VIRURI_H
-# define LIBVIRT_VIRURI_H
+#pragma once
-# include
+#include
-# include "internal.h"
-# include "virconf.h"
-# include "virautoclean.h"
+#include "internal.h"
+#include "virconf.h"
+#include "virautoclean.h"
typedef struct _virURI virURI;
typedef virURI *virURIPtr;
@@ -64,6 +63,4 @@ void virURIFree(virURIPtr uri);
VIR_DEFINE_AUTOPTR_FUNC(virURI, virURIFree);
int virURIResolveAlias(virConfPtr conf, const char *alias, char **uri);
-# define VIR_URI_SERVER(uri) ((uri) && (uri)->server ? (uri)->server : "localhost")
-
-#endif /* LIBVIRT_VIRURI_H */
+#define VIR_URI_SERVER(uri) ((uri) && (uri)->server ? (uri)->server : "localhost")
diff --git a/src/util/virusb.h b/src/util/virusb.h
index 6d61a2555a2252da5c8976cc1537c7ea1d66fc88..c95514ed3d0537ff1bde46ed1a77941db45a359d 100644
--- a/src/util/virusb.h
+++ b/src/util/virusb.h
@@ -18,14 +18,13 @@
* .
*/
-#ifndef LIBVIRT_VIRUSB_H
-# define LIBVIRT_VIRUSB_H
+#pragma once
-# include "internal.h"
-# include "virobject.h"
-# include "virautoclean.h"
+#include "internal.h"
+#include "virobject.h"
+#include "virautoclean.h"
-# define USB_DEVFS "/dev/bus/usb/"
+#define USB_DEVFS "/dev/bus/usb/"
typedef struct _virUSBDevice virUSBDevice;
typedef virUSBDevice *virUSBDevicePtr;
@@ -97,5 +96,3 @@ virUSBDevicePtr virUSBDeviceListFind(virUSBDeviceListPtr list,
virUSBDevicePtr dev);
VIR_DEFINE_AUTOPTR_FUNC(virUSBDevice, virUSBDeviceFree);
-
-#endif /* LIBVIRT_VIRUSB_H */
diff --git a/src/util/virutil.h b/src/util/virutil.h
index ded9b039e50366476d8a5366f4aab5018af3c754..67a21c86bd6991b228ca8096ba5a404315870354 100644
--- a/src/util/virutil.h
+++ b/src/util/virutil.h
@@ -20,19 +20,18 @@
* .
*/
-#ifndef LIBVIRT_VIRUTIL_H
-# define LIBVIRT_VIRUTIL_H
+#pragma once
-# include "internal.h"
-# include
-# include
+#include "internal.h"
+#include
+#include
-# ifndef MIN
-# define MIN(a, b) ((a) < (b) ? (a) : (b))
-# endif
-# ifndef MAX
-# define MAX(a, b) ((a) > (b) ? (a) : (b))
-# endif
+#ifndef MIN
+# define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef MAX
+# define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
int virSetBlocking(int fd, bool blocking) ATTRIBUTE_RETURN_CHECK;
@@ -69,28 +68,28 @@ int virDiskNameToIndex(const char* str);
char *virIndexToDiskName(int idx, const char *prefix);
/* No-op workarounds for functionality missing in mingw. */
-# ifndef HAVE_GETUID
+#ifndef HAVE_GETUID
static inline int getuid(void)
{ return 0; }
-# endif
+#endif
-# ifndef HAVE_GETEUID
+#ifndef HAVE_GETEUID
static inline int geteuid(void)
{ return 0; }
-# endif
+#endif
-# ifndef HAVE_GETGID
+#ifndef HAVE_GETGID
static inline int getgid(void)
{ return 0; }
-# endif
+#endif
-# ifndef HAVE_GETEGID
+#ifndef HAVE_GETEGID
static inline int getegid(void)
{ return 0; }
-# endif
+#endif
-# ifdef FUNC_PTHREAD_SIGMASK_BROKEN
-# undef pthread_sigmask
+#ifdef FUNC_PTHREAD_SIGMASK_BROKEN
+# undef pthread_sigmask
static inline int pthread_sigmask(int how,
const void *set,
void *old)
@@ -100,7 +99,7 @@ static inline int pthread_sigmask(int how,
(void) old;
return 0;
}
-# endif
+#endif
char *virGetHostname(void);
char *virGetHostnameQuiet(void);
@@ -172,7 +171,5 @@ char *virHostGetDRMRenderNode(void) ATTRIBUTE_NOINLINE;
* This macro assigns @lvalue to @rvalue and evaluates as true if the value of
* @rvalue did not fit into the @lvalue.
*/
-# define VIR_ASSIGN_IS_OVERFLOW(lvalue, rvalue) \
+#define VIR_ASSIGN_IS_OVERFLOW(lvalue, rvalue) \
(((lvalue) = (rvalue)) != (rvalue))
-
-#endif /* LIBVIRT_VIRUTIL_H */
diff --git a/src/util/viruuid.h b/src/util/viruuid.h
index 70223b3bb2a47a65ad484f196ded18dddaabe8ed..b709c182ff9a341bb0e1d2eec881f91a7f02cb9d 100644
--- a/src/util/viruuid.h
+++ b/src/util/viruuid.h
@@ -18,10 +18,9 @@
* .
*/
-#ifndef LIBVIRT_VIRUUID_H
-# define LIBVIRT_VIRUUID_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
/**
@@ -29,7 +28,7 @@
* @conn: connection
* @uuid: possibly null UUID array
*/
-# define VIR_UUID_DEBUG(conn, uuid) \
+#define VIR_UUID_DEBUG(conn, uuid) \
do { \
if (uuid) { \
char _uuidstr[VIR_UUID_STRING_BUFLEN]; \
@@ -54,5 +53,3 @@ int virUUIDParse(const char *uuidstr,
const char *virUUIDFormat(const unsigned char *uuid,
char *uuidstr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-
-#endif /* LIBVIRT_VIRUUID_H */
diff --git a/src/util/virvhba.h b/src/util/virvhba.h
index 4d15833e85762a517405ada464aa8527ab7dd573..1aecbf2b001fd6d6fd528acea7afd416e3e0a35f 100644
--- a/src/util/virvhba.h
+++ b/src/util/virvhba.h
@@ -16,10 +16,9 @@
* .
*/
-#ifndef LIBVIRT_VIRVHBA_H
-# define LIBVIRT_VIRVHBA_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
enum {
VPORT_CREATE,
@@ -58,5 +57,3 @@ char *
virVHBAGetHostByFabricWWN(const char *sysfs_prefix,
const char *fabric_wwn)
ATTRIBUTE_NONNULL(2);
-
-#endif /* LIBVIRT_VIRVHBA_H */
diff --git a/src/util/virvsock.h b/src/util/virvsock.h
index 268e1219164d6e110cc698f285fe4b83ee762089..d6ba2faabf9c33860fe8ff1d65b32c36689cd776 100644
--- a/src/util/virvsock.h
+++ b/src/util/virvsock.h
@@ -16,8 +16,7 @@
* .
*/
-#ifndef LIBVIRT_VIRVSOCK_H
-# define LIBVIRT_VIRVSOCK_H
+#pragma once
int
virVsockSetGuestCid(int fd,
@@ -26,4 +25,3 @@ virVsockSetGuestCid(int fd,
int
virVsockAcquireGuestCid(int fd,
unsigned int *guest_cid);
-#endif /* LIBVIRT_VIRVSOCK_H */
diff --git a/src/util/virxdrdefs.h b/src/util/virxdrdefs.h
index 794606638d19bc39e07977e3093292dc16b894e4..264d02e7cdd68d7cced7621788ab3da3b42d9319 100644
--- a/src/util/virxdrdefs.h
+++ b/src/util/virxdrdefs.h
@@ -18,26 +18,23 @@
* .
*/
-#ifndef LIBVIRT_VIRXDRDEFS_H
-# define LIBVIRT_VIRXDRDEFS_H
+#pragma once
/* cygwin's xdr implementation defines xdr_u_int64_t instead of xdr_uint64_t
* and lacks IXDR_PUT_INT32 and IXDR_GET_INT32
*/
-# ifdef HAVE_XDR_U_INT64_T
-# define xdr_uint64_t xdr_u_int64_t
-# endif
-# ifndef IXDR_PUT_INT32
-# define IXDR_PUT_INT32 IXDR_PUT_LONG
-# endif
-# ifndef IXDR_GET_INT32
-# define IXDR_GET_INT32 IXDR_GET_LONG
-# endif
-# ifndef IXDR_PUT_U_INT32
-# define IXDR_PUT_U_INT32 IXDR_PUT_U_LONG
-# endif
-# ifndef IXDR_GET_U_INT32
-# define IXDR_GET_U_INT32 IXDR_GET_U_LONG
-# endif
-
-#endif /* LIBVIRT_VIRXDRDEFS_H */
+#ifdef HAVE_XDR_U_INT64_T
+# define xdr_uint64_t xdr_u_int64_t
+#endif
+#ifndef IXDR_PUT_INT32
+# define IXDR_PUT_INT32 IXDR_PUT_LONG
+#endif
+#ifndef IXDR_GET_INT32
+# define IXDR_GET_INT32 IXDR_GET_LONG
+#endif
+#ifndef IXDR_PUT_U_INT32
+# define IXDR_PUT_U_INT32 IXDR_PUT_U_LONG
+#endif
+#ifndef IXDR_GET_U_INT32
+# define IXDR_GET_U_INT32 IXDR_GET_U_LONG
+#endif