From 47c063403065793ad6e1d2fdde27d69a00880752 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 14 Jan 2010 14:44:12 +0100 Subject: ide: device version property This patch adds a new property named 'ver' to ide-drive which allows to specify the version which the virtual disk/cdrom should report to the guest. By default this is the qemu version (i.e. 0.12). usage: -drive if=none,id=disk,file=... -device ide-drive,bus=ide.0,unit=0,drive=disk,ver=42 You can also switch the version for all ide drives using: -global ide-drive.ver=42 Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori --- hw/ide/qdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hw/ide/qdev.c') diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 81e79950db..0b84a4f1d0 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -99,7 +99,7 @@ typedef struct IDEDrive { static int ide_drive_initfn(IDEDevice *dev) { IDEBus *bus = DO_UPCAST(IDEBus, qbus, dev->qdev.parent_bus); - ide_init_drive(bus->ifs + dev->unit, dev->dinfo); + ide_init_drive(bus->ifs + dev->unit, dev->dinfo, dev->version); return 0; } @@ -110,6 +110,7 @@ static IDEDeviceInfo ide_drive_info = { .qdev.props = (Property[]) { DEFINE_PROP_UINT32("unit", IDEDrive, dev.unit, -1), DEFINE_PROP_DRIVE("drive", IDEDrive, dev.dinfo), + DEFINE_PROP_STRING("ver", IDEDrive, dev.version), DEFINE_PROP_END_OF_LIST(), } }; -- cgit v1.2.1