WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 1/2] QEMU: Don't set all to default C/H/S when vm hea

To: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, Zhenzhong Duan <zhenzhong.duan@xxxxxxxxxx>
Subject: [Xen-devel] [PATCH 1/2] QEMU: Don't set all to default C/H/S when vm heads>16
From: Joe Jin <joe.jin@xxxxxxxxxx>
Date: Fri, 6 Aug 2010 07:41:59 +0800
Cc: haobo.zhou@xxxxxxxxxx, greg.marsden@xxxxxxxxxx, joe.jin@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 06 Aug 2010 00:40:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20100805233516.GB21473@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20100805233516.GB21473@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.2i
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 <zhenzhong.duan@xxxxxxxxxx>
Signed-off-by: Joe Jin <joe.jin@xxxxxxxxxx>

---
 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 */



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel