summaryrefslogtreecommitdiff
path: root/hw/ide/qdev.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2010-01-14 14:44:12 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2010-01-19 16:31:04 -0600
commit47c063403065793ad6e1d2fdde27d69a00880752 (patch)
tree1126fed51a7c0d0a382bae6aa3f32e31b4b401b2 /hw/ide/qdev.c
parentf039a563f200beee80cc10fd70b21ea396979dab (diff)
downloadqemu-47c063403065793ad6e1d2fdde27d69a00880752.tar.gz
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 <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ide/qdev.c')
-rw-r--r--hw/ide/qdev.c3
1 files changed, 2 insertions, 1 deletions
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(),
}
};