summaryrefslogtreecommitdiffstats
path: root/include/hw
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-06-10 16:40:31 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2014-06-18 08:47:11 +0200
commit3eff1f46f08a360a4ae9f834ce9fef4c45bf6f0f (patch)
tree1703f742012410ce6dc2ca1ef27a2f1e3130f691 /include/hw
parenta3de269ccc6f724e40702d8a9adcc3d41d0db369 (diff)
downloadhqemu-3eff1f46f08a360a4ae9f834ce9fef4c45bf6f0f.zip
hqemu-3eff1f46f08a360a4ae9f834ce9fef4c45bf6f0f.tar.gz
virtio-scsi: add support for the any_layout feature
Store the request and response headers by value, and let virtio_scsi_parse_req check that there is only one of datain and dataout. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/i386/pc.h4
-rw-r--r--include/hw/virtio/virtio-scsi.h4
2 files changed, 5 insertions, 3 deletions
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index fa9d997..ca7a0bd 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -268,6 +268,10 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
#define PC_COMPAT_2_0 \
{\
+ .driver = "virtio-scsi-pci",\
+ .property = "any_layout",\
+ .value = "off",\
+ },{\
.driver = "apic",\
.property = "version",\
.value = stringify(0x11),\
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
index 42b1024..de0615b 100644
--- a/include/hw/virtio/virtio-scsi.h
+++ b/include/hw/virtio/virtio-scsi.h
@@ -84,14 +84,13 @@
#define VIRTIO_SCSI_EVT_RESET_RESCAN 1
#define VIRTIO_SCSI_EVT_RESET_REMOVED 2
-/* SCSI command request, followed by data-out */
+/* SCSI command request, followed by CDB and data-out */
typedef struct {
uint8_t lun[8]; /* Logical Unit Number */
uint64_t tag; /* Command identifier */
uint8_t task_attr; /* Task attribute */
uint8_t prio;
uint8_t crn;
- uint8_t cdb[];
} QEMU_PACKED VirtIOSCSICmdReq;
/* Response, followed by sense data and data-in */
@@ -101,7 +100,6 @@ typedef struct {
uint16_t status_qualifier; /* Status qualifier */
uint8_t status; /* Command completion status */
uint8_t response; /* Response values */
- uint8_t sense[];
} QEMU_PACKED VirtIOSCSICmdResp;
/* Task Management Request */
OpenPOWER on IntegriCloud