render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
51d9a2
From c26689a72b04c30ea703d8820f4fc3ce840c6e3b Mon Sep 17 00:00:00 2001
51d9a2
Message-Id: <c26689a72b04c30ea703d8820f4fc3ce840c6e3b@dist-git>
3e5111
From: Martin Kletzander <mkletzan@redhat.com>
3e5111
Date: Tue, 25 Apr 2017 13:41:21 +0200
404507
Subject: [PATCH] RHEL: Define ETHTOOL_[GS]COALESCE when building on older
404507
 kernels
3e5111
3e5111
https://bugzilla.redhat.com/show_bug.cgi?id=1414627
3e5111
3e5111
RHEL-only (upstream will have this only when built on kernel that
3e5111
supports it).
3e5111
3e5111
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
404507
 src/util/virnetdev.c | 23 ++++++++---------------
404507
 1 file changed, 8 insertions(+), 15 deletions(-)
3e5111
3e5111
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
51d9a2
index b250af9e2c..bc1e70f0a8 100644
3e5111
--- a/src/util/virnetdev.c
3e5111
+++ b/src/util/virnetdev.c
51d9a2
@@ -3393,7 +3393,14 @@ virNetDevGetEthtoolGFeatures(virBitmapPtr bitmap ATTRIBUTE_UNUSED,
3e5111
 # endif
3e5111
 
3e5111
 
3e5111
-# if HAVE_DECL_ETHTOOL_SCOALESCE && HAVE_DECL_ETHTOOL_GCOALESCE
3e5111
+/* Workaround for binary distributions building on old kernels */
3e5111
+# ifndef ETHTOOL_GCOALESCE
3e5111
+#  define ETHTOOL_GCOALESCE 0x0000000e
3e5111
+# endif
3e5111
+# ifndef ETHTOOL_SCOALESCE
3e5111
+#  define ETHTOOL_SCOALESCE 0x0000000f
3e5111
+# endif
3e5111
+
3e5111
 /**
3e5111
  * virNetDevSetCoalesce:
3e5111
  * @ifname: interface name to modify
51d9a2
@@ -3493,20 +3500,6 @@ int virNetDevSetCoalesce(const char *ifname,
3e5111
     VIR_FORCE_CLOSE(fd);
3e5111
     return ret;
3e5111
 }
3e5111
-# else
3e5111
-int virNetDevSetCoalesce(const char *ifname,
404507
-                         virNetDevCoalescePtr coalesce,
404507
-                         bool update)
3e5111
-{
404507
-    if (!coalesce && !update)
404507
-        return 0;
404507
-
3e5111
-    virReportSystemError(ENOSYS,
3e5111
-                         _("Cannot set coalesce info on interface '%s'"),
3e5111
-                         ifname);
3e5111
-    return -1;
3e5111
-}
3e5111
-# endif
3e5111
 
3e5111
 
3e5111
 /**
3e5111
-- 
51d9a2
2.18.0
3e5111