From nobody Mon Apr 29 08:05:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1505822832766288.02400355661985; Tue, 19 Sep 2017 05:07:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BFB4E806CF; Tue, 19 Sep 2017 12:07:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 95C505D6A8; Tue, 19 Sep 2017 12:07:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0C9395EC67; Tue, 19 Sep 2017 12:07:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v8JC4mfg027535 for ; Tue, 19 Sep 2017 08:04:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6405C1964D; Tue, 19 Sep 2017 12:04:48 +0000 (UTC) Received: from dnr.brq.redhat.com (unknown [10.43.2.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id E02BB61342 for ; Tue, 19 Sep 2017 12:04:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BFB4E806CF Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 19 Sep 2017 14:04:43 +0200 Message-Id: <6d0adc50897c699713550f9c22553406874b045f.1505822676.git.jtomko@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] configure: fix check for DEVLINK_CMD_ESWITCH_GET X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 19 Sep 2017 12:07:12 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Instead of checking for all possible constants that every kernel header with devlink support should have (and defining HAVE_DECL_DEVLINK as 1 if any of them is present due to the way AC_CHECK_DECLS works), only check for DEVLINK_CMD_ESWITCH_GET. This is the name of the constant since kernel 4.11. Between 4.8 and 4.11, the now deprecated spelling DEVLINK_CMD_ESWITCH_MODE_GET was used. --- Yet another version. configure.ac | 9 +++------ src/util/virnetdev.c | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index c9509c7f9..f542359a6 100644 --- a/configure.ac +++ b/configure.ac @@ -628,15 +628,12 @@ if test "$with_linux" =3D "yes"; then fi =20 dnl -dnl check for kernel headers required by devlink +dnl check for DEVLINK_CMD_ESWITCH_GET, required for checking +dnl the DEVLINK_ESWITCH_MODE_SWITCHDEV capability dnl if test "$with_linux" =3D "yes"; then AC_CHECK_HEADERS([linux/devlink.h]) - AC_CHECK_DECLS([DEVLINK_GENL_VERSION, DEVLINK_GENL_NAME, DEVLINK_ATTR_= MAX, DEVLINK_CMD_ESWITCH_GET, DEVLINK_ATTR_BUS_NAME, DEVLINK_ATTR_DEV_NAME,= DEVLINK_ATTR_ESWITCH_MODE, DEVLINK_ESWITCH_MODE_SWITCHDEV], - [AC_DEFINE([HAVE_DECL_DEVLINK], - [1], - [whether devlink declarations are available]= )], - [], + AC_CHECK_DECLS([DEVLINK_CMD_ESWITCH_GET], [], [], [[#include ]]) fi =20 diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 040693925..41a659732 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -59,7 +59,7 @@ # include #endif =20 -#if HAVE_DECL_DEVLINK +#if HAVE_LINUX_DEVLINK_H # include #endif =20 @@ -3120,7 +3120,7 @@ virNetDevGetEthtoolFeatures(virBitmapPtr bitmap, } =20 =20 -# if HAVE_DECL_DEVLINK +# if HAVE_DECL_DEVLINK_CMD_ESWITCH_GET /** * virNetDevPutExtraHeader * reserve and prepare room for an extra header --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list