From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYwVc-0007wX-Jd for qemu-devel@nongnu.org; Tue, 30 Sep 2014 08:26:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYwVT-00039E-AP for qemu-devel@nongnu.org; Tue, 30 Sep 2014 08:26:24 -0400 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:62078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYwVT-00037V-4H for qemu-devel@nongnu.org; Tue, 30 Sep 2014 08:26:15 -0400 Received: by mail-wi0-f182.google.com with SMTP id ex7so3878616wid.9 for ; Tue, 30 Sep 2014 05:26:08 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 30 Sep 2014 14:25:03 +0200 Message-Id: <1412079919-18857-24-git-send-email-pbonzini@redhat.com> In-Reply-To: <1412079919-18857-1-git-send-email-pbonzini@redhat.com> References: <1412079919-18857-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 23/39] virtio-scsi: Add VirtIOSCSIVring in VirtIOSCSIReq List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Fam Zheng From: Fam Zheng 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 Signed-off-by: Paolo Bonzini --- include/hw/virtio/virtio-scsi.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h index 2ff145a..e886517 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) \ @@ -154,6 +156,15 @@ struct VirtIOSCSIConf { IOThread *iothread; }; +struct VirtIOSCSI; + +typedef struct { + struct VirtIOSCSI *parent; + Vring vring; + EventNotifier host_notifier; + EventNotifier guest_notifier; +} VirtIOSCSIVring; + typedef struct VirtIOSCSICommon { VirtIODevice parent_obj; VirtIOSCSIConf conf; @@ -165,7 +176,7 @@ typedef struct VirtIOSCSICommon { VirtQueue **cmd_vqs; } VirtIOSCSICommon; -typedef struct { +typedef struct VirtIOSCSI { VirtIOSCSICommon parent_obj; SCSIBus bus; @@ -186,6 +197,8 @@ typedef struct VirtIOSCSIReq { * */ VirtQueueElement elem; + /* Set by dataplane code. */ + VirtIOSCSIVring *vring; SCSIRequest *sreq; size_t resp_size; enum SCSIXferMode mode; -- 1.8.3.1