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: 10812419 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F94F13B4 for ; Thu, 14 Feb 2019 10:48:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DFDB2D6AD for ; Thu, 14 Feb 2019 10:48:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 825B62D6B1; Thu, 14 Feb 2019 10:48:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24BEE2D6AD for ; Thu, 14 Feb 2019 10:48:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406722AbfBNKsF (ORCPT ); Thu, 14 Feb 2019 05:48:05 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:53003 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405057AbfBNKsD (ORCPT ); Thu, 14 Feb 2019 05:48:03 -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 Cc: Laurent Vivier , Paolo Bonzini , kvm@vger.kernel.org, libvir-list@redhat.com, "Michael S. Tsirkin" , Eric Blake , Markus Armbruster , Michael Tokarev , "Dr. David Alan Gilbert" , qemu-trivial@nongnu.org, Gerd Hoffmann , Artyom Tarasenko , Kamil Rytarowski , Mark Cave-Ayland , Thomas Petazzoni , Thomas Huth Subject: [PULL 14/14] configure: improve usbfs check 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== Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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