From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqPlZ-0000ua-3N for qemu-devel@nongnu.org; Mon, 17 Nov 2014 12:07:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XqPlU-0005bA-12 for qemu-devel@nongnu.org; Mon, 17 Nov 2014 12:07:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqPlT-0005b1-O6 for qemu-devel@nongnu.org; Mon, 17 Nov 2014 12:06:59 -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 sAHH6xtm016040 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 17 Nov 2014 12:06:59 -0500 Message-ID: <546A2B31.4010208@redhat.com> Date: Mon, 17 Nov 2014 10:06:57 -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> <546A1C90.2050709@redhat.com> <546A1ED4.8080307@redhat.com> In-Reply-To: <546A1ED4.8080307@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mId1OG6pujwPUuhQOO43Jg9QXAiRcf3iX" 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) --mId1OG6pujwPUuhQOO43Jg9QXAiRcf3iX Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/17/2014 09:14 AM, Max Reitz wrote: >>> + -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 ju= st >> match the following regex: >> >> -e '/^ "QMP": {/, /^ }/ c\' \ >=20 > That doesn't match, however. QEMU's JSON formatter sometimes outputs > whitespace at the end of line. No, I explicitly omitted the $. The lines match because they are anchored to the beginning, regardless of trailing whitespace at the end. >=20 >>> + -e ' QMP_VERSION' >> Either way, it's not the first time we've used a GNU sed extension, an= d >> since other series are now depending on this one, I can live with: >=20 > Ooooh, you mean version 3 was actually fine? (which used 'c\' without a= > line break) ;-) I'm more comfortable with v4 than v3 (\s is well-known, and can be easily converted into an alternative if someone proves their system doesn't support it. But c\ is not well-known; and reading 'info sed' to learn about c\ only documents its use with a newline; so using c\ without a newline is relying on undocumented GNU behavior, which is very risky). Of course, a v5 that avoids \s would avoid any confusion, but now we're bikeshedding, and I'm not sure it's worth the time. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --mId1OG6pujwPUuhQOO43Jg9QXAiRcf3iX 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 iQEcBAEBCAAGBQJUaisxAAoJEKeha0olJ0NqltIH/A0nSxb6VMDHYFMGjjQu4YNK 98YvHwpf2NnjruvoAosvO60os6k/D/y9SkB+Q6RbL21rRYg0A37T+txw9XE7dXHw MXJpn+UkhiqowyNu4377bunZaKYYFlE5FvepmtWCE3QZvHnG1OKE6avJMFw1S8+U //1w/P2Ya2+axMkH3UekMDJiHG7ha8s/GEep1zJ/QR92roDzLaIGerkgEyLmT0wr LmLWqsbCu1V1BiODWQHfFjXXQHGpl0O4KVNCYAtK9/HVL1xD0pDDdplbEpmZkad8 HvExu0rv3qEF2+5EKIOEQX5oFj+So0gyz5dagkXdKG0k3K7F5uT+/wpQjBmU5a0= =Ku2B -----END PGP SIGNATURE----- --mId1OG6pujwPUuhQOO43Jg9QXAiRcf3iX--