From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XramV-0007TO-8O for qemu-devel@nongnu.org; Thu, 20 Nov 2014 18:05:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XramQ-0005vp-9F for qemu-devel@nongnu.org; Thu, 20 Nov 2014 18:04:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XramQ-0005vh-0p for qemu-devel@nongnu.org; Thu, 20 Nov 2014 18:04:50 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAKN4nkS026736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 20 Nov 2014 18:04:49 -0500 Message-ID: <546E7390.1020308@redhat.com> Date: Thu, 20 Nov 2014 16:04:48 -0700 From: Eric Blake MIME-Version: 1.0 References: <1416503198-17031-1-git-send-email-mreitz@redhat.com> <1416503198-17031-23-git-send-email-mreitz@redhat.com> In-Reply-To: <1416503198-17031-23-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jigPuoC8nhUU25sXwDhtdoB51IIXK46Tx" Subject: Re: [Qemu-devel] [PATCH v3 22/22] iotests: Add test for different refcount widths List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jigPuoC8nhUU25sXwDhtdoB51IIXK46Tx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/20/2014 10:06 AM, Max Reitz wrote: > Add a test for conversion between different refcount widths and errors > specific to certain widths (i.e. snapshots with refcount_width=3D1). >=20 > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/112 | 278 +++++++++++++++++++++++++++++++++++++= ++++++++ > tests/qemu-iotests/112.out | 143 +++++++++++++++++++++++ > tests/qemu-iotests/group | 1 + > 3 files changed, 422 insertions(+) > create mode 100755 tests/qemu-iotests/112 > create mode 100644 tests/qemu-iotests/112.out >=20 > +echo > +echo '=3D=3D=3D Multiple walks necessary during amend =3D=3D=3D' > +echo > + > +IMGOPTS=3D"$IMGOPTS,refcount_width=3D1,cluster_size=3D512" _make_test_= img 64k > + > +# Cluster 0 is the image header, clusters 1 to 4 are used by the L1 ta= ble, a > +# single L2 table, the reftable and a single refblock. This creates 58= data > +# clusters (actually, the L2 table is created here, too), so in total = there are > +# then 63 used clusters in the image. With a refcount width of 64, one= refblock > +# describes 64 clusters (512 bytes / 64 bits/entry =3D 64 entries), so= this will > +# make the first refblock in the amended image have exactly one free e= ntry. > +$QEMU_IO -c "write 0 $((58 * 512))" "$TEST_IMG" | _filter_qemu_io > + > +# Now change the refcount width; since the first new refblock will hav= e exactly > +# one free entry, that entry will be used to store its own reference. = No other > +# refblocks are needed, so then the new reftable will be allocated; si= nce the > +# first new refblock is completely filled up, this will require a new = refblock > +# which is why the refcount width changing function will need to run t= hrough > +# everything one more time until the allocations are stable. > +# Having more walks than usual should be visible as regressing progres= s (from > +# 66.67 % (2/3 walks) to 50.00 % (2/4 walks)). > +$QEMU_IMG amend -o refcount_width=3D64 -p "$TEST_IMG" | tr '\r' '\n' \= > + | grep -A 1 '66.67= ' You probably know the drill by now: 'grep -A' is a GNU extension, and not necessarily portable to other grep. Portable would be "grep 66.67 | head -n2", but I'm not going to insist on a rewrite since we already depend on other GNU-isms in the testsuite. (Or put another way, if someone runs the test on BSD and it fails, _then_ we can patch things). > + > +=3D=3D=3D Multiple walks necessary during amend =3D=3D=3D > + > +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D65536 > +wrote 29696/29696 bytes at offset 0 > +29 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > + (66.67/100%) > + (50.00/100%) > +refcount width: 64 > +No errors were found on the image. Nicely done, here, and in the overall series. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --jigPuoC8nhUU25sXwDhtdoB51IIXK46Tx 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 iQEcBAEBCAAGBQJUbnOQAAoJEKeha0olJ0Nq8TMH/RDHY0LcITpy7TRcHkto7FML Q5xmaTae+ZQ/wVbM7icmERI5dxDkFZwKJHWdo9NWcwf4TtQ0GIZ0SObCcktsBDni eFfgOCDbU9pUNFZpvFxLT7JrUnRWTEsbpNBHStdyXWt6fx46IRukOg9MjE32RTqx l2NN3Oyouu9+BNmgigGu4xLuIlrVo4S+9rz7RIOs+J7H6AdCafIHOA5NONfH1Sa9 UECeYsN1JmtWEHAQCe3FCiegwmY7dspBnxIf17YToc8ANqIl/AdhNbuaCIrKuU4H twBLlQOovS+Zr7pAEdPU0FsvDIrhMzoZ0qVt7ja1Jo/O8GkTP+7VkKjjB38CFxY= =auGV -----END PGP SIGNATURE----- --jigPuoC8nhUU25sXwDhtdoB51IIXK46Tx--