From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtI22-0005G9-HX for qemu-devel@nongnu.org; Mon, 02 Nov 2015 11:32:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtI21-0004mu-FR for qemu-devel@nongnu.org; Mon, 02 Nov 2015 11:32:30 -0500 References: <9e4f958b3895b7259b98d845bb46f000ba362869.1446232490.git.jcody@redhat.com> <5633DD87.1090302@redhat.com> <87a8qw4zso.fsf@blackfin.pond.sub.org> <5637893E.6030200@redhat.com> From: Eric Blake Message-ID: <56379012.30806@redhat.com> Date: Mon, 2 Nov 2015 09:32:18 -0700 MIME-Version: 1.0 In-Reply-To: <5637893E.6030200@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="m5K0bMhadOVqS5IE56rb7SJwmFUw5qH0u" Subject: Re: [Qemu-devel] [PATCH v3 1/2] qemu-iotests: fix cleanup of background processes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , Markus Armbruster Cc: kwolf@redhat.com, Jeff Cody , jsnow@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --m5K0bMhadOVqS5IE56rb7SJwmFUw5qH0u Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/02/2015 09:03 AM, Max Reitz wrote: >>>> +++ b/tests/qemu-iotests/058 >>>> @@ -32,11 +32,17 @@ status=3D1 # failure is the default! >>>> =20 >>>> nbd_unix_socket=3D$TEST_DIR/test_qemu_nbd_socket >>>> nbd_snapshot_img=3D"nbd:unix:$nbd_unix_socket" >>>> +rm -f "${TEST_DIR}/qemu-nbd.pid" >>>> =20 >>>> _cleanup_nbd() >>>> { >>>> - if [ -n "$NBD_SNAPSHOT_PID" ]; then >>>> - kill "$NBD_SNAPSHOT_PID" >>>> + local NBD_SNAPSHOT_PID >>>> + if [ -f "${TEST_DIR}/qemu-nbd.pid" ]; then >>>> + read NBD_SNAPSHOT_PID < "${TEST_DIR}/qemu-nbd.pid" >>>> + rm -f "${TEST_DIR}/qemu-nbd.pid" >>>> + if [ -n "$NBD_SNAPSHOT_PID" ]; then >>> >>> No, I won't complain about using ! -z "" elsewhere and -n "" here. :-= ) >> >> The little pedant in me screams "but I will!", and the little prankste= r >> next to him is clapping enthusiastically. >> >> Kidding aside: not worth a respin, but could be cleaned up on commit >> (maintainer's discretion). >=20 > Oh, if that's the case, then I have another thing for you: The use of =3D= =3D > in patch 2! ;-) >=20 > (I'm a bit disappointed Eric doesn't have a mail filter for > #!/bin/(ba)?sh ... if.*=3D=3D for his mail client.) I already know that most (if not all) of qemu-iotests is specifically /bin/bash. But if we want to, we can ditch -n and -z, and just use: if [[ $NBD_SNAPSHOT_PID ]]; then and similarly. In fact, I actually prefer embracing bash-isms when we know we are using bash, to make it obvious that we know we are not catering to /bin/sh. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --m5K0bMhadOVqS5IE56rb7SJwmFUw5qH0u 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWN5ASAAoJEKeha0olJ0NqKD0H/08vxZgNfeFc5S144zZtJ9ge mhpFRwZ9mxC0MWSOT4Y4Y11Yv+GnUG49qoPF/+tAXiLvEqUcowTiBdKHlObtzZYZ o+wBVi7JJ91+CX63kN7uNi+BdDdW1tkYZF4iEfhKeRMRkweG4mIZxYswuR8+p9dQ GPU9fGYdVP+Q8xs7ezuPulyPO1Ired920Ar+EmjGQZTnzq+1Req1BI4qKNaaNAHw kArB5aLmql23pA/cjHKMVBDXw4mU7bAcLDG8FeuWklhUO9vudBKSt4WLo4XXKRRS UUEhc3RV5eaPbfqHS51vOvKrIlR0Fti7t/eHxgohb3DDVdhsV71wZ/d6ZF5s0Is= =sdyn -----END PGP SIGNATURE----- --m5K0bMhadOVqS5IE56rb7SJwmFUw5qH0u--