[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.