[libvirt PATCH 05/21] netdev: simplify check for ethtool functionality

Daniel P. Berrangé berrange at redhat.com
Thu Dec 8 14:35:09 UTC 2022


ethtool is a Linux specific feature that has existed since before Linux
moved to git. Checking against SIOCETHTOOL + WITH_STRUCT_IFREQ is
overkill for our needs.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 src/util/virnetdev.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 66cfc5d781..c21cf69be1 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -42,6 +42,8 @@
 #ifdef __linux__
 # include <linux/sockios.h>
 # include <linux/if_vlan.h>
+# include <linux/types.h>
+# include <linux/ethtool.h>
 # define VIR_NETDEV_FAMILY AF_UNIX
 #elif defined(WITH_STRUCT_IFREQ) && defined(AF_LOCAL)
 # define VIR_NETDEV_FAMILY AF_LOCAL
@@ -49,11 +51,6 @@
 # undef WITH_STRUCT_IFREQ
 #endif
 
-#if defined(SIOCETHTOOL) && defined(WITH_STRUCT_IFREQ)
-# include <linux/types.h>
-# include <linux/ethtool.h>
-#endif
-
 #if WITH_DECL_LINK_ADDR
 # include <sys/sockio.h>
 # include <net/if_dl.h>
@@ -2958,7 +2955,7 @@ int virNetDevGetRxFilter(const char *ifname,
     return ret;
 }
 
-#if defined(SIOCETHTOOL) && defined(WITH_STRUCT_IFREQ)
+#if __linux__
 
 /**
  * virNetDevRDMAFeature
-- 
2.38.1



More information about the libvir-list mailing list