[libvirt] [PATCH v2] virnetdev: fix build with old kernel

Pavel Hrdina phrdina at redhat.com
Thu Mar 12 16:50:02 UTC 2015


On Thu, Mar 12, 2015 at 04:43:28PM +0100, Michal Privoznik wrote:
> On 11.03.2015 15:27, Pavel Hrdina wrote:
> > Commit c9027d8f added a detection of NIC HW features, but some of them
> > are not available in old kernel.  Very old kernels lack enum
> > ethtool_flags and even if this enum is present, not all values are
> > available for all kernels.  To be sure that we have everything in kernel
> > that we need, we must check for existence of most of that flags, because
> > only few of them were defined at first.
> > 
> > Also to successfully build libvirt with older kernel we need to include
> > <linux/types.h> before <linux/ethtool.h> to have __u32 and friends
> > defined.
> > 
> > Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> > ---
> >  configure.ac         |  5 +++++
> >  src/util/virnetdev.c | 43 +++++++++++++++++++++++++++----------------
> >  2 files changed, 32 insertions(+), 16 deletions(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index e071813..2fedd1a 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -383,6 +383,11 @@ AC_CHECK_TYPE([struct ifreq],
> >          #include <net/if.h>
> >    ]])
> >  
> > +AC_CHECK_DECLS([ETH_FLAG_TXVLAN, ETH_FLAG_NTUPLE, ETH_FLAG_RXHASH, ETH_FLAG_LRO,
> > +                ETHTOOL_GGSO, ETHTOOL_GGRO, ETHTOOL_GFLAGS],
> > +  [], [], [[#include <linux/ethtool.h>
> > +  ]])
> > +
> 
> GSO and GRO were added in the same commit 37c3185a. So one of these
> checks can be dropped.

Well, actually only SGSO and GGSO are in that commit and SGRO and GGRO are in
different commit b240a0e5.

Pushed now with both checks, thanks for review.

Pavel

> 
> ACK with that fixed.
> 
> Michal




More information about the libvir-list mailing list