render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From f15202cb5a7429a2618cd4ede95064d8874b64ff Mon Sep 17 00:00:00 2001
Message-Id: <f15202cb5a7429a2618cd4ede95064d8874b64ff@dist-git>
From: Martin Kletzander <mkletzan@redhat.com>
Date: Tue, 25 Apr 2017 13:41:21 +0200
Subject: [PATCH] Define ETHTOOL_[GS]COALESCE when building on older kernels

https://bugzilla.redhat.com/show_bug.cgi?id=1414627

RHEL-only (upstream will have this only when built on kernel that
supports it).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/util/virnetdev.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index f14286f62..eb97b705e 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -3082,7 +3082,14 @@ virNetDevGetEthtoolGFeatures(virBitmapPtr bitmap ATTRIBUTE_UNUSED,
 # endif
 
 
-# if HAVE_DECL_ETHTOOL_SCOALESCE && HAVE_DECL_ETHTOOL_GCOALESCE
+/* Workaround for binary distributions building on old kernels */
+# ifndef ETHTOOL_GCOALESCE
+#  define ETHTOOL_GCOALESCE 0x0000000e
+# endif
+# ifndef ETHTOOL_SCOALESCE
+#  define ETHTOOL_SCOALESCE 0x0000000f
+# endif
+
 /**
  * virNetDevSetCoalesce:
  * @ifname: interface name to modify
@@ -3153,16 +3160,6 @@ int virNetDevSetCoalesce(const char *ifname,
     VIR_FORCE_CLOSE(fd);
     return ret;
 }
-# else
-int virNetDevSetCoalesce(const char *ifname,
-                         virNetDevCoalescePtr coalesce ATTRIBUTE_UNUSED)
-{
-    virReportSystemError(ENOSYS,
-                         _("Cannot set coalesce info on interface '%s'"),
-                         ifname);
-    return -1;
-}
-# endif
 
 
 /**
-- 
2.12.2