qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] vpc size reporting problem


From: Peter Lieven
Subject: Re: [Qemu-devel] vpc size reporting problem
Date: Mon, 06 Jul 2015 12:42:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

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.

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).


BTW, before commit 0444dceee, there is a similar check for 'd2v',
if creator_app is 'd2v', using "size" instead of CHS. But in commit
0444dceee, this check is removed. To me, the new check and 'd2v'
check seem to be two different cases, why removing 'd2v' check?

d2v always writes a magic combination of 65535x16x255 for CHS. So commit
0444dceee just changed the behaviour to always use current_size in
case CHS is 65535x16x255 (including d2v).

I personally wouldn't mind to always use current_size that is what e.g. 
VirtualBox does.
Or use current_size if it is greater than the size derived from CHS. But this 
might
break things.

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]