From patchwork Tue Jul 24 22:34:05 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: 1233591 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 814BC3FD4F for ; Tue, 24 Jul 2012 22:37:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755655Ab2GXWhm (ORCPT ); Tue, 24 Jul 2012 18:37:42 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:41053 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755638Ab2GXWhl (ORCPT ); Tue, 24 Jul 2012 18:37:41 -0400 Received: from linux-iscsi.org (localhost [127.0.0.1]) by linux-iscsi.org (Postfix) with ESMTP id 78C0122D9DD; Tue, 24 Jul 2012 22:34:39 +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 , Jens Axboe , Hannes Reinecke , Nicholas Bellinger , Zhi Yong Wu Subject: [RFC 8/9] virtio-scsi: Set max_target=0 during vhost-scsi operation Date: Tue, 24 Jul 2012 22:34:05 +0000 Message-Id: <1343169246-17636-9-git-send-email-nab@linux-iscsi.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1343169246-17636-1-git-send-email-nab@linux-iscsi.org> References: <1343169246-17636-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 b0adfde..d854998 100644 --- a/hw/virtio-scsi.c +++ b/hw/virtio-scsi.c @@ -534,7 +534,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); }