render / rpms / libvirt

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