summary refs log tree commit diff stats
path: root/hw/scsi.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-08-03 10:49:11 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-12 08:29:01 -0500
commit2599aece1b222ad4f9714275b38bf1d3e9424b54 (patch)
tree9686afba8135e2adc971717210555aa871a053de /hw/scsi.h
parentc39ce112b60ffafbaf700853e32bea74cbb2c148 (diff)
downloadfocaccia-qemu-2599aece1b222ad4f9714275b38bf1d3e9424b54.tar.gz
focaccia-qemu-2599aece1b222ad4f9714275b38bf1d3e9424b54.zip
scsi: introduce SCSICommand
This struct is currently unnamed.  Give it a name and use it
explicitly to decouple (some parts of) CDB parsing from
SCSIRequest.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/scsi.h')
-rw-r--r--hw/scsi.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/hw/scsi.h b/hw/scsi.h
index 7ed7550715..f29d65fd56 100644
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -11,6 +11,7 @@
 
 typedef struct SCSIBus SCSIBus;
 typedef struct SCSIBusOps SCSIBusOps;
+typedef struct SCSICommand SCSICommand;
 typedef struct SCSIDevice SCSIDevice;
 typedef struct SCSIDeviceInfo SCSIDeviceInfo;
 typedef struct SCSIRequest SCSIRequest;
@@ -30,6 +31,14 @@ typedef struct SCSISense {
 
 #define SCSI_SENSE_BUF_SIZE 96
 
+struct SCSICommand {
+    uint8_t buf[SCSI_CMD_BUF_SIZE];
+    int len;
+    size_t xfer;
+    uint64_t lba;
+    enum SCSIXferMode mode;
+};
+
 struct SCSIRequest {
     SCSIBus           *bus;
     SCSIDevice        *dev;
@@ -38,13 +47,7 @@ struct SCSIRequest {
     uint32_t          tag;
     uint32_t          lun;
     uint32_t          status;
-    struct {
-        uint8_t buf[SCSI_CMD_BUF_SIZE];
-        int len;
-        size_t xfer;
-        uint64_t lba;
-        enum SCSIXferMode mode;
-    } cmd;
+    SCSICommand       cmd;
     BlockDriverAIOCB  *aiocb;
     uint8_t sense[SCSI_SENSE_BUF_SIZE];
     uint32_t sense_len;