Received: from eggs.gnu.org ([2001:4830:134:3::10]:56960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKpqG-0005kQ-S0 for qemu-devel@nongnu.org; Mon, 09 Feb 2015 10:01:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKpqD-0000Ih-Gk for qemu-devel@nongnu.org; Mon, 09 Feb 2015 10:01:40 -0500 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:48062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKpqD-0000IY-Ak for qemu-devel@nongnu.org; Mon, 09 Feb 2015 10:01:37 -0500 Received: by mail-wi0-f175.google.com with SMTP id r20so1487315wiv.2 for ; Mon, 09 Feb 2015 07:01:36 -0800 (PST) Date: Mon, 9 Feb 2015 15:01:33 +0000 From: Stefan Hajnoczi Message-ID: <20150209150133.GC2076@stefanha-thinkpad.redhat.com> References: <1423256778-3340-1-git-send-email-mreitz@redhat.com> <1423256778-3340-3-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KN5l+BnMqAQyZLvT" Content-Disposition: inline In-Reply-To: <1423256778-3340-3-git-send-email-mreitz@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 , Paolo Bonzini , qemu-devel@nongnu.org, Stefan Hajnoczi --KN5l+BnMqAQyZLvT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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.q= emu > index 8e618b5..4e1996c 100644 > --- a/tests/qemu-iotests/common.qemu > +++ b/tests/qemu-iotests/common.qemu > @@ -187,13 +187,23 @@ function _launch_qemu() > =20 > =20 > # Silenty kills the QEMU process > +# > +# If $wait is set to anything other than the empty string, the process w= ill not > +# be killed but only waited for, and any output will be forwarded to std= out. If > +# $wait is empty, the process will be killed and all output will be supp= ressed. > 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 =2E.. _cleanup_qemu OR _cleanup_qemu --wait --KN5l+BnMqAQyZLvT Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU2MvNAAoJEJykq7OBq3PIMYIIAMnENlzaL0i1HGpI+TK05WGv JH71qwKcaQ5GQs9M/EmMEWNN13iiT+bRZc2X8Pix0mDbMWYKP0PL2C5o0JNXFVVE VzW7DA67OEzhOxQDDWNLs/G1vcauHQjvp0HTgpxFEpa2IggHC2ByFkKbgpMjHuCJ sxHG3+eQmdRDjr37zJIDuEtKAnM9IRU71L4eCrOGHWNGguGpz+qLyjPjJTgNxwdT lAc0Gmch9qwIVF9CLPiJ3YSK3A7nVjI41N443+nDoMEBpnpEpHwHjjr5uzpXzFIv 1RtEhitpMGti2kkxckt/ADqWvmU92jEyPZs4K4R8TNROdAYIUG4VOf6BkYfaBjg= =EfHI -----END PGP SIGNATURE----- --KN5l+BnMqAQyZLvT--