Received: from eggs.gnu.org ([2001:4830:134:3::10]:43207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKsSP-000334-Mk for qemu-devel@nongnu.org; Mon, 09 Feb 2015 12:49:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKsSK-000406-H9 for qemu-devel@nongnu.org; Mon, 09 Feb 2015 12:49:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKsSK-0003zu-9H for qemu-devel@nongnu.org; Mon, 09 Feb 2015 12:49:08 -0500 Date: Mon, 9 Feb 2015 17:49:04 +0000 From: Stefan Hajnoczi Message-ID: <20150209174904.GE18233@stefanha-thinkpad.redhat.com> References: <1423256778-3340-1-git-send-email-mreitz@redhat.com> <1423256778-3340-3-git-send-email-mreitz@redhat.com> <20150209150133.GC2076@stefanha-thinkpad.redhat.com> <54D8D432.5010806@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GxcwvYAGnODwn7V8" Content-Disposition: inline In-Reply-To: <54D8D432.5010806@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 2/3] iotests: Add "wait" functionality to _cleanup_qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org, Paolo Bonzini --GxcwvYAGnODwn7V8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 09, 2015 at 10:37:22AM -0500, Max Reitz wrote: > On 2015-02-09 at 10:01, Stefan Hajnoczi wrote: > >On Fri, Feb 06, 2015 at 04:06:17PM -0500, Max Reitz wrote: > >>diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common= =2Eqemu > >>index 8e618b5..4e1996c 100644 > >>--- a/tests/qemu-iotests/common.qemu > >>+++ b/tests/qemu-iotests/common.qemu > >>@@ -187,13 +187,23 @@ function _launch_qemu() > >> # Silenty kills the QEMU process > >>+# > >>+# If $wait is set to anything other than the empty string, the process= will not > >>+# be killed but only waited for, and any output will be forwarded to s= tdout. If > >>+# $wait is empty, the process will be killed and all output will be su= ppressed. > >> function _cleanup_qemu() > >> { > >> # QEMU_PID[], QEMU_IN[], QEMU_OUT[] all use same indices > >> for i in "${!QEMU_OUT[@]}" > >> do > >>- kill -KILL ${QEMU_PID[$i]} 2>/dev/null > >>+ if [ -z "${wait}" ]; then > >Is the global variable (with a common name) necessary? > > > >function _cleanup_qemu() > >{ > > wait=3D$1 > >... > > > >_cleanup_qemu > >OR > >_cleanup_qemu --wait >=20 > Well, it's probably not necessary, but it conforms with the _launch_qemu > ($qemu_comm_method), the _send_qemu_cmd ($qemu_error_not_set), and the > _timed_wait_for ($silent) interfaces. Okay, let's stay consistent. Stefan --GxcwvYAGnODwn7V8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU2PMQAAoJEJykq7OBq3PIgx0H/23DyZ0q1Nl7gUVUZnT9VUHO vfLT6nrBaNuf3n5Fbs2ZKASS8ajU2ZIUxFXYfpRLQZ0cpXd/EqQHua90KqUpBP7d xXrbI9xmEeQJrcQairuPXvkDG2Tc8qbPZrFc6R8h2nHvqGBgJyV7FlNDOqkSZzi6 wVtX6VNUNVvR52XutSxDszLOWS2dNxJXSqAwKjSKmyqsbZmuvEG1C5jOk7vVQlFQ na9FYWV6POl2XRn0x4YRb2RiqIzciaPAMPtajVbHxoJZ+NmBtrANywmRqfh7jKYJ imEWpXWO6cAtMWUrLOMX8aF61uspJLQ00qPGGJr+krXWZ0aNwr6AthzxpngPb/E= =tNVj -----END PGP SIGNATURE----- --GxcwvYAGnODwn7V8--