[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 13/32] hd-geometry: Clean up confusing use of pr
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 13/32] hd-geometry: Clean up confusing use of prior translation hint |
Date: |
Thu, 05 Jul 2012 11:16:44 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Am 29.06.2012 17:34, schrieb Markus Armbruster:
> 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 to for the
s/to//
> 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 <address@hidden>
> ---
> hw/hd-geometry.c | 17 +++++++----------
> 1 files changed, 7 insertions(+), 10 deletions(-)
Kevin
- Re: [Qemu-devel] [PATCH 13/32] hd-geometry: Clean up confusing use of prior translation hint,
Kevin Wolf <=