From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Jin Subject: [PATCH 1/2] QEMU: Don't set all to default C/H/S when vm heads>16 Date: Fri, 6 Aug 2010 07:41:59 +0800 Message-ID: <20100805234159.GA22183@joejin-pc.cn.oracle.com> References: <20100805233516.GB21473@joejin-pc.cn.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20100805233516.GB21473@joejin-pc.cn.oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson , Keir Fraser , Zhenzhong Duan Cc: haobo.zhou@oracle.com, greg.marsden@oracle.com, joe.jin@oracle.com, xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Hi, Current qemu set all C/H/S to default(16383/16/63), when image file converted from physical scsi/raid disk, use default will cause failed to boot the VM. Signed-off-by: Zhenzhong Duan Signed-off-by: Joe Jin --- block.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 05ff8cb..519f955 100644 --- a/block.c +++ b/block.c @@ -890,7 +890,15 @@ void bdrv_guess_geometry(BlockDriverState *bs, int *pcyls, int *pheads, int *pse *psecs = secs; } else { if (guess_disk_lchs(bs, &cylinders, &heads, &secs) == 0) { - if (heads > 16) { + if(secs == 32){ + /* if image file convert from physical disk to and + physical partition on scsi, sector = 32, if set + it to default will failed to boot up it */ + *pcyls = cylinders; + *pheads = heads; + *psecs = secs; + bdrv_set_translation_hint(bs, BIOS_ATA_TRANSLATION_LBA); + } else if (heads > 16) { /* if heads > 16, it means that a BIOS LBA translation was active, so the default hardware geometry is OK */