From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqOwZ-0005q7-9f for qemu-devel@nongnu.org; Mon, 17 Nov 2014 11:14:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XqOwT-00039Q-21 for qemu-devel@nongnu.org; Mon, 17 Nov 2014 11:14:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqOwS-00039G-NU for qemu-devel@nongnu.org; Mon, 17 Nov 2014 11:14:16 -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 sAHGEFBK030489 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 17 Nov 2014 11:14:16 -0500 Message-ID: <546A1ED4.8080307@redhat.com> Date: Mon, 17 Nov 2014 17:14:12 +0100 From: Max Reitz 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> In-Reply-To: <546A1C90.2050709@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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: Eric Blake , qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi On 2014-11-17 at 17:04, Eric Blake wrote: > 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. >> >> Signed-off-by: Max Reitz >> --- >> tests/qemu-iotests/common.filter | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.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\' \ That doesn't match, however. QEMU's JSON formatter sometimes outputs whitespace at the end of line. >> + -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: Ooooh, you mean version 3 was actually fine? (which used 'c\' without a line break) ;-) > Reviewed-by: Eric Blake Thank you! Max