From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYbgr-0005pu-L1 for qemu-devel@nongnu.org; Wed, 24 Feb 2016 10:49:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYbgq-0002Nu-LO for qemu-devel@nongnu.org; Wed, 24 Feb 2016 10:49:25 -0500 References: <4a7fc43138fff7dfbebfaf993835b315ea50d01b.1456274059.git.jcody@redhat.com> <20160224102329.GD4485@noname.redhat.com> <20160224154013.GE23671@localhost.localdomain> From: Max Reitz Message-ID: <56CDD0FB.3080903@redhat.com> Date: Wed, 24 Feb 2016 16:49:15 +0100 MIME-Version: 1.0 In-Reply-To: <20160224154013.GE23671@localhost.localdomain> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nDcKCDnffWvXN3QCHk40O0BfkedQba8XQ" Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 2/4] block/vpc: tests for auto-detecting VPC and Hyper-V VHD images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody , Kevin Wolf Cc: pl@kamp.de, qemu-devel@nongnu.org, qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --nDcKCDnffWvXN3QCHk40O0BfkedQba8XQ Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 24.02.2016 16:40, Jeff Cody wrote: > On Wed, Feb 24, 2016 at 11:23:29AM +0100, Kevin Wolf wrote: >> Am 24.02.2016 um 01:47 hat Jeff Cody geschrieben: >>> This tests auto-detection, and overrides, of VHD image sizes created >>> by Virtual PC and Hyper-V. >>> >>> This adds two sample images: >>> >>> hyperv2012r2-dynamic.vhd.bz2 - dynamic VHD image created with Hyper-V= >>> virtualpc-dynamic.vhd.bz2 - dynamic VHD image created with Virtual= PC >>> >>> Signed-off-by: Jeff Cody >> >>> +echo >>> +echo =3D=3D=3D Testing VPC Autodetect =3D=3D=3D >>> +echo >>> +_use_sample_img virtualpc-dynamic.vhd.bz2 >>> + >>> +_launch_qemu -drive file=3D"${TEST_IMG}",id=3Ddisk,format=3Dvpc >>> +h1=3D$QEMU_HANDLE >>> + >>> +_send_qemu_cmd $h1 'qemu-io disk "map"' "sectors" >>> +_send_qemu_cmd $h1 'quit' "" >> >> I would avoid the big hammer of starting qemu processes when qemu-io c= an >> test the same: >> >> $QEMU_IO -c "open -o file=3D${TEST_IMG},id=3Ddisk,format=3Dvpc" -c "ma= p" >> >> Kevin >=20 > The reason I used a qemu process before, was difficulty passing in the > drive options to qemu-io. I futzed around a bit with the new > --image-opts, but I hadn't tried "file=3D" in the open command with -o,= > so I felt a bit silly after your email. >=20 > However, this doesn't seem to work, now that I've tried it. Is it > broken, or am I doing something wrong? Here is what I get: >=20 > # ./qemu-io -c "open -o file=3D/tmp/hyperv2012r2-dynamic.vhd,format=3Dv= pc" -c "map" > can't open: Cannot find device=3D/tmp/hyperv2012r2-dynamic.vhd nor node= _name=3D/tmp/hyperv2012r2-dynamic.vhd >=20 > Technically, I could just rely on image format autodetection since the > current test images are dynamic and not fixed, and use -o to pass the > vpc specific options. I just hate to rely on autodetection anymore. And I completely skipped this block... $QEMU_IO resolves to _qemu_io_wrapper; this function will eventually invoke "$QEMU_IO_PROG" $QEMU_IO_OPTIONS; and $QEMU_IO_OPTIONS resolves to "-f $IMGFMT --cache $CACHEMODE". Therefore, you don't need to worry about autodetection anyway. Max --nDcKCDnffWvXN3QCHk40O0BfkedQba8XQ 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 iQEcBAEBCAAGBQJWzdD7AAoJEDuxQgLoOKytRoYH/jXiBo+PHqrM9Mx9VXM22vKq ZtzLCRaKkcfmjApCddat2extimAJRMFDCWVrnSJxhOo8Fx93r5aRSqoN6Udru1de Sg1LwyfV2thfU1oTjhxJvclONo8C0Zeev8N9NBtY13bSVwqTZvQFBPJ9kCuSO8AG B6Qv6x1kMbKMtSuQJl1A/rXD06K5CjjCUjXPBGwVQ6aGVd85p0/30g79cEV7eNFo UhiQV/Le5JztcvVo7c+D3Sr4sd+bRUh/ZzM9NTJ6fwG8yRePbd8uhYT7qQjit4kI GlZ2UEMymTkstjcG4KYm0J8bwENu71C0g1MDsGusRf3kGH+O0O2s3olW795c2Ak= =J+CK -----END PGP SIGNATURE----- --nDcKCDnffWvXN3QCHk40O0BfkedQba8XQ--