From patchwork Wed Feb 20 00:05:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 10820927 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 61AB11575 for ; Wed, 20 Feb 2019 00:11:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 423AC2D34E for ; Wed, 20 Feb 2019 00:11:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31D582D352; Wed, 20 Feb 2019 00:11:35 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B2E102D34E for ; Wed, 20 Feb 2019 00:11:34 +0000 (UTC) Received: from localhost ([127.0.0.1]:56876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwFU5-00072q-Ji for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Feb 2019 19:11:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gwFTS-0006kF-Ge for qemu-devel@nongnu.org; Tue, 19 Feb 2019 19:10:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gwFTK-0000zZ-Tf for qemu-devel@nongnu.org; Tue, 19 Feb 2019 19:10:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57648) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gwFSk-0008Iu-Vs; Tue, 19 Feb 2019 19:10:12 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CD68EC07DE94; Wed, 20 Feb 2019 00:06:06 +0000 (UTC) Received: from x1w.redhat.com (unknown [10.40.205.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3774600C4; Wed, 20 Feb 2019 00:05:56 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Date: Wed, 20 Feb 2019 01:05:53 +0100 Message-Id: <20190220000553.28438-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 20 Feb 2019 00:06:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] block/iscsi: Restrict Linux-specific code 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: Kevin Wolf , qemu-block@nongnu.org, Peter Lieven , Max Reitz , Ronnie Sahlberg , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Some Linux specific code is missing guards, leading to build failure on OSX: $ sudo brew install libiscsi $ ./configure && make [...] CC block/iscsi.o qemu/block/iscsi.c:338:24: error: 'iscsi_aiocb_info' defined but not used [-Werror=unused-const-variable=] static const AIOCBInfo iscsi_aiocb_info = { ^~~~~~~~~~~~~~~~ qemu/block/iscsi.c:168:1: error: 'iscsi_schedule_bh' defined but not used [-Werror=unused-function] iscsi_schedule_bh(IscsiAIOCB *acb) ^~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Add guards to restrict this code for Linux. Signed-off-by: Philippe Mathieu-Daudé --- There are various Linux specific code, we could split it out to another file such block/iscsi-lnx.o and guard with Makefile, but that's another patch. block/iscsi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index ff473206e6..85daa9a481 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -145,6 +145,8 @@ static const unsigned iscsi_retry_times[] = {8, 32, 128, 512, 2048, 8192, 32768} * unallocated. */ #define ISCSI_CHECKALLOC_THRES 64 +#ifdef __linux__ + static void iscsi_bh_cb(void *p) { @@ -172,6 +174,8 @@ iscsi_schedule_bh(IscsiAIOCB *acb) qemu_bh_schedule(acb->bh); } +#endif + static void iscsi_co_generic_bh_cb(void *opaque) { struct IscsiTask *iTask = opaque; @@ -290,6 +294,8 @@ static void iscsi_co_init_iscsitask(IscsiLun *iscsilun, struct IscsiTask *iTask) }; } +#ifdef __linux__ + /* Called (via iscsi_service) with QemuMutex held. */ static void iscsi_abort_task_cb(struct iscsi_context *iscsi, int status, void *command_data, @@ -338,6 +344,7 @@ static const AIOCBInfo iscsi_aiocb_info = { .cancel_async = iscsi_aio_cancel, }; +#endif static void iscsi_process_read(void *arg); static void iscsi_process_write(void *arg);