aboutsummaryrefslogtreecommitdiff
path: root/sysemu.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 /sysemu.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 'sysemu.h')
-rw-r--r--sysemu.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysemu.h b/sysemu.h
index d77de09c1c..aa036bfd1f 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -154,6 +154,8 @@ typedef enum {
BLOCK_ERR_STOP_ANY
} BlockInterfaceErrorAction;
+#define BLOCK_SERIAL_STRLEN 20
+
typedef struct DriveInfo {
BlockDriverState *bdrv;
const char *devaddr;
@@ -163,7 +165,7 @@ typedef struct DriveInfo {
int used;
int drive_opt_idx;
BlockInterfaceErrorAction onerror;
- char serial[21];
+ char serial[BLOCK_SERIAL_STRLEN + 1];
} DriveInfo;
#define MAX_IDE_DEVS 2