aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-blk.h
diff options
context:
space:
mode:
authorjohn cooper <john.cooper@redhat.com>2009-06-22 14:26:51 -0400
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-24 09:09:15 -0500
commitbf011293faaa7f87e4de83185931e7411b794128 (patch)
tree4dca80354e9db089a43ac87aa41e220d51c32ad0 /hw/virtio-blk.h
parent024589f182232c6e4f566ca4b30bd477f20b4257 (diff)
Add serial number support for virtio_blk
[brought forward to current qemu-kvm.git] This patch implements the missing qemu logic to interpret a '-drive .. serial=XYZ ..' flag for a virtio_blk device. The serial number string is contained in a skeletal IDENTIFY DEVICE data structure and this structure is made available to the guest virtio_blk driver via pci i/o region 0. Signed-off-by: john cooper <john.cooper@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-blk.h')
-rw-r--r--hw/virtio-blk.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/virtio-blk.h b/hw/virtio-blk.h
index dff3e0c979..1be4342706 100644
--- a/hw/virtio-blk.h
+++ b/hw/virtio-blk.h
@@ -30,6 +30,11 @@
#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 */
+#define VIRTIO_BLK_F_IDENTIFY 8 /* ATA IDENTIFY supported */
+
+#define VIRTIO_BLK_ID_LEN 256 /* length of identify u16 array */
+#define VIRTIO_BLK_ID_SN 10 /* start of char * serial# */
+#define VIRTIO_BLK_ID_SN_BYTES 20 /* length in bytes of serial# */
struct virtio_blk_config
{
@@ -39,6 +44,8 @@ struct virtio_blk_config
uint16_t cylinders;
uint8_t heads;
uint8_t sectors;
+ uint32_t _blk_size; /* structure pad, currently unused */
+ uint16_t identify[VIRTIO_BLK_ID_LEN];
} __attribute__((packed));
/* These two define direction. */