From patchwork Tue Jul 24 22:34:02 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: 1233571 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 1DD3C3FD4F for ; Tue, 24 Jul 2012 22:37:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755510Ab2GXWh3 (ORCPT ); Tue, 24 Jul 2012 18:37:29 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:41025 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755274Ab2GXWh1 (ORCPT ); Tue, 24 Jul 2012 18:37:27 -0400 Received: from linux-iscsi.org (localhost [127.0.0.1]) by linux-iscsi.org (Postfix) with ESMTP id E69FB22D9DA; Tue, 24 Jul 2012 22:34:25 +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 Subject: [RFC 5/9] virtio-scsi: Add wwpn and tgpt properties Date: Tue, 24 Jul 2012 22:34:02 +0000 Message-Id: <1343169246-17636-6-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: Stefan Hajnoczi A vhost-scsi device must be bound to a tcm_vhost target port. This will be done by issuing an ioctl to the device with the wwpn and tgpt. This patch adds these properties to the virtio-scsi-pci device: qemu -device virtio-scsi-pci,wwpn=$TARGET_WWN,tgpt=$TPGT Future patches will open /dev/vhost-scsi and issue the ioctl. This patch also moves the virtio_scsi_init() prototype to hw/virtio-scsi.h where the VirtIOSCSIConf structure is defined. I think this is cleaner than defining it in hw/virtio.h. (v2: Use modern VirtIOSCSIConf define in virtio-scsi.h) Signed-off-by: Stefan Hajnoczi Signed-off-by: Zhi Yong Wu Cc: Paolo Bonzini Cc: Michael S. Tsirkin Signed-off-by: Nicholas Bellinger --- hw/virtio-scsi.c | 2 ++ hw/virtio-scsi.h | 1 + 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c index 0a5ac40..4a787d3 100644 --- a/hw/virtio-scsi.c +++ b/hw/virtio-scsi.c @@ -13,6 +13,8 @@ * */ +#include "qemu-common.h" +#include "qemu-error.h" #include "virtio-scsi.h" #include #include diff --git a/hw/virtio-scsi.h b/hw/virtio-scsi.h index 4bc889d..74e9422 100644 --- a/hw/virtio-scsi.h +++ b/hw/virtio-scsi.h @@ -22,6 +22,7 @@ #define VIRTIO_ID_SCSI 8 struct VirtIOSCSIConf { + VHostSCSI *vhost_scsi; uint32_t num_queues; uint32_t max_sectors; uint32_t cmd_per_lun;