From patchwork Fri Sep 7 06:48:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 1420171 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6556340AB4 for ; Fri, 7 Sep 2012 06:53:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756815Ab2IGGw6 (ORCPT ); Fri, 7 Sep 2012 02:52:58 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:46460 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753588Ab2IGGwx (ORCPT ); Fri, 7 Sep 2012 02:52:53 -0400 Received: from linux-iscsi.org (localhost [127.0.0.1]) by linux-iscsi.org (Postfix) with ESMTP id CBB9A22D9D5; Fri, 7 Sep 2012 06:48:27 +0000 (UTC) From: "Nicholas A. Bellinger" To: target-devel Cc: lf-virt , kvm-devel , qemu-devel , Stefan Hajnoczi , Zhi Yong Wu , Anthony Liguori , Paolo Bonzini , "Michael S. Tsirkin" , Christoph Hellwig , Hannes Reinecke , Jan Kiszka , Nicholas Bellinger , Zhi Yong Wu Subject: [PATCH 5/5] virtio-scsi: Set max_target=0 during vhost-scsi operation Date: Fri, 7 Sep 2012 06:48:19 +0000 Message-Id: <1347000499-28701-6-git-send-email-nab@linux-iscsi.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1347000499-28701-1-git-send-email-nab@linux-iscsi.org> References: <1347000499-28701-1-git-send-email-nab@linux-iscsi.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Nicholas Bellinger This QEMU patch sets VirtIOSCSIConfig->max_target=0 for vhost-scsi operation to restrict virtio-scsi LLD guest scanning to max_id=0 (a single target ID instance) when connected to individual tcm_vhost endpoints. This ensures that virtio-scsi LLD only attempts to scan target IDs up to VIRTIO_SCSI_MAX_TARGET when connected via virtio-scsi-raw. Cc: Stefan Hajnoczi Cc: Zhi Yong Wu Cc: Paolo Bonzini Signed-off-by: Nicholas Bellinger --- hw/virtio-scsi.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c index edda097..ab5ca72 100644 --- a/hw/virtio-scsi.c +++ b/hw/virtio-scsi.c @@ -546,7 +546,11 @@ static void virtio_scsi_get_config(VirtIODevice *vdev, stl_raw(&scsiconf->sense_size, s->sense_size); stl_raw(&scsiconf->cdb_size, s->cdb_size); stl_raw(&scsiconf->max_channel, VIRTIO_SCSI_MAX_CHANNEL); - stl_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET); + if (s->vhost_scsi) { + stl_raw(&scsiconf->max_target, 0); + } else { + stl_raw(&scsiconf->max_target, VIRTIO_SCSI_MAX_TARGET); + } stl_raw(&scsiconf->max_lun, VIRTIO_SCSI_MAX_LUN); }