summary refs log tree commit diff stats
path: root/hw/ide/core.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2012-07-10 11:12:53 +0200
committerKevin Wolf <kwolf@redhat.com>2012-07-17 16:48:32 +0200
commit2adc99b277ab05877ef847bddde45346378f561a (patch)
treeda0313df8aa57f7ec78584464783689f7a6dae71 /hw/ide/core.c
parent4e4e6e319b5508289da0f2966f63c841c832b847 (diff)
downloadfocaccia-qemu-2adc99b277ab05877ef847bddde45346378f561a.tar.gz
focaccia-qemu-2adc99b277ab05877ef847bddde45346378f561a.zip
hd-geometry: Compute BIOS CHS translation in one place
Currently, it is split between hd_geometry_guess() and
pc_cmos_init_late().  Confusing.  info qtree shows the result of the
former.  Also confusing.

Fold the part done in pc_cmos_init_late() into hd_geometry_guess().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide/core.c')
-rw-r--r--hw/ide/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index bf1ce8968a..1ca7cdf7d0 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2091,6 +2091,8 @@ void ide_init2_with_non_qdev_drives(IDEBus *bus, DriveInfo *hd0,
             trans = dinfo->trans;
             if (!cyls && !heads && !secs) {
                 hd_geometry_guess(dinfo->bdrv, &cyls, &heads, &secs, &trans);
+            } else if (trans == BIOS_ATA_TRANSLATION_AUTO) {
+                trans = hd_bios_chs_auto_trans(cyls, heads, secs);
             }
             if (ide_init_drive(&bus->ifs[i], dinfo->bdrv,
                                dinfo->media_cd ? IDE_CD : IDE_HD, NULL,