diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2024-02-20 17:09:30 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-02-28 00:23:39 +0100 |
commit | d13f40357b307e49a7983bd52d4ec35003b7ddc0 (patch) | |
tree | ba75f17e3f1d5a1c293ae6d616fb381cdcd9c46b /hw/ide | |
parent | dcaff46101c1f3abd97bbc5ba2f6c904def4e3b3 (diff) |
ide, vl: turn -win2k-hack into a property on IDE devices
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/ide')
-rw-r--r-- | hw/ide/core.c | 3 | ||||
-rw-r--r-- | hw/ide/ide-dev.c | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c index 501df37faa..e8cb2dac92 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -1059,7 +1059,7 @@ static void ide_sector_write_cb(void *opaque, int ret) ide_sector_write); } - if (win2k_install_hack && ((++s->irq_count % 16) == 0)) { + if (s->win2k_install_hack && ((++s->irq_count % 16) == 0)) { /* It seems there is a bug in the Windows 2000 installer HDD IDE driver which fills the disk with empty logs when the IDE write IRQ comes too early. This hack tries to correct @@ -2597,6 +2597,7 @@ int ide_init_drive(IDEState *s, IDEDevice *dev, IDEDriveKind kind, Error **errp) s->drive_kind = kind; blk_get_geometry(s->blk, &nb_sectors); + s->win2k_install_hack = dev->win2k_install_hack; s->cylinders = dev->conf.cyls; s->heads = s->drive_heads = dev->conf.heads; s->sectors = s->drive_sectors = dev->conf.secs; diff --git a/hw/ide/ide-dev.c b/hw/ide/ide-dev.c index 722c4e78ca..03f7967798 100644 --- a/hw/ide/ide-dev.c +++ b/hw/ide/ide-dev.c @@ -31,6 +31,7 @@ static Property ide_props[] = { DEFINE_PROP_UINT32("unit", IDEDevice, unit, -1), + DEFINE_PROP_BOOL("win2k-install-hack", IDEDevice, win2k_install_hack, false), DEFINE_PROP_END_OF_LIST(), }; |