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 <arm...@redhat.com>
> ---
>  hw/hd-geometry.c |   17 +++++++----------
>  1 files changed, 7 insertions(+), 10 deletions(-)

Kevin

Reply via email to