From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyQrZ-0004Fd-ND for qemu-devel@nongnu.org; Mon, 16 Nov 2015 15:58:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZyQrV-0001rW-EZ for qemu-devel@nongnu.org; Mon, 16 Nov 2015 15:58:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyQrV-0001rK-83 for qemu-devel@nongnu.org; Mon, 16 Nov 2015 15:58:53 -0500 References: <1447428724-28116-1-git-send-email-lpetrut@cloudbasesolutions.com> From: Max Reitz Message-ID: <564A4389.6010903@redhat.com> Date: Mon, 16 Nov 2015 21:58:49 +0100 MIME-Version: 1.0 In-Reply-To: <1447428724-28116-1-git-send-email-lpetrut@cloudbasesolutions.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="U5LdnvLViA5H51glTrra15OeXrMSkKI1m" 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) --U5LdnvLViA5H51glTrra15OeXrMSkKI1m Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 13.11.2015 16:32, Lucian Petrut wrote: >=20 > 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. >=20 > This patch drops this behavior, as it breaks compatibility with > Azure, which requires the MB alignment to be preserved. >=20 > Signed-off-by: Lucian Petrut > --- > Proposed fix for https://bugs.launchpad.net/qemu/+bug/1490611 >=20 > block/vpc.c | 32 ++++++++------------------------ > 1 file changed, 8 insertions(+), 24 deletions(-) >=20 CC-ing Peter. Looks right, considering page 7 of the spec: (http://download.microsoft.com/download/f/f/e/ffef50a5-07dd-4cf8-aaa3-442= c0673a029/Virtual%20Hard%20Disk%20Format%20Spec_10_18_06.doc) "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." 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, and 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).= 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 when converting images). 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... Max 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. :-) --U5LdnvLViA5H51glTrra15OeXrMSkKI1m 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 iQEcBAEBCAAGBQJWSkOJAAoJEDuxQgLoOKytG5sH/j5qNvIhedL55A+Lrj3z/EP5 lIomogoFCTbXj0QHaVAcPGeU7p8eajsg1tyFsedbJTim6y87PJzb8cSVSUubpgjQ xFsdCmptzwXYA/F1UtF8JUo3WoACzhYX8Y6ZKzadhNAxSMcU9HQcdj4dy6tcShHl HTZ/FaJ517xOkmGAYR6oYolvytgIoPDptfpNmhIrZkyff0F9buGVzDOgCfwxrL9u OBhtPvYs8VB8iVeJBNnTFn+Odw56awXXWNMvO/JmiF6vziaZYrHXay1gQVSvTN50 T2bU/z/WRFNCMOPmbT6pf+XKDSsai9mvkDMxFisU3WKLQU0iigd0twGetO8/i2Y= =drFY -----END PGP SIGNATURE----- --U5LdnvLViA5H51glTrra15OeXrMSkKI1m--