From patchwork Thu Apr 19 02:38:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhiyong Wu X-Patchwork-Id: 153630 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 48DF9B6F6E for ; Thu, 19 Apr 2012 13:03:32 +1000 (EST) Received: from localhost ([::1]:46827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKhIj-0004HM-F9 for incoming@patchwork.ozlabs.org; Wed, 18 Apr 2012 22:40:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKhIL-0003nG-02 for qemu-devel@nongnu.org; Wed, 18 Apr 2012 22:40:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKhIJ-0002Mr-6L for qemu-devel@nongnu.org; Wed, 18 Apr 2012 22:40:28 -0400 Received: from e8.ny.us.ibm.com ([32.97.182.138]:37081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKhIJ-0002Mi-1w for qemu-devel@nongnu.org; Wed, 18 Apr 2012 22:40:27 -0400 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 18 Apr 2012 22:40:24 -0400 Received: from d01dlp01.pok.ibm.com (9.56.224.56) by e8.ny.us.ibm.com (192.168.1.108) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 18 Apr 2012 22:39:25 -0400 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id EE14238C8062 for ; Wed, 18 Apr 2012 22:39:24 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q3J2dO37298418 for ; Wed, 18 Apr 2012 22:39:24 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q3J2dNG1020206 for ; Wed, 18 Apr 2012 23:39:24 -0300 Received: from us.ibm.com (f15.cn.ibm.com [9.115.118.120] (may be forged)) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id q3J2dJqk019795; Wed, 18 Apr 2012 23:39:20 -0300 Received: by us.ibm.com (sSMTP sendmail emulation); Thu, 19 Apr 2012 10:39:17 +0800 From: zwu.kernel@gmail.com To: qemu-devel@nongnu.org Date: Thu, 19 Apr 2012 10:38:54 +0800 Message-Id: <1334803149-27379-2-git-send-email-zwu.kernel@gmail.com> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1334803149-27379-1-git-send-email-zwu.kernel@gmail.com> References: <1334803149-27379-1-git-send-email-zwu.kernel@gmail.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12041902-9360-0000-0000-0000058A45AD X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 32.97.182.138 Cc: stefanha@linux.vnet.ibm.com, linuxram@us.ibm.com, nab@linux-iscsi.org, zwu.kernel@gmail.com, Zhi Yong Wu , luowenj@cn.ibm.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH 01/16] virtio-scsi: Add wwpn and tgpt properties X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.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. Signed-off-by: Stefan Hajnoczi Signed-off-by: Zhi Yong Wu --- hw/virtio-scsi.c | 2 ++ hw/virtio-scsi.h | 6 ++++++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c index 45d54fa..ff5d351 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..895f620 100644 --- a/hw/virtio-scsi.h +++ b/hw/virtio-scsi.h @@ -33,4 +33,10 @@ struct VirtIOSCSIConf { DEFINE_PROP_UINT32("max_sectors", _state, _conf_field.max_sectors, 0xFFFF), \ DEFINE_PROP_UINT32("cmd_per_lun", _state, _conf_field.cmd_per_lun, 128) +typedef struct { + /* The tcm_vhost wwpn and tgpt */ + char *wwpn; + char *tgpt; +} VirtIOSCSIConf; + #endif /* _QEMU_VIRTIO_SCSI_H */