From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyR16-0007CX-N3 for qemu-devel@nongnu.org; Mon, 16 Nov 2015 16:08:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyR12-0005C8-MP for qemu-devel@nongnu.org; Mon, 16 Nov 2015 16:08:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyR12-0005Bw-Fb for qemu-devel@nongnu.org; Mon, 16 Nov 2015 16:08:44 -0500 References: <1447428724-28116-1-git-send-email-lpetrut@cloudbasesolutions.com> <564A4389.6010903@redhat.com> From: Max Reitz Message-ID: <564A45D8.2020807@redhat.com> Date: Mon, 16 Nov 2015 22:08:40 +0100 MIME-Version: 1.0 In-Reply-To: <564A4389.6010903@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="14CLx41q9EjAK27I1IvejFXm3x7S2vmwx" Subject: Re: [Qemu-devel] block/vpc: Fix vhd extra sectors issue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lucian Petrut , qemu-devel@nongnu.org Cc: kwolf@redhat.com, Lucian Petrut , Peter Lieven This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --14CLx41q9EjAK27I1IvejFXm3x7S2vmwx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 16.11.2015 21:58, Max Reitz wrote: > On 13.11.2015 16:32, Lucian Petrut wrote: >> >> At the moment, qemu-img extends new image virtual sizes based >> on the CHS algorithm provided by the VHD specs in order to >> ensure that the disk geometry (and payload as seen by some >> guests which use the CHS value) can fit in the requested disk. >> >> This patch drops this behavior, as it breaks compatibility with >> Azure, which requires the MB alignment to be preserved. >> >> Signed-off-by: Lucian Petrut >> --- >> Proposed fix for https://bugs.launchpad.net/qemu/+bug/1490611 >> >> block/vpc.c | 32 ++++++++------------------------ >> 1 file changed, 8 insertions(+), 24 deletions(-) >> >=20 > CC-ing Peter. >=20 > Looks right, considering page 7 of the spec: >=20 > (http://download.microsoft.com/download/f/f/e/ffef50a5-07dd-4cf8-aaa3-4= 42c0673a029/Virtual%20Hard%20Disk%20Format%20Spec_10_18_06.doc) >=20 > "When the user creates a hard disk of a certain size, the size of the > hard disk image in the virtual machine is smaller than that created by > the user. This is because CHS value calculated from the hard disk size > is rounded down." >=20 > However, this patch looks incomplete, note the comment you are removing= : > "This ensures that qemu-img convert doesn't truncate images". This is > because vpc_open() prefers the CHS size over the current_size value, an= d > as far as I remember there was indeed a good reason for that (some > application had invalid values for current_size, or something like that= ). >=20 > So at the very least, we will have to change vpc_open() to always use > the value from footer->current_size and ignore > footer->{cyls,heads,secs_per_cyl}, otherwise qemu will always consider > these images smaller than they actually are (which is bad, at least whe= n > converting images). >=20 > But I'd like to know from Peter whether he remembers the reason why > vpc_open() tries to ignore footer->current_size in the first place... OK, so it was just qemu-devel having hiccups again. Now the mails are rolling in... > Max >=20 >=20 > PS: If possible, the "From: " header in an emailed patch should match > the Signed-off-by line. I think. It doesn't state that in > http://wiki.qemu.org/Contribute/SubmitAPatch, but the commit looks > strange otherwise. So I guess if it isn't reasonably possible, it's not= > too bad. :-) >=20 --14CLx41q9EjAK27I1IvejFXm3x7S2vmwx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWSkXYAAoJEDuxQgLoOKytA1EH/0Qh/VCIDMYGsx10ThXVykg2 jEtue28+s0ZDnX7z/KD3xpLAVIrIA5AfQ8uOIwdghjl427ar/WaeJQrzmW6WccV2 zP7lQEEO4MSTfNdx01SdeK62HNv6QB/+q0pchdVoCASTTX9sDiKm5wJ3N9qdYrp1 T3fSHHWgsjYtF60igjJrtKISh8JlpAwcT7m4P4KWWiswv3eArlsD+SmpEkmZJze8 9S3ybrJEYlJruefVsiw6MqqGKYmeL/gvT2/F+VAKCV5rqOTEjktwJI9Z334qEl91 3Kq0/dBHFGB5qyHOoJ74TGS61nprwHYASYfzQuRjguK/yhGXdybofOu/rUXVa+8= =JDeS -----END PGP SIGNATURE----- --14CLx41q9EjAK27I1IvejFXm3x7S2vmwx--