From patchwork Tue Aug 21 20:52:11 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: 1357991 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 83C2AE006C for ; Tue, 21 Aug 2012 20:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932165Ab2HUU4Y (ORCPT ); Tue, 21 Aug 2012 16:56:24 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:60151 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758433Ab2HUU4V (ORCPT ); Tue, 21 Aug 2012 16:56:21 -0400 Received: from linux-iscsi.org (localhost [127.0.0.1]) by linux-iscsi.org (Postfix) with ESMTP id 0AE8122CAC8; Tue, 21 Aug 2012 20:52:26 +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: [RFC-v3 5/5] virtio-scsi: Set max_target=0 during vhost-scsi operation Date: Tue, 21 Aug 2012 20:52:11 +0000 Message-Id: <1345582331-22593-6-git-send-email-nab@linux-iscsi.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1345582331-22593-1-git-send-email-nab@linux-iscsi.org> References: <1345582331-22593-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); }