qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Lieven <pl@kamp.de>
To: Chun Yan Liu <cyliu@suse.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, mreitz@redhat.com
Subject: Re: [Qemu-devel] vpc size reporting problem
Date: Tue, 07 Jul 2015 08:03:42 +0200	[thread overview]
Message-ID: <559B6BBE.3050500@kamp.de> (raw)
In-Reply-To: <559BDB430200006600046AB4@relay2.provo.novell.com>

Am 07.07.2015 um 07:59 schrieb Chun Yan Liu:
>
>>>> On 7/7/2015 at 01:50 PM, in message <559B68B2.5060402@kamp.de>, Peter Lieven
> <pl@kamp.de> wrote:
>> Am 07.07.2015 um 03:50 schrieb Chun Yan Liu:
>>>>>> On 7/6/2015 at 06:42 PM, in message <559A5B79.4010707@kamp.de>, Peter Lieven
>>> <pl@kamp.de> wrote:
>>>> Am 06.07.2015 um 11:44 schrieb Chun Yan Liu:
>>>>> While testing with a 1GB VHD file created on win7, found that the VHD file
>>>>> size reported on Windows is different from that is reported by qemu-img
>>>>> info or within a Linux KVM guest.
>>>>>
>>>>> Created a dynamic VHD file on win7, on Windows, it is reported 1024MB
>>>>> (2097152 sectors). But with qemu-img info or within a Linux KVM guest,
>>>>> it is reported 1023MB (2096640 sectors).
>>>>>
>>>>> The values in the footer_buf are as follows:
>>>>> creator_app: "win "
>>>>> cylinders: 0x820 (2080)
>>>>> heads: 0x10 (16)
>>>>> cyl/sec: 0x3f (63)
>>>>> current_size: 0x40000000 (1G)
>>>>>
>>>>> So, if using current_size, it's correct; but using CHS will get a smaller
>>>> size.
>>>>> Should we add a check in this case and use "current_size" instead of
>>>>> CHS?
>>>>     
>>>> As far as I remember the issue was and still is that there is no official
>>>> spec that says
>>>> use current_size in case A and CHS in case B.
>>> Understand.
>>>
>>>>     
>>>> If currrent_size is greater than CHS and Windows would use CHS (we don't
>>>> know that) we might run into issues if Qemu uses current_size. In this
>>>> cas we would write data beyond the end of the container (from Windows
>>>> perspective).
>>> That's right. The fact is in our testing we found Windows does not use CHS
>>> but current_size (from testing result), we create and get the VHD parted on
>>> Windows, then take the VHD file into Linux KVM guest, it fails to show
>> partition
>>> table (since the reported disk size is shrinking, some of the partitions
>> extend
>>> beyond the end of the disk).
>>   
>> Which version of Windows are you referring to?
> Tested with WS2012R2 and Win7.

Which storage driver?

I had a look at the specs and in fact they more or less say: Use current_size
and if you have an ATA controller derive the disk size from CHS.

Peter

  reply	other threads:[~2015-07-07  6:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06  9:44 [Qemu-devel] vpc size reporting problem Chun Yan Liu
2015-07-06 10:42 ` Peter Lieven
2015-07-07  1:50   ` Chun Yan Liu
2015-07-07  5:50     ` Peter Lieven
2015-07-07  5:59       ` Chun Yan Liu
2015-07-07  6:03         ` Peter Lieven [this message]
2015-07-07  6:19           ` Chun Yan Liu
2015-07-07  6:33             ` Peter Lieven
2015-07-07  6:34           ` Chun Yan Liu
2015-07-07  6:36             ` Peter Lieven
2015-07-07  7:01               ` Chun Yan Liu

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=559B6BBE.3050500@kamp.de \
    --to=pl@kamp.de \
    --cc=cyliu@suse.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).