xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Joe Jin <joe.jin@oracle.com>
To: Ian Jackson <ian.jackson@eu.citrix.com>,
	Keir Fraser <keir.fraser@eu.citrix.com>,
	Zhenzhong Duan <zhenzhong.duan@oracle.com>
Cc: haobo.zhou@oracle.com, greg.marsden@oracle.com,
	joe.jin@oracle.com, xen-devel@lists.xensource.com
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	[thread overview]
Message-ID: <20100805234159.GA22183@joejin-pc.cn.oracle.com> (raw)
In-Reply-To: <20100805233516.GB21473@joejin-pc.cn.oracle.com>

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@oracle.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>

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

  reply	other threads:[~2010-08-05 23:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-05 23:35 [PATCH 0/2] Fix could not boot vm image which converted from phy-partition Joe Jin
2010-08-05 23:41 ` Joe Jin [this message]
2010-08-05 23:49 ` [PATCH 2/2] hvmloader->rombios use C/H/S, LBA when have been set by qemu Joe Jin
2010-08-10 15:50 ` [PATCH 0/2] Fix could not boot vm image which converted from phy-partition Ian Jackson
2010-08-11  8:00   ` Joe Jin
2010-10-25  5:53 ` [PATCH 2/2] hvmloader->rombios use C/H/S, LBA when have been set by qemu DuanZhenzhong
2010-10-26 16:23   ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100805234159.GA22183@joejin-pc.cn.oracle.com \
    --to=joe.jin@oracle.com \
    --cc=greg.marsden@oracle.com \
    --cc=haobo.zhou@oracle.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=zhenzhong.duan@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).