From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEtsU-00015W-JN for qemu-devel@nongnu.org; Wed, 06 Aug 2014 01:35:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEtsK-00011r-KQ for qemu-devel@nongnu.org; Wed, 06 Aug 2014 01:35:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEtsK-00011l-Du for qemu-devel@nongnu.org; Wed, 06 Aug 2014 01:35:00 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s765YxCR016466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 6 Aug 2014 01:34:59 -0400 From: Fam Zheng Date: Wed, 6 Aug 2014 13:35:02 +0800 Message-Id: <1407303308-4615-5-git-send-email-famz@redhat.com> In-Reply-To: <1407303308-4615-1-git-send-email-famz@redhat.com> References: <1407303308-4615-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [RFC PATCH v2 04/10] virtio-scsi: Add VirtIOSCSIVring in VirtIOSCSIReq List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@redhat.com Move VirtIOSCSIReq to header and add one field "vring" as a wrapper structure of Vring, VirtIOSCSIVring. This is necessary for coming dataplane code that runs uses vring on iothread. Signed-off-by: Fam Zheng --- include/hw/virtio/virtio-scsi.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h index fcd45e7..6138674 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -17,6 +17,8 @@ #include "hw/virtio/virtio.h" #include "hw/pci/pci.h" #include "hw/scsi/scsi.h" +#include "sysemu/iothread.h" +#include "hw/virtio/dataplane/vring.h" #define TYPE_VIRTIO_SCSI_COMMON "virtio-scsi-common" #define VIRTIO_SCSI_COMMON(obj) \ @@ -153,6 +155,15 @@ struct VirtIOSCSIConf { char *wwpn; }; +struct VirtIOSCSICommon; + +typedef struct { + struct VirtIOSCSICommon *parent; + Vring vring; + EventNotifier host_notifier; + EventNotifier guest_notifier; +} VirtIOSCSIVring; + typedef struct VirtIOSCSICommon { VirtIODevice parent_obj; VirtIOSCSIConf conf; @@ -175,6 +186,9 @@ typedef struct { typedef struct VirtIOSCSIReq { VirtIOSCSI *dev; VirtQueue *vq; + /* set if create by dataplane code */ + VirtIOSCSIVring *vring; + VirtQueueElement elem; QEMUSGList qsgl; SCSIRequest *sreq; -- 2.0.3