diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
index 7ca22de9a50c03e545942b2953bbe8a9dc8a3a2b..563b218227aeb72332fbe44b40fc40eb4589841e 100644
--- a/src/util/virnetdev.h
+++ b/src/util/virnetdev.h
@@ -16,29 +16,28 @@
* .
*/
-#ifndef LIBVIRT_VIRNETDEV_H
-# define LIBVIRT_VIRNETDEV_H
+#pragma once
-# include
+#include
-# include "virbitmap.h"
-# include "virsocketaddr.h"
-# include "virmacaddr.h"
-# include "virpci.h"
-# include "virnetdevvlan.h"
-# include "virautoclean.h"
-# include "virenum.h"
+#include "virbitmap.h"
+#include "virsocketaddr.h"
+#include "virmacaddr.h"
+#include "virpci.h"
+#include "virnetdevvlan.h"
+#include "virautoclean.h"
+#include "virenum.h"
-# ifdef HAVE_STRUCT_IFREQ
+#ifdef HAVE_STRUCT_IFREQ
typedef struct ifreq virIfreq;
-# else
+#else
typedef void virIfreq;
-# endif
+#endif
/* Used for prefix of ifname of any tap device name generated
* dynamically by libvirt, cannot be used for a persistent network name.
*/
-# define VIR_NET_GENERATED_TAP_PREFIX "vnet"
+#define VIR_NET_GENERATED_TAP_PREFIX "vnet"
typedef enum {
VIR_NETDEV_RX_FILTER_MODE_NONE = 0,
@@ -301,8 +300,8 @@ int virNetDevSetRcvAllMulti(const char *ifname, bool receive)
int virNetDevGetRcvAllMulti(const char *ifname, bool *receive)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
-# define SYSFS_NET_DIR "/sys/class/net/"
-# define SYSFS_INFINIBAND_DIR "/sys/class/infiniband/"
+#define SYSFS_NET_DIR "/sys/class/net/"
+#define SYSFS_INFINIBAND_DIR "/sys/class/infiniband/"
int virNetDevSysfsFile(char **pf_sysfs_device_link,
const char *ifname,
const char *file)
@@ -313,5 +312,3 @@ int virNetDevRunEthernetScript(const char *ifname, const char *script)
ATTRIBUTE_NOINLINE;
VIR_DEFINE_AUTOPTR_FUNC(virNetDevRxFilter, virNetDevRxFilterFree);
-
-#endif /* LIBVIRT_VIRNETDEV_H */
diff --git a/src/util/virnetdevbandwidth.h b/src/util/virnetdevbandwidth.h
index d243d7262a94ef4e434a99c379c530555954b04f..75da1f7ba6310a101a8a411d3b3c52df7598afa6 100644
--- a/src/util/virnetdevbandwidth.h
+++ b/src/util/virnetdevbandwidth.h
@@ -16,11 +16,10 @@
* .
*/
-#ifndef LIBVIRT_VIRNETDEVBANDWIDTH_H
-# define LIBVIRT_VIRNETDEVBANDWIDTH_H
+#pragma once
-# include "internal.h"
-# include "virmacaddr.h"
+#include "internal.h"
+#include "virmacaddr.h"
typedef struct _virNetDevBandwidthRate virNetDevBandwidthRate;
typedef virNetDevBandwidthRate *virNetDevBandwidthRatePtr;
@@ -74,4 +73,3 @@ int virNetDevBandwidthUpdateFilter(const char *ifname,
unsigned int id)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
ATTRIBUTE_RETURN_CHECK;
-#endif /* LIBVIRT_VIRNETDEVBANDWIDTH_H */
diff --git a/src/util/virnetdevbridge.h b/src/util/virnetdevbridge.h
index f8cc70e7f0a51cf168f54e6193c6f84f0a76d582..8df5e51c2e3f24c19dd03af791817b01034c1343 100644
--- a/src/util/virnetdevbridge.h
+++ b/src/util/virnetdevbridge.h
@@ -16,11 +16,10 @@
* .
*/
-#ifndef LIBVIRT_VIRNETDEVBRIDGE_H
-# define LIBVIRT_VIRNETDEVBRIDGE_H
+#pragma once
-# include "internal.h"
-# include "virmacaddr.h"
+#include "internal.h"
+#include "virmacaddr.h"
int virNetDevBridgeCreate(const char *brname)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
@@ -89,4 +88,3 @@ int virNetDevBridgeFDBAdd(const virMacAddr *mac, const char *ifname,
int virNetDevBridgeFDBDel(const virMacAddr *mac, const char *ifname,
unsigned int flags)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
-#endif /* LIBVIRT_VIRNETDEVBRIDGE_H */
diff --git a/src/util/virnetdevip.h b/src/util/virnetdevip.h
index d885d09a009912bd538056ed346395dedc70a2bd..9fa5f446b08f89f2f100c5a3ba4963fc13ec1abe 100644
--- a/src/util/virnetdevip.h
+++ b/src/util/virnetdevip.h
@@ -16,11 +16,10 @@
* .
*/
-#ifndef LIBVIRT_VIRNETDEVIP_H
-# define LIBVIRT_VIRNETDEVIP_H
+#pragma once
-# include "virsocketaddr.h"
-# include "virautoclean.h"
+#include "virsocketaddr.h"
+#include "virautoclean.h"
typedef struct _virNetDevIPAddr virNetDevIPAddr;
typedef virNetDevIPAddr *virNetDevIPAddrPtr;
@@ -97,5 +96,3 @@ int virNetDevIPInfoAddToDev(const char *ifname,
VIR_DEFINE_AUTOPTR_FUNC(virNetDevIPAddr, virNetDevIPAddrFree);
VIR_DEFINE_AUTOPTR_FUNC(virNetDevIPRoute, virNetDevIPRouteFree);
-
-#endif /* LIBVIRT_VIRNETDEVIP_H */
diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h
index a33ea8f29e3486f080bad302d4f07c02fd5d4bab..d1b479ed9f08f8d582d4817873588158ad712bb2 100644
--- a/src/util/virnetdevmacvlan.h
+++ b/src/util/virnetdevmacvlan.h
@@ -17,16 +17,15 @@
* .
*/
-#ifndef LIBVIRT_VIRNETDEVMACVLAN_H
-# define LIBVIRT_VIRNETDEVMACVLAN_H
+#pragma once
-# include "internal.h"
-# include "virmacaddr.h"
-# include "virsocketaddr.h"
-# include "virnetdevbandwidth.h"
-# include "virnetdevvportprofile.h"
-# include "virnetdevvlan.h"
-# include "virenum.h"
+#include "internal.h"
+#include "virmacaddr.h"
+#include "virsocketaddr.h"
+#include "virnetdevbandwidth.h"
+#include "virnetdevvportprofile.h"
+#include "virnetdevvlan.h"
+#include "virenum.h"
/* the mode type for macvtap devices */
typedef enum {
@@ -52,8 +51,8 @@ typedef enum {
/* libvirt will start macvtap/macvlan interface names with one of
* these prefixes when it auto-generates the name
*/
-# define VIR_NET_GENERATED_MACVTAP_PREFIX "macvtap"
-# define VIR_NET_GENERATED_MACVLAN_PREFIX "macvlan"
+#define VIR_NET_GENERATED_MACVTAP_PREFIX "macvtap"
+#define VIR_NET_GENERATED_MACVLAN_PREFIX "macvlan"
int virNetDevMacVLanReserveName(const char *name, bool quietfail);
int virNetDevMacVLanReleaseName(const char *name);
@@ -112,4 +111,3 @@ int virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname,
virNetDevVPortProfileOp vmOp)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
-#endif /* LIBVIRT_VIRNETDEVMACVLAN_H */
diff --git a/src/util/virnetdevmidonet.h b/src/util/virnetdevmidonet.h
index dde72c065311b85cf551d767a7a658ffde7fe4c4..aa7fe49103ac01f82c82b8884dd8dd40ff7877b1 100644
--- a/src/util/virnetdevmidonet.h
+++ b/src/util/virnetdevmidonet.h
@@ -16,11 +16,10 @@
* .
*/
-#ifndef LIBVIRT_VIRNETDEVMIDONET_H
-# define LIBVIRT_VIRNETDEVMIDONET_H
+#pragma once
-# include "internal.h"
-# include "virnetdevvportprofile.h"
+#include "internal.h"
+#include "virnetdevvportprofile.h"
int virNetDevMidonetBindPort(const char *ifname,
@@ -29,5 +28,3 @@ int virNetDevMidonetBindPort(const char *ifname,
int virNetDevMidonetUnbindPort(virNetDevVPortProfilePtr virtualport)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
-
-#endif /* LIBVIRT_VIRNETDEVMIDONET_H */
diff --git a/src/util/virnetdevopenvswitch.h b/src/util/virnetdevopenvswitch.h
index c9428f9e3e1917a6480b73eebb5620d2ee38cfbc..07496fb07df202658b63f2c7a81130d0306381ae 100644
--- a/src/util/virnetdevopenvswitch.h
+++ b/src/util/virnetdevopenvswitch.h
@@ -18,14 +18,13 @@
* .
*/
-#ifndef LIBVIRT_VIRNETDEVOPENVSWITCH_H
-# define LIBVIRT_VIRNETDEVOPENVSWITCH_H
+#pragma once
-# include "internal.h"
-# include "virnetdevvportprofile.h"
-# include "virnetdevvlan.h"
+#include "internal.h"
+#include "virnetdevvportprofile.h"
+#include "virnetdevvlan.h"
-# define VIR_NETDEV_OVS_DEFAULT_TIMEOUT 5
+#define VIR_NETDEV_OVS_DEFAULT_TIMEOUT 5
void virNetDevOpenvswitchSetTimeout(unsigned int timeout);
@@ -64,5 +63,3 @@ int virNetDevOpenvswitchGetVhostuserIfname(const char *path,
int virNetDevOpenvswitchUpdateVlan(const char *ifname,
virNetDevVlanPtr virtVlan)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
-
-#endif /* LIBVIRT_VIRNETDEVOPENVSWITCH_H */
diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h
index 2b3893cd37cb60a6ac553db84f2078ee2ef97160..ec5789959a360346e380e7228f317da897140a25 100644
--- a/src/util/virnetdevtap.h
+++ b/src/util/virnetdevtap.h
@@ -16,19 +16,18 @@
* .
*/
-#ifndef LIBVIRT_VIRNETDEVTAP_H
-# define LIBVIRT_VIRNETDEVTAP_H
+#pragma once
-# include "internal.h"
-# include "virnetdev.h"
-# include "virnetdevvportprofile.h"
-# include "virnetdevvlan.h"
+#include "internal.h"
+#include "virnetdev.h"
+#include "virnetdevvportprofile.h"
+#include "virnetdevvlan.h"
-# ifdef __FreeBSD__
+#ifdef __FreeBSD__
/* This should be defined on OSes that don't automatically
* cleanup released devices */
-# define VIR_NETDEV_TAP_REQUIRE_MANUAL_CLEANUP 1
-# endif
+# define VIR_NETDEV_TAP_REQUIRE_MANUAL_CLEANUP 1
+#endif
int virNetDevTapCreate(char **ifname,
const char *tunpath,
@@ -103,5 +102,3 @@ int virNetDevTapInterfaceStats(const char *ifname,
virDomainInterfaceStatsPtr stats,
bool swapped)
ATTRIBUTE_RETURN_CHECK;
-
-#endif /* LIBVIRT_VIRNETDEVTAP_H */
diff --git a/src/util/virnetdevveth.h b/src/util/virnetdevveth.h
index b00eb2b3a2e8bb31657f41474a53ecdc8878ff95..4380b7cfe1656b2c4a460d31b9092ded5019bbc9 100644
--- a/src/util/virnetdevveth.h
+++ b/src/util/virnetdevveth.h
@@ -17,15 +17,12 @@
* .
*/
-#ifndef LIBVIRT_VIRNETDEVVETH_H
-# define LIBVIRT_VIRNETDEVVETH_H
+#pragma once
-# include "internal.h"
+#include "internal.h"
/* Function declarations */
int virNetDevVethCreate(char **veth1, char **veth2)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
int virNetDevVethDelete(const char *veth)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
-
-#endif /* LIBVIRT_VIRNETDEVVETH_H */
diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h
index d986300d2a034647d2a7e6a4ab19d99935eac54e..87d361a1cf7625f7e818e4e5327327d1b8c823ae 100644
--- a/src/util/virnetdevvlan.h
+++ b/src/util/virnetdevvlan.h
@@ -16,13 +16,12 @@
* .
*/
-#ifndef LIBVIRT_VIRNETDEVVLAN_H
-# define LIBVIRT_VIRNETDEVVLAN_H
+#pragma once
-# include
+#include
-# include "virautoclean.h"
-# include "virenum.h"
+#include "virautoclean.h"
+#include "virenum.h"
typedef enum {
VIR_NATIVE_VLAN_MODE_DEFAULT = 0,
@@ -50,5 +49,3 @@ int virNetDevVlanEqual(const virNetDevVlan *a, const virNetDevVlan *b);
int virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlan *src);
VIR_DEFINE_AUTOPTR_FUNC(virNetDevVlan, virNetDevVlanFree);
-
-#endif /* LIBVIRT_VIRNETDEVVLAN_H */
diff --git a/src/util/virnetdevvportprofile.h b/src/util/virnetdevvportprofile.h
index afa982f2e3cfdb1a4e5de4dbfd21d1a956000efc..d1db8bac6aed299e326ae5955285671eb422e06d 100644
--- a/src/util/virnetdevvportprofile.h
+++ b/src/util/virnetdevvportprofile.h
@@ -16,16 +16,15 @@
* .
*/
-#ifndef LIBVIRT_VIRNETDEVVPORTPROFILE_H
-# define LIBVIRT_VIRNETDEVVPORTPROFILE_H
+#pragma once
-# include "internal.h"
-# include "viruuid.h"
-# include "virutil.h"
-# include "virmacaddr.h"
-# include "virenum.h"
+#include "internal.h"
+#include "viruuid.h"
+#include "virutil.h"
+#include "virmacaddr.h"
+#include "virenum.h"
-# define LIBVIRT_IFLA_VF_PORT_PROFILE_MAX 40
+#define LIBVIRT_IFLA_VF_PORT_PROFILE_MAX 40
typedef enum virNetDevVPortProfile {
VIR_NETDEV_VPORT_PROFILE_NONE,
@@ -109,6 +108,3 @@ int virNetDevVPortProfileDisassociate(const char *ifname,
int vf,
virNetDevVPortProfileOp vmOp)
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
-
-
-#endif /* LIBVIRT_VIRNETDEVVPORTPROFILE_H */