From nobody Fri Nov 7 09:13:47 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547733109055526.6270590227314; Thu, 17 Jan 2019 05:51:49 -0800 (PST) Received: from localhost ([127.0.0.1]:44880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gk85E-0000Fw-3E for importer@patchew.org; Thu, 17 Jan 2019 08:51:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gk7sQ-0006Ev-GF for qemu-devel@nongnu.org; Thu, 17 Jan 2019 08:38:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gk7sO-00062K-C4 for qemu-devel@nongnu.org; Thu, 17 Jan 2019 08:38:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41716) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gk7sO-00060D-3W for qemu-devel@nongnu.org; Thu, 17 Jan 2019 08:38:32 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA65D3DE2F; Thu, 17 Jan 2019 13:38:29 +0000 (UTC) Received: from thuth.com (ovpn-116-117.ams2.redhat.com [10.36.116.117]) by smtp.corp.redhat.com (Postfix) with ESMTP id 204925C554; Thu, 17 Jan 2019 13:38:27 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 17 Jan 2019 14:38:11 +0100 Message-Id: <1547732292-14021-3-git-send-email-thuth@redhat.com> In-Reply-To: <1547732292-14021-1-git-send-email-thuth@redhat.com> References: <1547732292-14021-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 17 Jan 2019 13:38:29 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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] [PULL v3 25/28] block: Work-around a bug in libiscsi 1.9.0 when used in gnu99 mode 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: clg@kaod.org, mst@redhat.com, Li Qiang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , groug@kaod.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The header "scsi-lowlevel.h" of libiscsi 1.9.0 contains some bad "inline" prototype definitions which GCC refuses to compile in its gnu99 mode: In file included from block/iscsi.c:52:0: /usr/include/iscsi/scsi-lowlevel.h:810:13: error: inline function =E2=80=98scsi_set_uint16=E2=80=99 declared but never defined [-Werror] inline void scsi_set_uint16(unsigned char *c, uint16_t val); ^ /usr/include/iscsi/scsi-lowlevel.h:809:13: error: inline function =E2=80=98scsi_set_uint32=E2=80=99 declared but never defined [-Werror] inline void scsi_set_uint32(unsigned char *c, uint32_t val); ^ [...] This has been fixed by upstream libiscsi in version 1.10.0 (see https://github.com/sahlberg/libiscsi/commit/7692027d6c11 ), but since we still want to support 1.9.0 for CentOS 7 / RHEL7, we have to work-around the issue by redefining the "inline" keyword to use the old "gnu89" mode behavior via "gnu_inline" instead. Reviewed-by: Eric Blake Signed-off-by: Thomas Huth --- block/iscsi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index a7e8c1f..ff47320 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -49,7 +49,9 @@ /* Conflict between scsi/utils.h and libiscsi! :( */ #define SCSI_XFER_NONE ISCSI_XFER_NONE #include +#define inline __attribute__((gnu_inline)) /* required for libiscsi v1.9.= 0 */ #include +#undef inline #undef SCSI_XFER_NONE QEMU_BUILD_BUG_ON((int)SCSI_XFER_NONE !=3D (int)ISCSI_XFER_NONE); =20 --=20 1.8.3.1