mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
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>
This commit is contained in:
parent
024589f182
commit
bf011293fa
3 changed files with 65 additions and 1 deletions
4
sysemu.h
4
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue