From patchwork Fri Nov 18 14:03:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 126426 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 40232B7261 for ; Sat, 19 Nov 2011 02:02:57 +1100 (EST) Received: from localhost ([::1]:35525 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RROzn-0000Sb-C0 for incoming@patchwork.ozlabs.org; Fri, 18 Nov 2011 09:00:47 -0500 Received: from eggs.gnu.org ([140.186.70.92]:33816) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RROzH-0007fj-IY for qemu-devel@nongnu.org; Fri, 18 Nov 2011 09:00:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RROzF-0002Wt-Ug for qemu-devel@nongnu.org; Fri, 18 Nov 2011 09:00:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RROzF-0002Wc-GH for qemu-devel@nongnu.org; Fri, 18 Nov 2011 09:00:13 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAIE0Bdm015794 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Nov 2011 09:00:12 -0500 Received: from dhcp-5-188.str.redhat.com (vpn1-6-61.ams2.redhat.com [10.36.6.61]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pAIE04Pa006395; Fri, 18 Nov 2011 09:00:10 -0500 From: Kevin Wolf To: anthony@codemonkey.ws Date: Fri, 18 Nov 2011 15:03:07 +0100 Message-Id: <1321624993-19033-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1321624993-19033-1-git-send-email-kwolf@redhat.com> References: <1321624993-19033-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 3/9] scsi-disk: guess geometry X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Paolo Bonzini Old operating systems rely on correct geometry to convert from CHS addresses to LBA. Providing correct data is necessary for them to boot. Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- hw/scsi-disk.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index cc4f9ef..73de0f6 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -797,7 +797,7 @@ static int mode_sense_page(SCSIDiskState *s, int page, uint8_t **p_outbuf, break; } /* if a geometry hint is available, use it */ - bdrv_get_geometry_hint(bdrv, &cylinders, &heads, &secs); + bdrv_guess_geometry(bdrv, &cylinders, &heads, &secs); p[2] = (cylinders >> 16) & 0xff; p[3] = (cylinders >> 8) & 0xff; p[4] = cylinders & 0xff; @@ -831,7 +831,7 @@ static int mode_sense_page(SCSIDiskState *s, int page, uint8_t **p_outbuf, p[2] = 5000 >> 8; p[3] = 5000 & 0xff; /* if a geometry hint is available, use it */ - bdrv_get_geometry_hint(bdrv, &cylinders, &heads, &secs); + bdrv_guess_geometry(bdrv, &cylinders, &heads, &secs); p[4] = heads & 0xff; p[5] = secs & 0xff; p[6] = s->qdev.blocksize >> 8;