From patchwork Thu Feb 14 10:47:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1041999 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 440YBJ07Sgz9sMr for ; Thu, 14 Feb 2019 21:52:23 +1100 (AEDT) Received: from localhost ([127.0.0.1]:46092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guEcs-0004w0-9F for incoming@patchwork.ozlabs.org; Thu, 14 Feb 2019 05:52:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guEYn-0002J6-H2 for qemu-devel@nongnu.org; Thu, 14 Feb 2019 05:48:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guEYk-0002lC-03 for qemu-devel@nongnu.org; Thu, 14 Feb 2019 05:48:05 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:60613) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1guEYj-0002bS-JM; Thu, 14 Feb 2019 05:48:01 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mk0a0-1hN0sI1cTI-00kRt0; Thu, 14 Feb 2019 11:47:50 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 14 Feb 2019 11:47:17 +0100 Message-Id: <20190214104717.3543-15-laurent@vivier.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190214104717.3543-1-laurent@vivier.eu> References: <20190214104717.3543-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:oEJO8vGs3P/U5J3a0d60Q6qpUGstg5SafroEl9jicDD4f7bYeme VPeirvNOb8XH4PEm4hROIBVH4YfiF2jJQkAPLIk9amm2l9daSMhqCSfiRf+WCzmB1Yg3ixs Nzh8PS2boU8SgpuEuw7SO+r+GS04dO+JvRJIwZWJYGOGgnr2143cY576KETkHxviicW3KeJ uQNg5hA5RB3kGJzlENE/g== X-UI-Out-Filterresults: notjunk:1; V03:K0:jZ25PKVJrfk=:bHMGy/muyHN+uH7VJOLnYa pv1GWHEZAtyiC84Hp4LfGzh1rh20yCw2+L3p03Fq8DJcSLtSoa8jQfysNq2azSKVLJ/B4V5Dm RinX/O+xTx08s7S6wqV8tdecS/qAjufNrWgd9Glwtf1+BF3SHCRqj9It6jKPmU7z4MTbZprbe KLE4tDXGIn3fG83vgvnXHa9tMfu8fsUR5jQL4TeYVjFcGvEx1KZEW+Qfm03h1Rgiqa+X0Dj91 13kkj+Skffq7G1I0O5Ht+B06dPuKm0Oj8T7IBVSShOzOBLmB4iurnlG5LbXJv9TI62wiGcSVn C/WII6eBdKcXx84cMt7SAF6AvnrpG4Tl6/z5p5bnYd0H9CFSynGkkgpMPQqY3DZCWjwPfsBzn bj3s25lr6pnxdRuIh3X1vYhqmQRW1FtPku7S3nDl0XO84pzPP3y3YqNv7FvjcC+d9x+SGixsX Kl9EFzBBMFKnv6jzsWI7nX9tFn3M79PbMWADwmm/ej9c8JN5888WcTMSmN5wcn4fkJTgELqz6 l631OJ7VfUXWprTO0jEPC9viWx2QJ4Vlg1BExzCkZrcfLwjcmGrBpIPL+9lQb+EoAYHIwzEua HTNL3poD+Ou6ImDLrY/ovkPVCTMoCLIX+cltMQmpubZ2CNk0/c1HOflOnvz9Y6Ctwl81zjqSj Oa3qQGm8uTXAzsxnssnSNjG0CNr5ETfFjzWCGZJITL3VA7lJMQBOU6q1nhWujlMl/eu1Xi4ug HQwWdWVYHHFgb0jDoiHPP/DR1EEdfZU+f6UrIQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.130 Subject: [Qemu-devel] [PULL 14/14] configure: improve usbfs check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , kvm@vger.kernel.org, "Michael S. Tsirkin" , libvir-list@redhat.com, Mark Cave-Ayland , Michael Tokarev , Laurent Vivier , Markus Armbruster , qemu-trivial@nongnu.org, Kamil Rytarowski , Gerd Hoffmann , Thomas Petazzoni , Paolo Bonzini , "Dr. David Alan Gilbert" , Artyom Tarasenko Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Thomas Petazzoni The current check to test if usbfs support should be compiled or not solely relies on the presence of , without actually checking that all definition used by Qemu are provided by this header file. With sufficiently old kernel headers, may be present, but some of the definitions needed by Qemu may not be available. This commit improves the check by building a small program that actually tests whether the necessary definitions are available. In addition, it fixes a bug where have_usbfs was set to "yes" regardless of the result of the test. Signed-off-by: Thomas Petazzoni Reviewed-by: Thomas Huth Message-Id: <20190213211827.20300-1-thomas.petazzoni@bootlin.com> Signed-off-by: Laurent Vivier --- configure | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/configure b/configure index c0f278141823..90b9e2fa3c05 100755 --- a/configure +++ b/configure @@ -4262,10 +4262,25 @@ fi # check for usbfs have_usbfs=no if test "$linux_user" = "yes"; then - if check_include linux/usbdevice_fs.h; then + cat > $TMPC << EOF +#include + +#ifndef USBDEVFS_GET_CAPABILITIES +#error "USBDEVFS_GET_CAPABILITIES undefined" +#endif + +#ifndef USBDEVFS_DISCONNECT_CLAIM +#error "USBDEVFS_DISCONNECT_CLAIM undefined" +#endif + +int main(void) +{ + return 0; +} +EOF + if compile_prog "" ""; then have_usbfs=yes fi - have_usbfs=yes fi # check for fallocate