From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqOnB-0005uj-9g for qemu-devel@nongnu.org; Mon, 17 Nov 2014 11:04:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XqOn4-0007Xx-V8 for qemu-devel@nongnu.org; Mon, 17 Nov 2014 11:04:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqOn4-0007Xr-7Y for qemu-devel@nongnu.org; Mon, 17 Nov 2014 11:04:34 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAHG4X64019006 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 17 Nov 2014 11:04:33 -0500 Message-ID: <546A1C90.2050709@redhat.com> Date: Mon, 17 Nov 2014 09:04:32 -0700 From: Eric Blake MIME-Version: 1.0 References: <1416227466-29491-1-git-send-email-mreitz@redhat.com> <1416227466-29491-3-git-send-email-mreitz@redhat.com> In-Reply-To: <1416227466-29491-3-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="h4EiUXDggOxJQU5PSHeXneN2Nl6aVCMqO" Subject: Re: [Qemu-devel] [PATCH v4 2/3] iotests: _filter_qmp for pretty JSON output List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --h4EiUXDggOxJQU5PSHeXneN2Nl6aVCMqO Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/17/2014 05:31 AM, Max Reitz wrote: > _filter_qmp should be able to correctly filter out the QMP version > object for pretty JSON output. >=20 > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/common.filter | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/comm= on.filter > index 3acdb30..dfb9726 100644 > --- a/tests/qemu-iotests/common.filter > +++ b/tests/qemu-iotests/common.filter > @@ -167,7 +167,9 @@ _filter_qmp() > { > _filter_win32 | \ > sed -e 's#\("\(micro\)\?seconds": \)[0-9]\+#\1 TIMESTAMP#g' \ > - -e 's#^{"QMP":.*}$#QMP_VERSION#' > + -e 's#^{"QMP":.*}$#QMP_VERSION#' \ > + -e '/^ "QMP": {\s*$/, /^ }\s*$/ c\' \ \s is a GNU sed extension. But we don't really need to care about whitespace to the end of the line; I think that it is sufficient to just match the following regex: -e '/^ "QMP": {/, /^ }/ c\' \ > + -e ' QMP_VERSION' Either way, it's not the first time we've used a GNU sed extension, and since other series are now depending on this one, I can live with: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --h4EiUXDggOxJQU5PSHeXneN2Nl6aVCMqO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUahyQAAoJEKeha0olJ0NqvL4IAIDzxBwRwciHkGoWbfi0JADi cB+cv/4OhT+87VgfBj+L4ISF3R5Aw95f3/UV2DY/x15WPlT1aVm/3CgsruZYrN7B fCB7M83zGIeHw6J9jG70jbFZvjTFyMCQkegrpjGFzIi1eMDqfF6T/OW6SgezfIwP CfcF7ANvUpuyF3gKm5JufHTH0IOjbsNoerwjZJH+62T3i4t4u/r59mWJcsQPDSZA kJIleqjycVIB50ZDSPQngwRw8fLCmLoigMN6mLPxYY3btuGv27AhN4AjwFKHXJSV KVpnJu1+ItIAZbj2T7YAaVIx+WRpzGxebl0DYjJPQzJkwAxG+8EZT9dQ1ANLHmg= =qXh5 -----END PGP SIGNATURE----- --h4EiUXDggOxJQU5PSHeXneN2Nl6aVCMqO--