Received: from eggs.gnu.org ([2001:4830:134:3::10]:57355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQwC1-00053C-I2 for qemu-devel@nongnu.org; Thu, 26 Feb 2015 06:01:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQwBs-0004Mh-Jl for qemu-devel@nongnu.org; Thu, 26 Feb 2015 06:01:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQwBs-0004KA-Bz for qemu-devel@nongnu.org; Thu, 26 Feb 2015 06:01:12 -0500 Date: Thu, 26 Feb 2015 11:01:08 +0000 From: Stefan Hajnoczi Message-ID: <20150226110108.GE28719@stefanha-thinkpad.redhat.com> References: <1424385003-9412-1-git-send-email-jsnow@redhat.com> <1424385003-9412-8-git-send-email-jsnow@redhat.com> <20150225152757.GD2922@stefanha-thinkpad.redhat.com> <54EE4F40.90108@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gMR3gsNFwZpnI/Ts" Content-Disposition: inline In-Reply-To: <54EE4F40.90108@redhat.com> Subject: Re: [Qemu-devel] [PATCH 7/8] qtest/ahci: add qcow2 support to ahci-test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: kwolf@redhat.com, Stefan Hajnoczi , qemu-devel@nongnu.org, armbru@redhat.com --gMR3gsNFwZpnI/Ts Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 25, 2015 at 05:40:00PM -0500, John Snow wrote: >=20 >=20 > On 02/25/2015 10:27 AM, Stefan Hajnoczi wrote: > >On Thu, Feb 19, 2015 at 05:30:02PM -0500, John Snow wrote: > >>diff --git a/tests/libqos/libqos.c b/tests/libqos/libqos.c > >>index bc8beb2..3577401 100644 > >>--- a/tests/libqos/libqos.c > >>+++ b/tests/libqos/libqos.c > >>@@ -61,3 +61,33 @@ void qtest_shutdown(QOSState *qs) > >> qtest_quit(qs->qts); > >> g_free(qs); > >> } > >>+ > >>+int mkqcow2(const char *file, unsigned size_mb) > >>+{ > >>+ pid_t pid; > >>+ int rc; > >>+ char buff[32]; > >>+ > >>+ snprintf(buff, 32, "%uM", size_mb); > >>+ > >>+ pid =3D fork(); > >>+ switch (pid) { > >>+ case -1: > >>+ perror("fork failed"); > >>+ return -1; > >>+ case 0: > >>+ close(fileno(stdout)); > >>+ rc =3D open("/dev/null", O_WRONLY); > >>+ g_assert_cmpint(rc, =3D=3D, fileno(stdout)); > >>+ execl("./qemu-img", "qemu-img", "create", "-f", "qcow2", > >>+ file, buff, NULL); > > > >Where is the current working directory set? > > >=20 > Nowhere in-program. We assume you are running this via `make check` which > further assumes that qemu-img is in your build tree. We actually never set > an explicit path for where the QEMU binary is either: it's set to e.g.: >=20 > QTEST_QEMU_BINARY=3Dx86_64-softmmu/qemu-system-x86_64 > and then executed via execlp("exec QTEST_QEMU_BINARY", ...) >=20 > This patch pulls a similar shortcut. Okay, if the QEMU binary itself is invoked that way then this is fine. Stefan --gMR3gsNFwZpnI/Ts Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU7vz0AAoJEJykq7OBq3PI8t8H/05vL3FaDM2DLwawdQ/4KYJv Z37Mx3M9Pi+Jxv91YvSgv/tqP22W7jc+8Jh8XlorXRmIszX0QvzklJvpPabz6RK2 DGxjc0gHymMGMIH+zbYF/4xxVXxJVckfp+vvTBiCnFBXIS3Ag+JhzAFOC4h5psHg s9t648D+9nH47GE+N/e3rg8UibJ6OztOBN1KqXxTpcT48+/KpQmus4pkJxQGVxiZ 9GbqXqwjfOlY2CMx0lRkeBkzpO3N+QvcYA1DzRVeRI8JfRbODFruCAFZ9/Su3lP9 Cm3qc9BMXu8Z2cDiyimrniJsHNXJRS+Fw6kL2eYkFDewFuqLmGECMX8RsxwmH/k= =gwMF -----END PGP SIGNATURE----- --gMR3gsNFwZpnI/Ts--