From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajDIJ-0004Yk-Tn for qemu-devel@nongnu.org; Thu, 24 Mar 2016 17:59:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajDII-0000Em-Oy for qemu-devel@nongnu.org; Thu, 24 Mar 2016 17:59:55 -0400 References: <1458569512-22970-1-git-send-email-berrange@redhat.com> <1458569512-22970-9-git-send-email-berrange@redhat.com> From: Max Reitz Message-ID: <56F46351.6000004@redhat.com> Date: Thu, 24 Mar 2016 22:59:45 +0100 MIME-Version: 1.0 In-Reply-To: <1458569512-22970-9-git-send-email-berrange@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="oQhxfAtWF1dEPMpcNIhmUobPhKAEo6Mb0" Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v6 08/11] block: add support for --image-opts in block I/O tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --oQhxfAtWF1dEPMpcNIhmUobPhKAEo6Mb0 Content-Type: multipart/mixed; boundary="W0F80skMJKCK1rhmEsSOuvTV7e65wHE5N" From: Max Reitz To: "Daniel P. Berrange" , qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , qemu-block@nongnu.org Message-ID: <56F46351.6000004@redhat.com> Subject: Re: [Qemu-block] [PATCH v6 08/11] block: add support for --image-opts in block I/O tests References: <1458569512-22970-1-git-send-email-berrange@redhat.com> <1458569512-22970-9-git-send-email-berrange@redhat.com> In-Reply-To: <1458569512-22970-9-git-send-email-berrange@redhat.com> --W0F80skMJKCK1rhmEsSOuvTV7e65wHE5N Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 21.03.2016 15:11, Daniel P. Berrange wrote: > Currently all block tests use the traditional syntax for images > just specifying a filename. To support the LUKS driver without > resorting to JSON, the tests need to be able to use the new > --image-opts argument to qemu-img and qemu-io. >=20 > This introduces a new env variable IMGOPTSSYNTAX. If this is > set to 'true', then qemu-img/qemu-io should use --image-opts. >=20 > Signed-off-by: Daniel P. Berrange > --- > tests/qemu-iotests/common | 7 ++++- > tests/qemu-iotests/common.config | 15 +++++++++-- > tests/qemu-iotests/common.rc | 58 +++++++++++++++++++++++++++++---= -------- > 3 files changed, 62 insertions(+), 18 deletions(-) >=20 [...] > diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.r= c > index d9913f8..5eb654b 100644 > --- a/tests/qemu-iotests/common.rc > +++ b/tests/qemu-iotests/common.rc > @@ -53,21 +53,43 @@ fi > # make sure we have a standard umask > umask 022 > =20 > -if [ "$IMGPROTO" =3D "file" ]; then > - TEST_IMG=3D$TEST_DIR/t.$IMGFMT > -elif [ "$IMGPROTO" =3D "nbd" ]; then > - TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT > - TEST_IMG=3D"nbd:127.0.0.1:10810" > -elif [ "$IMGPROTO" =3D "ssh" ]; then > - TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT > - TEST_IMG=3D"ssh://127.0.0.1$TEST_IMG_FILE" > -elif [ "$IMGPROTO" =3D "nfs" ]; then > - TEST_DIR=3D"nfs://127.0.0.1/$TEST_DIR" > - TEST_IMG=3D$TEST_DIR/t.$IMGFMT > -elif [ "$IMGPROTO" =3D "archipelago" ]; then > - TEST_IMG=3D"archipelago:at.$IMGFMT" > +if [ "$IMGOPTSSYNTAX" =3D "true" ]; then > + DRIVER=3D"driver=3D$IMGFMT" > + if [ "$IMGPROTO" =3D "file" ]; then > + TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT > + TEST_IMG=3D"$DRIVER,file.filename=3D$TEST_DIR/t.$IMGFMT" > + elif [ "$IMGPROTO" =3D "nbd" ]; then > + TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT > + TEST_IMG=3D"$DRIVER,file.driver=3Dnbd,file.host=3D127.0.0.1,fi= le.port=3D10810" > + elif [ "$IMGPROTO" =3D "ssh" ]; then > + TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT > + TEST_IMG=3D"$DRIVER,file.driver=3Dssh,file.host=3D127.0.0.1,fi= le.path=3D$TEST_IMG_FILE" > + elif [ "$IMGPROTO" =3D "nfs" ]; then > + TEST_DIR=3D"$DRIVER,file.driver=3Dnfs,file.filename=3Dnfs://12= 7.0.0.1/$TEST_DIR" > + TEST_IMG=3D$TEST_DIR_OPTS/t.$IMGFMT > + elif [ "$IMGPROTO" =3D "archipelago" ]; then > + TEST_IMG=3D"$DRIVER,file.driver=3Darchipelago,file.volume=3D:a= t.$IMGFMT" > + else > + TEST_IMG=3D"$DRIVER,file.driver=3D$IMGPROTO,file.filename=3D$T= EST_DIR/t.$IMGFMT" > + fi > else > - TEST_IMG=3D$IMGPROTO:$TEST_DIR/t.$IMGFMT > + if [ "$IMGPROTO" =3D "file" ]; then > + TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT This wasn't set before (in this case). Doing so breaks many qcow2+file tests (28, to be exact), because they rely on being able to do something like TEST_IMG=3D"${TEST_IMG}.base" _make_test_img which fails now because _make_test_img resorts to TEST_IMG_FILE. I guess the fix would be for them to use TEST_IMG_FILE in those places instead of TEST_IMG; but it's not always so simple. For instance, test 017 sets TEST_IMG and then relies on the io() function provided by common.pattern to use that image, so maybe 017 would need to set both TEST_IMG and TEST_IMG_FILE. Max > + TEST_IMG=3D$TEST_DIR/t.$IMGFMT > + elif [ "$IMGPROTO" =3D "nbd" ]; then > + TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT > + TEST_IMG=3D"nbd:127.0.0.1:10810" > + elif [ "$IMGPROTO" =3D "ssh" ]; then > + TEST_IMG_FILE=3D$TEST_DIR/t.$IMGFMT > + TEST_IMG=3D"ssh://127.0.0.1$TEST_IMG_FILE" > + elif [ "$IMGPROTO" =3D "nfs" ]; then > + TEST_DIR=3D"nfs://127.0.0.1/$TEST_DIR" > + TEST_IMG=3D$TEST_DIR/t.$IMGFMT > + elif [ "$IMGPROTO" =3D "archipelago" ]; then > + TEST_IMG=3D"archipelago:at.$IMGFMT" > + else > + TEST_IMG=3D$IMGPROTO:$TEST_DIR/t.$IMGFMT > + fi > fi > =20 > _optstr_add() --W0F80skMJKCK1rhmEsSOuvTV7e65wHE5N-- --oQhxfAtWF1dEPMpcNIhmUobPhKAEo6Mb0 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 iQEcBAEBCAAGBQJW9GNRAAoJEDuxQgLoOKytueIH/2pr2vLeiJjjctvgTyd5TGha OiMd7HhuGSFBIpeeR1sXaM4VAIUBRNtyxk6Varzlx+Uja0+UjW6toewNgbsH3JwB Z037hQkUbSiRLPoZPRGghOKaPegYACg3qGvGCEikpKjP1zLRcvmNuEi6b23SI0Pm VT0ekqITi0a/6WucK4Ktra3Jopa/RsWn3HAzNxSzCPzMAPi4EmedvcobDT7olwOl 7e6rz/tlFN9V+Z8UsJs+ZKn06oebJg8ybuUVQ1+6LhrIknhrc1jm9QRiKvP/RE3f 8jGi2MD56uQeD/bLQg0dAKkWrnu5TSY4fRe1lSCinik33JuoqgU8114lIHS/8+c= =8vj9 -----END PGP SIGNATURE----- --oQhxfAtWF1dEPMpcNIhmUobPhKAEo6Mb0--