From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnuIr-0002jS-Ic for qemu-devel@nongnu.org; Mon, 10 Nov 2014 14:07:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XnuIl-00021E-Ea for qemu-devel@nongnu.org; Mon, 10 Nov 2014 14:07:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnuIl-000213-6f for qemu-devel@nongnu.org; Mon, 10 Nov 2014 14:06:59 -0500 Message-ID: <54610CCD.8010108@redhat.com> Date: Mon, 10 Nov 2014 12:06:53 -0700 From: Eric Blake MIME-Version: 1.0 References: <1415627159-15941-1-git-send-email-mreitz@redhat.com> <1415627159-15941-3-git-send-email-mreitz@redhat.com> In-Reply-To: <1415627159-15941-3-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BBMXsP6b4iSXHBfkkIGLqtTMRXkON1JC3" Subject: Re: [Qemu-devel] [PATCH 02/21] qcow2: Add refcount_width to format-specific info List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Peter Lieven , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BBMXsP6b4iSXHBfkkIGLqtTMRXkON1JC3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/10/2014 06:45 AM, Max Reitz wrote: > Add the bit width of every refcount entry to the format-specific > information. >=20 > This breaks some test outputs, fix them. >=20 > Signed-off-by: Max Reitz > --- > block/qcow2.c | 4 +++- > qapi/block-core.json | 5 ++++- > tests/qemu-iotests/060.out | 1 + > tests/qemu-iotests/065 | 23 +++++++++++++++-------- > tests/qemu-iotests/067.out | 10 +++++----- > tests/qemu-iotests/082.out | 7 +++++++ > tests/qemu-iotests/089.out | 2 ++ > 7 files changed, 37 insertions(+), 15 deletions(-) >=20 > diff --git a/block/qcow2.c b/block/qcow2.c > index f57aff9..d70e927 100644 > --- a/block/qcow2.c > +++ b/block/qcow2.c > @@ -2475,7 +2475,8 @@ static ImageInfoSpecific *qcow2_get_specific_info= (BlockDriverState *bs) > }; > if (s->qcow_version =3D=3D 2) { > *spec_info->qcow2 =3D (ImageInfoSpecificQCow2){ > - .compat =3D g_strdup("0.10"), > + .compat =3D g_strdup("0.10"), > + .refcount_width =3D s->refcount_bits, Hmm - is it really worth displaying a constant? Since the 0.10 format cannot change the width from 16, I'm not sure if it adds anything to the output to display it. After all, there's other things we omit for the old format when they cannot be altered (such as the state of a lazy flag). On the other hand, if it makes your changes to later iotests easier for tests that operate on both image formats, I'm not opposed to i= t. > +++ b/tests/qemu-iotests/065 > @@ -88,34 +88,41 @@ class TestQMP(TestImageInfoSpecific): > class TestQCow2(TestQemuImgInfo): > '''Testing a qcow2 version 2 image''' > img_options =3D 'compat=3D0.10' > - json_compare =3D { 'compat': '0.10' } > - human_compare =3D [ 'compat: 0.10' ] > + json_compare =3D { 'compat': '0.10', 'refcount-width': 16 } > + human_compare =3D [ 'compat: 0.10', 'refcount width: 16' ] This would be a test that does not change if you decide to not output the constant. > -{"return": [{"io-status": "ok", "device": "disk", "locked": false, "re= movable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "imag= e": {"virtual-size": 134217728, "filename": "TEST_DIR/t.qcow2", "cluster-= size": 65536, "format": "qcow2", "actual-size": SIZE, "format-specific": = {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "cor= rupt": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "backing= _file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "encrypted": fal= se, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.qcow2", "encryption_key_mi= ssing": false}, "type": "unknown"}, {"io-status": "ok", "device": "ide1-c= d0", "locked": false, "removable": true, "tray_open": false, "type": "unk= nown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_o= pen": false, "type": "unknown"}, {"device": "sd0", "locked": false, "remo= vable": true, "tray_open": false, "type": "unknown"}]} > +{"return": [{"io-status": "ok", "device": "disk", "locked": false, "re= movable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "imag= e": {"virtual-size": 134217728, "filename": "TEST_DIR/t.qcow2", "cluster-= size": 65536, "format": "qcow2", "actual-size": SIZE, "format-specific": = {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "ref= count-width": 16, "corrupt": false}}, "dirty-flag": false}, "iops_wr": 0,= "ro": false, "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr= ": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.qcow= 2", "encryption_key_missing": false}, "type": "unknown"}, {"io-status": "= ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open= ": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "rem= ovable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", = "locked": false, "removable": true, "tray_open": false, "type": "unknown"= }]} It would be nice to figure out how to avoid long lines in the testsuite. But that's a project for another day. If you can make a strong argument for always outputting the constant width of 16 for 0.10 formats, then I can live with it, so: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --BBMXsP6b4iSXHBfkkIGLqtTMRXkON1JC3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUYQzNAAoJEKeha0olJ0Nqy9cIAIk/r1w7/Y8C+6/cARNn/58N ecHxXuWQ/iZelzgQDfP0xN2g8le8jee9nuWUD/9SLdi+CzAoC+2UfXuC7k1Edgqf 4xe1P1MVsiOnLRskC8Y3KDKdJIxfPu8J9shiUerdRyk3XtsddhaAU5FL3lMG9GzC mNcau1XCgSEdEqlWnOwL48o6g3qDbN6SIxhEE/EIgMrWTPHebIpGgJ3xL/nn5Bru 9ddtCc6SgkYgaMR1zD7csK8jJa6VU2laSyl/KvLV1YvpA8ltyZjzUGdNguvhx/3C 9xnhBjwtwWe2gyte2eKUh+OWH0M+9c1Hwrimq6qAgBb9Q8qn9Y/ACGMexfahfAs= =T4j9 -----END PGP SIGNATURE----- --BBMXsP6b4iSXHBfkkIGLqtTMRXkON1JC3--