From patchwork Thu Apr 5 13:20:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Thomson X-Patchwork-Id: 10324613 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3A47B6032A for ; Thu, 5 Apr 2018 13:22:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0506B287F4 for ; Thu, 5 Apr 2018 13:22:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03AB928F53; Thu, 5 Apr 2018 13:22:36 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 096901FFFF for ; Thu, 5 Apr 2018 13:22:32 +0000 (UTC) Received: from localhost ([::1]:57522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f44qV-0002Ky-T7 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 05 Apr 2018 09:22:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f44pR-0001dJ-Ik for qemu-devel@nongnu.org; Thu, 05 Apr 2018 09:21:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f44pO-0004qK-Tj for qemu-devel@nongnu.org; Thu, 05 Apr 2018 09:21:25 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:37155) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f44pO-0004pm-Mk for qemu-devel@nongnu.org; Thu, 05 Apr 2018 09:21:22 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D2FBC215FF; Thu, 5 Apr 2018 09:21:20 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 05 Apr 2018 09:21:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com.au; h=cc:date:from:message-id:subject:to:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=DBwNWsBmJwi40BsBgWGKtv03CEUc+R+peH+RiE+C5 Ow=; b=bgq4XhmO/BEGXkKwGEKOqzuOCzYnOc7pD/b6Am1+rCuHBeIW5ibfnXMm2 0l0AzRTGlw2w6HrV1JNAsM46YxyxK6vpO15TSjPabGcNl+bAtrb1wnCNIsGhTy9A mwI+dJSc7tyAOy0q1FLez4/JluqMf1QCB8K/Epyac0yt//mghISvuNcgcFLO+VNV PGgk/1NNx9+LcQ0lrbpTBKmC1Pz0VnMUl/v1IhfobR5C4NZ5HuxK2WF1t023ueJI bNYmJycDIDOaIPot0EKLXmrGT59m7EJY8afkzKMioZEBogL5TpwwAcqOxEaDLaCR YgrNZV09uMcrxtRxrJwWDiePMRaxQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=DBwNWsBmJwi40BsBg WGKtv03CEUc+R+peH+RiE+C5Ow=; b=jE7q4HAggQpta5SXBIJ7dEMRr4DQ8Pf48 rJ3fOnFebCMS8dWQUIdoLY4p4b3qtv52w0aecvLz3ylMmWHUeqHpom5TI6jxWHN5 tnYl6Ud827UCC0emIyd2DUXeht/C5DB7el9yXSTZZqsfso1+J32qSC6VYcGKFZzv qai6j21XNyPnvaykxfLuVPzNte05dSs64zC47rDqXZO9tdp3qA/DiW5Qs8Ol63H7 aYZF5cJ7Um5RVTU3I3X7o4lsgowuOi9TA7bda0YRlsdviM3JW730ygxT2A4driQW NDLWT/AJcLASqvXMh8Nulf7spT9v0yMfdAyPTDqXXCeC4attzfB9g== X-ME-Sender: Received: from h4v1.thome.spur.red (unknown [121.223.25.74]) by mail.messagingengine.com (Postfix) with ESMTPA id 4904110252; Thu, 5 Apr 2018 09:21:19 -0400 (EDT) From: John Thomson To: qemu-devel@nongnu.org Date: Thu, 5 Apr 2018 23:20:46 +1000 Message-Id: <20180405132046.4968-1-git@johnthomson.fastmail.com.au> X-Mailer: git-send-email 2.16.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.29 Subject: [Qemu-devel] [PATCH] Fix libusb-1.0.22 deprecated libusb_set_debug with libusb_set_option 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: kraxel@redhat.com, John Thomson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP libusb-1.0.22 marked libusb_set_debug deprecated it is replaced with libusb_set_option(libusb_context, LIBUSB_OPTION_LOG_LEVEL, libusb_log_level); details here: https://github.com/libusb/libusb/commit/539f22e2fd916558d11ab9a66f10f461c5593168 Warning here: CC hw/usb/host-libusb.o /builds/xen/src/qemu-xen/hw/usb/host-libusb.c: In function 'usb_host_init': /builds/xen/src/qemu-xen/hw/usb/host-libusb.c:250:5: error: 'libusb_set_debug' is deprecated: Use libusb_set_option instead [-Werror=deprecated-declarations] libusb_set_debug(ctx, loglevel); ^~~~~~~~~~~~~~~~ In file included from /builds/xen/src/qemu-xen/hw/usb/host-libusb.c:40:0: /usr/include/libusb-1.0/libusb.h:1300:18: note: declared here void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level); ^~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make: *** [/builds/xen/src/qemu-xen/rules.mak:66: hw/usb/host-libusb.o] Error 1 make: Leaving directory '/builds/xen/src/xen/tools/qemu-xen-build' Signed-off-by: John Thomson --- hw/usb/host-libusb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index 1b0be071cc..dc0a8fe295 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -247,7 +247,11 @@ static int usb_host_init(void) if (rc != 0) { return -1; } +#if LIBUSB_API_VERSION >= 0x01000106 + libusb_set_option(ctx, LIBUSB_OPTION_LOG_LEVEL, loglevel); +#else libusb_set_debug(ctx, loglevel); +#endif #ifdef CONFIG_WIN32 /* FIXME: add support for Windows. */ #else