Received: from eggs.gnu.org ([2001:4830:134:3::10]:33028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCMsb-00089I-Q2 for qemu-devel@nongnu.org; Tue, 07 Jul 2015 03:01:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCMsY-0005xB-Gq for qemu-devel@nongnu.org; Tue, 07 Jul 2015 03:01:21 -0400 Received: from relay2.provo.novell.com ([137.65.250.214]:47928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCMsY-0005wp-A2 for qemu-devel@nongnu.org; Tue, 07 Jul 2015 03:01:18 -0400 Message-Id: <559BE9B70200006600046B83@relay2.provo.novell.com> Date: Tue, 07 Jul 2015 01:01:11 -0600 From: "Chun Yan Liu" 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> <559B7366.5030004@kamp.de> In-Reply-To: <559B7366.5030004@kamp.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: [Qemu-devel] vpc size reporting problem List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , qemu-devel@nongnu.org Cc: kwolf@redhat.com, mreitz@redhat.com >>> On 7/7/2015 at 02:36 PM, in message <559B7366.5030004@kamp.de>, Peter = Lieven wrote:=20 > Am 07.07.2015 um 08:34 schrieb Chun Yan Liu:=20 > >=20 > >>>> On 7/7/2015 at 02:19 PM, in message <559B6F79.237 : 102 : 21807>, = Chun Yan =20 > Liu=20 > > wrote:=20 > >> =20 > >>>>> On 7/7/2015 at 02:03 PM, in message <559B6BBE.3050500@kamp.de>, = Peter Lieven=20 > >> wrote:=20 > >>> Am 07.07.2015 um 07:59 schrieb Chun Yan Liu:=20 > >>>> =20 > >>>>>>> On 7/7/2015 at 01:50 PM, in message <559B68B2.5060402@kamp.de>, = Peter Lieven=20 > >>>> wrote:=20 > >>>>> Am 07.07.2015 um 03:50 schrieb Chun Yan Liu:=20 > >>>>>>>>> On 7/6/2015 at 06:42 PM, in message <559A5B79.4010707@kamp.de>,= Peter Lieven=20 > >>>>>> wrote:=20 > >>>>>>> Am 06.07.2015 um 11:44 schrieb Chun Yan Liu:=20 > >>>>>>>> While testing with a 1GB VHD file created on win7, found that = the VHD file=20 > >>>>>>>> size reported on Windows is different from that is reported by = qemu-img=20 > >>>>>>>> info or within a Linux KVM guest.=20 > >>>>>>>> =20 > >>>>>>>> Created a dynamic VHD file on win7, on Windows, it is reported = 1024MB=20 > >>>>>>>> (2097152 sectors). But with qemu-img info or within a Linux KVM = guest,=20 > >>>>>>>> it is reported 1023MB (2096640 sectors).=20 > >>>>>>>> =20 > >>>>>>>> The values in the footer_buf are as follows:=20 > >>>>>>>> creator_app: "win "=20 > >>>>>>>> cylinders: 0x820 (2080)=20 > >>>>>>>> heads: 0x10 (16)=20 > >>>>>>>> cyl/sec: 0x3f (63)=20 > >>>>>>>> current_size: 0x40000000 (1G)=20 > >>>>>>>> =20 > >>>>>>>> So, if using current_size, it's correct; but using CHS will get = a smaller=20 > >>>>>>> size.=20 > >>>>>>>> Should we add a check in this case and use "current_size" = instead of=20 > >>>>>>>> CHS?=20 > >>>>>>> =20 > >>>>>>> As far as I remember the issue was and still is that there is no = official=20 > >>>>>>> spec that says=20 > >>>>>>> use current_size in case A and CHS in case B.=20 > >>>>>> Understand.=20 > >>>>>> =20 > >>>>>>> =20 > >>>>>>> If currrent_size is greater than CHS and Windows would use CHS = (we don't=20 > >>>>>>> know that) we might run into issues if Qemu uses current_size. = In this=20 > >>>>>>> cas we would write data beyond the end of the container (from = Windows=20 > >>>>>>> perspective).=20 > >>>>>> That's right. The fact is in our testing we found Windows does = not use CHS=20 > >>>>>> but current_size (from testing result), we create and get the VHD = parted on=20 > >>>>>> Windows, then take the VHD file into Linux KVM guest, it fails to = show=20 > >>>>> partition=20 > >>>>>> table (since the reported disk size is shrinking, some of the = partitions=20 > >>>>> extend=20 > >>>>>> beyond the end of the disk).=20 > >>>>> =20 > >>>>> Which version of Windows are you referring to?=20 > >>>> Tested with WS2012R2 and Win7.=20 > >>> =20 > >>> Which storage driver?=20 > > And imported to a Win7 guest on KVM as IDE device, it's also reported = as=20 > > 1024MB (not CHS value, CHS is 1023MB).=20 > =20 > And what storage driver reports 1023MB under Qemu?=20 SCSI driver under Linux guest. > =20 > Peter > =20 > =20 > =20 > =20