From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCMUX-00083j-Ng for qemu-devel@nongnu.org; Tue, 07 Jul 2015 02:36:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCMUU-0007YE-HZ for qemu-devel@nongnu.org; Tue, 07 Jul 2015 02:36:29 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:52779 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCMUU-0007XX-6P for qemu-devel@nongnu.org; Tue, 07 Jul 2015 02:36:26 -0400 Message-ID: <559B7366.5030004@kamp.de> Date: Tue, 07 Jul 2015 08:36:22 +0200 From: Peter Lieven MIME-Version: 1.0 References: <559ABE850200006600045FF0@relay2.provo.novell.com> <559A5B79.4010707@kamp.de> <559BA0D502000066000469BB@relay2.provo.novell.com> <559B68B2.5060402@kamp.de> <559BDB430200006600046AB4@relay2.provo.novell.com> <559B6BBE.3050500@kamp.de> <559BE35A0200006600046B3E@relay2.provo.novell.com> In-Reply-To: <559BE35A0200006600046B3E@relay2.provo.novell.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] vpc size reporting problem List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chun Yan Liu , qemu-devel@nongnu.org Cc: kwolf@redhat.com, mreitz@redhat.com Am 07.07.2015 um 08:34 schrieb Chun Yan Liu: > >>>> On 7/7/2015 at 02:19 PM, in message <559B6F79.237 : 102 : 21807>, Chun Yan Liu > wrote: >> >>>>> On 7/7/2015 at 02:03 PM, in message <559B6BBE.3050500@kamp.de>, Peter Lieven >> wrote: >>> 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 >>>> 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 >>>>>> 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? > And imported to a Win7 guest on KVM as IDE device, it's also reported as > 1024MB (not CHS value, CHS is 1023MB). And what storage driver reports 1023MB under Qemu? Peter