aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-scsi.h
diff options
context:
space:
mode:
authorKONRAD Frederic <fred.konrad@greensocs.com>2013-03-18 17:37:18 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2013-03-18 13:08:39 -0500
commitf1b24e840f9f85a2bb3912e4507d887e7858219d (patch)
tree02f71b36d2e0b115ca68d7663f2d18b4c63f7276 /hw/virtio-scsi.h
parente531761d63b7f8fe6b6423fafb3616ebbff768aa (diff)
virtio: make virtio device's structures public.
These structures must be made public to avoid two memory allocations for refactored virtio devices. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Message-id: 1363624648-16906-2-git-send-email-fred.konrad@greensocs.com Changes V4 <- V3: * Rebased on current git. Changes V3 <- V2: * Style correction spotted by Andreas (virtio-scsi.h). * Style correction for virtio-net.h. Changes V2 <- V1: * Move the dataplane include into the header (virtio-blk). Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-scsi.h')
-rw-r--r--hw/virtio-scsi.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/virtio-scsi.h b/hw/virtio-scsi.h
index 81b3279a57..ccf1e4207c 100644
--- a/hw/virtio-scsi.h
+++ b/hw/virtio-scsi.h
@@ -16,6 +16,7 @@
#include "hw/virtio.h"
#include "hw/pci/pci.h"
+#include "hw/scsi.h"
/* The ID for virtio_scsi */
#define VIRTIO_ID_SCSI 8
@@ -31,6 +32,21 @@ struct VirtIOSCSIConf {
uint32_t cmd_per_lun;
};
+typedef struct VirtIOSCSI {
+ VirtIODevice vdev;
+ DeviceState *qdev;
+ VirtIOSCSIConf *conf;
+
+ SCSIBus bus;
+ uint32_t sense_size;
+ uint32_t cdb_size;
+ int resetting;
+ bool events_dropped;
+ VirtQueue *ctrl_vq;
+ VirtQueue *event_vq;
+ VirtQueue *cmd_vqs[0];
+} VirtIOSCSI;
+
#define DEFINE_VIRTIO_SCSI_PROPERTIES(_state, _features_field, _conf_field) \
DEFINE_VIRTIO_COMMON_FEATURES(_state, _features_field), \
DEFINE_PROP_UINT32("num_queues", _state, _conf_field.num_queues, 1), \