From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYzgn-0008VZ-Uo for qemu-devel@nongnu.org; Mon, 07 Sep 2015 12:54:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYzgm-00083v-PV for qemu-devel@nongnu.org; Mon, 07 Sep 2015 12:54:41 -0400 References: <1437414365-11881-1-git-send-email-mreitz@redhat.com> <1437414365-11881-4-git-send-email-mreitz@redhat.com> <20150907162039.GG5529@noname.redhat.com> From: Max Reitz Message-ID: <55EDC147.1080002@redhat.com> Date: Mon, 7 Sep 2015 18:54:31 +0200 MIME-Version: 1.0 In-Reply-To: <20150907162039.GG5529@noname.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pmxlB6nPxFUdUomF4J8rtN9h2OIaUbtGL" Subject: Re: [Qemu-devel] [PATCH v4 03/38] iotests: Only create BB if necessary List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Alberto Garcia , qemu-block@nongnu.org, John Snow , qemu-devel@nongnu.org, Markus Armbruster , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pmxlB6nPxFUdUomF4J8rtN9h2OIaUbtGL Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 07.09.2015 18:20, Kevin Wolf wrote: > Am 20.07.2015 um 19:45 hat Max Reitz geschrieben: >> Tests 071 and 081 test giving references in blockdev-add. It is not >> necessary to create a BlockBackend here, so omit it. >> >> Signed-off-by: Max Reitz >> Reviewed-by: Eric Blake >> Reviewed-by: Alberto Garcia >> --- >> tests/qemu-iotests/071 | 50 +++++++++++++++++++++++++++++++++++++= +++++---- >> tests/qemu-iotests/071.out | 12 +++++++---- >> tests/qemu-iotests/081 | 14 ++++++++++++- >> tests/qemu-iotests/081.out | 5 +++-- >> 4 files changed, 70 insertions(+), 11 deletions(-) >> >> diff --git a/tests/qemu-iotests/071 b/tests/qemu-iotests/071 >> index 9eaa49b..68bedd4 100755 >> --- a/tests/qemu-iotests/071 >> +++ b/tests/qemu-iotests/071 >> @@ -104,11 +104,20 @@ echo >> echo "=3D=3D=3D Testing blkdebug on existing block device =3D=3D=3D" >> echo >> =20 >> -run_qemu -drive "file=3D$TEST_IMG,format=3Draw,if=3Dnone,id=3Ddrive0"= <> +run_qemu <> { "execute": "qmp_capabilities" } >> { "execute": "blockdev-add", >> "arguments": { >> "options": { >> + "node-name": "drive0", >> + "driver": "file", >> + "filename": "$TEST_IMG" >> + } >> + } >> +} >=20 > Any specific reason why format=3Draw is translated into driver=3Dfile h= ere... This is for the BDS used under blockdev-add, which is supposed to be a protocol BDS. "raw" was actually wrong, but apparently I felt bad about specifying a protocol driver on the command line. >> +{ "execute": "blockdev-add", >> + "arguments": { >> + "options": { >> "driver": "$IMGFMT", >> "id": "drive0-debug", >> "file": { >> @@ -133,11 +142,23 @@ echo >> echo "=3D=3D=3D Testing blkverify on existing block device =3D=3D=3D"= >> echo >> =20 >> -run_qemu -drive "file=3D$TEST_IMG,format=3D$IMGFMT,if=3Dnone,id=3Ddri= ve0" <> +run_qemu <> { "execute": "qmp_capabilities" } >> { "execute": "blockdev-add", >> "arguments": { >> "options": { >> + "node-name": "drive0", >> + "driver": "$IMGFMT", >> + "file": { >> + "driver": "file", >> + "filename": "$TEST_IMG" >> + } >> + } >> + } >> +} >> +{ "execute": "blockdev-add", >> + "arguments": { >> + "options": { >> "driver": "blkverify", >> "id": "drive0-verify", >> "test": "drive0", >> @@ -163,11 +184,23 @@ echo >> echo "=3D=3D=3D Testing blkverify on existing raw block device =3D=3D= =3D" >> echo >> =20 >> -run_qemu -drive "file=3D$TEST_IMG.base,format=3Draw,if=3Dnone,id=3Ddr= ive0" <> +run_qemu <> { "execute": "qmp_capabilities" } >> { "execute": "blockdev-add", >> "arguments": { >> "options": { >> + "node-name": "drive0", >> + "driver": "raw", >> + "file": { >> + "driver": "file", >> + "filename": "$TEST_IMG.base" >> + } >> + } >> + } >> +} >=20 > ...but into driver=3Draw,file.driver=3Dfile here? Probably because I assumed based on the test above this one that the "raw" BDS for blkverify would be a format BDS. Apparently it's not and both this and the test above this one should be fixed. >> +{ "execute": "blockdev-add", >> + "arguments": { >> + "options": { >> "driver": "blkverify", >> "id": "drive0-verify", >> "test": { >=20 >> diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081 >> index d9b042c..5c8a8fa 100755 >> --- a/tests/qemu-iotests/081 >> +++ b/tests/qemu-iotests/081 >> @@ -101,11 +101,23 @@ $QEMU_IO -c "open -o $quorum" -c "read -P 0x32 0= $size" | _filter_qemu_io >> echo >> echo "=3D=3D checking mixed reference/option specification =3D=3D" >> =20 >> -run_qemu -drive "file=3D$TEST_DIR/2.raw,format=3D$IMGFMT,if=3Dnone,id= =3Ddrive2" <> +run_qemu <> { "execute": "qmp_capabilities" } >> { "execute": "blockdev-add", >> "arguments": { >> "options": { >> + "node-name": "drive2", >> + "driver": "raw", >> + "file": { >> + "driver": "file", >> + "filename": "$TEST_DIR/2.raw" >> + } >> + } >> + } >> +} >=20 > And here $IMGFMT becomes raw (which is equivalent, but...) The other blockdev-add in this example uses hard-coded "raw", too. And then there's the hard-coded ".raw" extension everywhere in this test... I'll fix it, but that means fixing the pre-existing blockdev-add, too, and for such matters the most difficult thing always tends to be explaining it in the commit message. :-) Max >> +{ "execute": "blockdev-add", >> + "arguments": { >> + "options": { >> "driver": "quorum", >> "id": "drive0-quorum", >> "vote-threshold": 2, >=20 > Kevin >=20 --pmxlB6nPxFUdUomF4J8rtN9h2OIaUbtGL 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 iQEcBAEBCAAGBQJV7cFHAAoJEDuxQgLoOKytIhUH/2aLCIgGSMYhE3hrZggKEtEI QEnOrhMLH2IPt0HxyvrUrGsjyliEJTNmnIA/kVIl0QylCa1iZS/k7Rp3juaJoet9 VMOSNGWjWA3sY2itVUVZonixudRmi/BZ9ish2wJHG7AlmoHsGkuOaHx0DMfzgUQW N0cAvQxFUuIirqzM8ADnsfaYI323GSUqxDCXwxz7du0a8sjiAGQ7pk5mD+x9v4MD lTSRrOmxHEMKTHYqYeEIKQvmZeG3eJInOVD9jfkCTe5U28TKQe1WvgBrJNU5Llra tiM+0xSZ2zFz8vBjA2bwxgAC7FImPp7YN3+QLuWaoLvxFsGOORas12Rhrp1b4do= =elzV -----END PGP SIGNATURE----- --pmxlB6nPxFUdUomF4J8rtN9h2OIaUbtGL--