]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: remove extraneous defined(__linux__) when checking for WITH_LIBNL
authorLaine Stump <laine@redhat.com>
Mon, 28 Sep 2020 21:29:41 +0000 (17:29 -0400)
committerLaine Stump <laine@redhat.com>
Thu, 1 Oct 2020 18:02:34 +0000 (14:02 -0400)
WITH_LIBNL will only be defined on Linux platforms (because libnl is a
library written to encapsulate parts of netlink, which is a Linux-only
API), so it's redundant to write:

  #if defined(__linux__) && defined(WITH_LIBNL)

We can just check for WITH_LIBNL.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virnetdev.c
src/util/virnetdevbridge.c
src/util/virnetdevip.c
src/util/virnetlink.c
src/util/virnetlink.h

index 07208a187608b984b166eccf45c2a7b73b91501a..737081a12be0a6947a2f4b129b9fb19cb766dac9 100644 (file)
@@ -885,7 +885,7 @@ int virNetDevGetIndex(const char *ifname G_GNUC_UNUSED,
 #endif /* ! SIOCGIFINDEX */
 
 
-#if defined(__linux__) && defined(WITH_LIBNL)
+#if defined(WITH_LIBNL)
 /**
  * virNetDevGetMaster:
  * @ifname: name of interface we're interested in
@@ -929,7 +929,7 @@ virNetDevGetMaster(const char *ifname G_GNUC_UNUSED,
 }
 
 
-#endif /* defined(__linux__) && defined(WITH_LIBNL) */
+#endif /* defined(WITH_LIBNL) */
 
 
 #if defined(SIOCGIFVLAN) && defined(WITH_STRUCT_IFREQ) && WITH_DECL_GET_VLAN_VID_CMD
@@ -1473,7 +1473,7 @@ virNetDevSysfsFile(char **pf_sysfs_device_link G_GNUC_UNUSED,
 
 
 #endif /* !__linux__ */
-#if defined(__linux__) && defined(WITH_LIBNL)
+#if defined(WITH_LIBNL)
 
 
 static virMacAddr zeroMAC = { .addr = { 0, 0, 0, 0, 0, 0 } };
@@ -2266,7 +2266,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf,
 }
 
 
-#else /* defined(__linux__) && defined(WITH_LIBNL) */
+#else /* defined(WITH_LIBNL) */
 
 
 int
@@ -2309,7 +2309,7 @@ virNetDevSetNetConfig(const char *linkdev G_GNUC_UNUSED,
 }
 
 
-#endif /* defined(__linux__) && defined(WITH_LIBNL) */
+#endif /* defined(WITH_LIBNL) */
 
 VIR_ENUM_IMPL(virNetDevIfState,
               VIR_NETDEV_IF_STATE_LAST,
index 9fec770fb6650a4328acf6271b7fa3e7bf6bbbc9..d475e4c43dc793770141523e2f68f287af5d2880 100644 (file)
@@ -441,7 +441,7 @@ virNetDevBridgeCreateWithIoctl(const char *brname,
 }
 #endif
 
-#if defined(__linux__) && defined(WITH_LIBNL)
+#if defined(WITH_LIBNL)
 int
 virNetDevBridgeCreate(const char *brname,
                       const virMacAddr *mac)
@@ -552,7 +552,7 @@ virNetDevBridgeDeleteWithIoctl(const char *brname)
 #endif
 
 
-#if defined(__linux__) && defined(WITH_LIBNL)
+#if defined(WITH_LIBNL)
 int
 virNetDevBridgeDelete(const char *brname)
 {
@@ -976,7 +976,7 @@ virNetDevBridgeSetVlanFiltering(const char *brname G_GNUC_UNUSED,
 #endif
 
 
-#if defined(__linux__) && defined(WITH_LIBNL)
+#if defined(WITH_LIBNL)
 
 # ifndef NTF_SELF
 #  define NTF_SELF 0x02
index 4887ccfcf1ead8b6f6aae84a1c1550410b930464..a69567da6f94da66014c571fcdb0cd2a132f4658 100644 (file)
@@ -52,7 +52,7 @@
 
 VIR_LOG_INIT("util.netdevip");
 
-#if defined(__linux__) && defined(WITH_LIBNL)
+#if defined(WITH_LIBNL)
 
 static int
 virNetDevGetIPAddressBinary(virSocketAddr *addr, void **data, size_t *len)
@@ -373,7 +373,7 @@ virNetDevIPRouteAdd(const char *ifname,
 }
 
 
-#else /* defined(__linux__) && defined(WITH_LIBNL) */
+#else /* defined(WITH_LIBNL) */
 
 
 int
@@ -494,7 +494,7 @@ virNetDevIPRouteAdd(const char *ifname,
     return 0;
 }
 
-#endif /* defined(__linux__) && defined(HAVE_LIBNL) */
+#endif /* defined(HAVE_LIBNL) */
 
 
 #if defined(__linux__)
index be444baa56f0ed3dedb907aa9a4f9ff18412086b..ea06db51ee494c493bbb5629df9cfcddc50853ff 100644 (file)
@@ -40,7 +40,7 @@ VIR_LOG_INIT("util.netlink");
 
 #define NETLINK_ACK_TIMEOUT_S  (2*1000)
 
-#if defined(__linux__) && defined(WITH_LIBNL)
+#if defined(WITH_LIBNL)
 /* State for a single netlink event handle */
 struct virNetlinkEventHandle {
     int watch;
@@ -1387,4 +1387,4 @@ virNetlinkGetErrorCode(struct nlmsghdr *resp G_GNUC_UNUSED,
     return -EINVAL;
 }
 
-#endif /* __linux__ */
+#endif /* WITH_LIBNL */
index 40f27524f6732c32e3feef2abe5bea57d0a24877..7121eac43e540c9a0806bb15ea3d75565672f8c6 100644 (file)
@@ -22,7 +22,7 @@
 #include "internal.h"
 #include "virmacaddr.h"
 
-#if defined(__linux__) && defined(WITH_LIBNL)
+#if defined(WITH_LIBNL)
 
 # include <netlink/msg.h>
 
@@ -36,7 +36,7 @@ struct sockaddr_nl;
 struct nlattr;
 struct nlmsghdr;
 
-#endif /* __linux__ */
+#endif /* WITH_LIBNL */
 
 #define NETLINK_MSG_NEST_START(msg, container, attrtype) \
 do { \