From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5Ymq-0004AW-7D for qemu-devel@nongnu.org; Wed, 25 May 2016 09:23:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5Ymm-0007J5-O3 for qemu-devel@nongnu.org; Wed, 25 May 2016 09:23:48 -0400 References: <1463470536-8981-1-git-send-email-famz@redhat.com> <1463470536-8981-21-git-send-email-famz@redhat.com> From: Max Reitz Message-ID: <01ab4726-7e79-5c68-0769-264c58a638ef@redhat.com> Date: Wed, 25 May 2016 15:23:27 +0200 MIME-Version: 1.0 In-Reply-To: <1463470536-8981-21-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="W7Fcof2CB14Kw78trjaISs7XX4qeOLCEU" Subject: Re: [Qemu-devel] [PATCH v5 20/27] qemu-iotests: 046: Move version detection out from verify_io List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Jeff Cody , Markus Armbruster , Eric Blake , John Snow , qemu-block@nongnu.org, berrange@redhat.com, pbonzini@redhat.com, den@openvz.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --W7Fcof2CB14Kw78trjaISs7XX4qeOLCEU From: Max Reitz To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Jeff Cody , Markus Armbruster , Eric Blake , John Snow , qemu-block@nongnu.org, berrange@redhat.com, pbonzini@redhat.com, den@openvz.org, stefanha@redhat.com Message-ID: <01ab4726-7e79-5c68-0769-264c58a638ef@redhat.com> Subject: Re: [PATCH v5 20/27] qemu-iotests: 046: Move version detection out from verify_io References: <1463470536-8981-1-git-send-email-famz@redhat.com> <1463470536-8981-21-git-send-email-famz@redhat.com> In-Reply-To: <1463470536-8981-21-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 17.05.2016 09:35, Fam Zheng wrote: > So the image lock won't complain. >=20 > Signed-off-by: Fam Zheng > --- > tests/qemu-iotests/046 | 22 ++++++++++++---------- > 1 file changed, 12 insertions(+), 10 deletions(-) >=20 > diff --git a/tests/qemu-iotests/046 b/tests/qemu-iotests/046 > index e528b67..365658e 100755 > --- a/tests/qemu-iotests/046 > +++ b/tests/qemu-iotests/046 > @@ -192,15 +192,7 @@ echo "=3D=3D Verify image content =3D=3D" > =20 > function verify_io() > { > - if ($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep "compat: 0.10" = > /dev/null); then > - # For v2 images, discarded clusters are read from the backing = file > - # Keep the variable empty so that the backing file value can b= e used as > - # the default below > - discarded=3D > - else > - # Discarded clusters are zeroed for v3 or later > - discarded=3D0 > - fi > + discarded=3D$1 > =20 > echo read -P 0 0 0x10000 > =20 > @@ -261,7 +253,17 @@ function verify_io() > echo read -P 17 0x11c000 0x4000 > } > =20 > -verify_io | $QEMU_IO "$TEST_IMG" | _filter_qemu_io > +if ($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep "compat: 0.10" > /d= ev/null); then > + # For v2 images, discarded clusters are read from the backing file= > + # Keep the variable empty so that the backing file value can be us= ed as > + # the default below > + discarded=3D > +else > + # Discarded clusters are zeroed for v3 or later > + discarded=3D0 > +fi > + > +verify_io $discarded | $QEMU_IO -L "$TEST_IMG" | _filter_qemu_io With the code movement, the -L becomes unnecessary here. Max > =20 > _check_test_img > =20 >=20 --W7Fcof2CB14Kw78trjaISs7XX4qeOLCEU 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 iQEcBAEBCAAGBQJXRadPAAoJEDuxQgLoOKytJYgIAIv6Sv8fIh7gGL1DZ+78GIX2 SRhHIzItB4UiD/AYPiusWmrNa3o7om6a3wm8UOSpAY/FZNXipda17s5wTXxn6NGw Rd+wBv0onc7ungSnS5s0PwBxk+zqj1dRSVgSWywoHPiZn0izCbInQOLcuUyixspq AIMNBK7AAx6zM2vMHCeIKQewArOYQSl9HkXBN5GH5GpGrx66i+0v9473DpGZz86j k9mUzC+PA0WlKCKCihdIBkNb0Hqb62lsHjq+E/isOhSbyvd48iOoPw4pMk9XJ2Et 6eA55eqdX40A5m+ZxaAxd0Yb1GukhW3gpdhBVCWvhhEVQt9ewS/UXy/sDOeyKxs= =vKO3 -----END PGP SIGNATURE----- --W7Fcof2CB14Kw78trjaISs7XX4qeOLCEU--