From patchwork Tue Oct 10 21:34:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 824074 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=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yBVtr6mQGz9t5Q for ; Wed, 11 Oct 2017 08:41:56 +1100 (AEDT) Received: from localhost ([::1]:37274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e22Hj-0006Ug-2U for incoming@patchwork.ozlabs.org; Tue, 10 Oct 2017 17:41:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e22DQ-0003Hy-Ru for qemu-devel@nongnu.org; Tue, 10 Oct 2017 17:37:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e22DP-0002UN-VB for qemu-devel@nongnu.org; Tue, 10 Oct 2017 17:37:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60862) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e22DP-0002To-Ow for qemu-devel@nongnu.org; Tue, 10 Oct 2017 17:37:27 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA7D17EA85; Tue, 10 Oct 2017 21:37:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BA7D17EA85 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com Received: from localhost (unknown [10.36.112.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id F29066293C; Tue, 10 Oct 2017 21:37:21 +0000 (UTC) From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= To: qemu-devel@nongnu.org Date: Tue, 10 Oct 2017 23:34:56 +0200 Message-Id: <20171010213506.22989-18-marcandre.lureau@redhat.com> In-Reply-To: <20171010213506.22989-1-marcandre.lureau@redhat.com> References: <20171010213506.22989-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 10 Oct 2017 21:37:26 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 17/27] vhost-user-scsi: remove VUS_MAX_LUNS 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: pbonzini@redhat.com, felipe@nutanix.com, changpeng.liu@intel.com, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , f4bug@amsat.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" There is no code to support more than 1 yet, no need for that today. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- contrib/vhost-user-scsi/vhost-user-scsi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c index 38fe451619..6b55cc71d3 100644 --- a/contrib/vhost-user-scsi/vhost-user-scsi.c +++ b/contrib/vhost-user-scsi/vhost-user-scsi.c @@ -53,8 +53,6 @@ /** vhost-user-scsi specific definitions **/ - /* Only 1 LUN and device supported today */ -#define VUS_MAX_LUNS 1 #define VUS_ISCSI_INITIATOR "iqn.2016-11.com.nutanix:vhost-user-scsi" typedef struct iscsi_lun { @@ -67,7 +65,7 @@ typedef struct vhost_scsi_dev { int server_sock; GMainLoop *loop; GTree *fdmap; /* fd -> gsource context id */ - iscsi_lun_t luns[VUS_MAX_LUNS]; + iscsi_lun_t lun; } vhost_scsi_dev_t; /** glib event loop integration for libvhost-user and misc callbacks **/ @@ -535,7 +533,7 @@ static void vus_proc_req(VuDev *vu_dev, int idx) } rsp = (VirtIOSCSICmdResp *)elem->in_sg[0].iov_base; - if (handle_cmd_sync(vdev_scsi->luns[0].iscsi_ctx, + if (handle_cmd_sync(vdev_scsi->lun.iscsi_ctx, req, &elem->out_sg[1], elem->out_num - 1, rsp, &elem->in_sg[1], elem->in_num - 1) != 0) { vus_panic_cb(vu_dev, NULL); @@ -720,7 +718,7 @@ int main(int argc, char **argv) } vdev_scsi = vdev_scsi_new(sock); - if (iscsi_add_lun(&vdev_scsi->luns[0], iscsi_uri) != 0) { + if (iscsi_add_lun(&vdev_scsi->lun, iscsi_uri) != 0) { goto err; }