From bf011293faaa7f87e4de83185931e7411b794128 Mon Sep 17 00:00:00 2001 From: john cooper Date: Mon, 22 Jun 2009 14:26:51 -0400 Subject: 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 Signed-off-by: Anthony Liguori --- sysemu.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sysemu.h') 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 -- cgit v1.2.3