summary refs log tree commit diff stats
path: root/hw/virtio-blk.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-04-27 10:29:14 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-01 09:44:10 -0500
commit1063b8b15fb49fcf88ffa282b19aaaf7ca9c678c (patch)
tree10b9005227477ddef237eaa79e68281b8f342772 /hw/virtio-blk.h
parent451c4abd8c6a65106e14f8a9a9eacf70c4fa9727 (diff)
downloadfocaccia-qemu-1063b8b15fb49fcf88ffa282b19aaaf7ca9c678c.tar.gz
focaccia-qemu-1063b8b15fb49fcf88ffa282b19aaaf7ca9c678c.zip
virtio-blk: add SGI_IO passthru support
[had the qemu list address wrong the first time, reply to this message,
 not the previous if you were on Cc]

Add support for SG_IO passthru (packet commands) to the virtio-blk
backend.  Conceptually based on an older patch from Hannes Reinecke
but largely rewritten to match the code structure and layering in
virtio-blk.

Note that currently we issue the hose SG_IO synchronously.  We could
easily switch to async I/O, but that would required either bloating
the VirtIOBlockReq by the size of struct sg_io_hdr or an additional
memory allocation for each SG_IO request.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-blk.h')
-rw-r--r--hw/virtio-blk.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/virtio-blk.h b/hw/virtio-blk.h
index 8c91e1ece6..d11f484945 100644
--- a/hw/virtio-blk.h
+++ b/hw/virtio-blk.h
@@ -28,6 +28,9 @@
 #define VIRTIO_BLK_F_SIZE_MAX   1       /* Indicates maximum segment size */
 #define VIRTIO_BLK_F_SEG_MAX    2       /* Indicates maximum # of segments */
 #define VIRTIO_BLK_F_GEOMETRY   4       /* Indicates support of legacy geometry */
+#define VIRTIO_BLK_F_RO         5       /* Disk is read-only */
+#define VIRTIO_BLK_F_BLK_SIZE   6       /* Block size of disk is available*/
+#define VIRTIO_BLK_F_SCSI       7       /* Supports scsi command passthru */
 
 struct virtio_blk_config
 {
@@ -70,6 +73,15 @@ struct virtio_blk_inhdr
     unsigned char status;
 };
 
+/* SCSI pass-through header */
+struct virtio_scsi_inhdr
+{
+    uint32_t errors;
+    uint32_t data_len;
+    uint32_t sense_len;
+    uint32_t residual;
+};
+
 void *virtio_blk_init(PCIBus *bus, BlockDriverState *bs);
 
 #endif