render / rpms / libvirt

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