aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi-disk.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2012-07-10 11:12:36 +0200
committerKevin Wolf <kwolf@redhat.com>2012-07-17 16:48:30 +0200
commitdc28c0cd30d7b122500b17eedc7e070624fd7c86 (patch)
tree589893555d582b68dc0f0a5e2a86300c56c60855 /hw/scsi-disk.c
parent82b11662be5b6e462ae843363b316779a9c88a61 (diff)
downloadqemu-dc28c0cd30d7b122500b17eedc7e070624fd7c86.zip
qemu-dc28c0cd30d7b122500b17eedc7e070624fd7c86.tar.gz
qemu-dc28c0cd30d7b122500b17eedc7e070624fd7c86.tar.bz2
hd-geometry: Clean up confusing use of prior translation hint
When hd_geometry_guess() picks a geometry, it also picks the appropriate translation, but only when the prior translation hint is BIOS_ATA_TRANSLATION_AUTO. Looks wrong, because such a prior translation would be passed to the BIOS whether it's suitable for the geometry or not. Fortunately, that can't happen. There are just two ways for the translation hint to get set to something other than BIOS_ATA_TRANSLATION_AUTO: drive_init() on behalf of -drive trans=..., and hd_geometry_guess(). Both set it only when they also set a valid geometry hint, i.e. one with a non-zero number of cylinders. Since hd_geometry_guess() returns right away when it finds a valid geometry hint, translation can only be BIOS_ATA_TRANSLATION_AUTO in the remainder of the function. Assert this, and simplify accordingly. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/scsi-disk.c')
0 files changed, 0 insertions, 0 deletions