diff options
| author | Fam Zheng | 2014-09-24 09:21:41 +0200 |
|---|---|---|
| committer | Paolo Bonzini | 2014-09-30 11:11:20 +0200 |
| commit | 244e2898b7a7735b3da114c120abe206af56a167 (patch) | |
| tree | b8b3465bfb49990c13ed66000e9488d669b6cb2e /include | |
| parent | virtio-scsi: Add 'iothread' property to virtio-scsi (diff) | |
| download | qemu-244e2898b7a7735b3da114c120abe206af56a167.tar.gz qemu-244e2898b7a7735b3da114c120abe206af56a167.tar.xz qemu-244e2898b7a7735b3da114c120abe206af56a167.zip | |
virtio-scsi: Add VirtIOSCSIVring in VirtIOSCSIReq
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 <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/hw/virtio/virtio-scsi.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h index 2ff145a4ec..e886517c6d 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; |
