[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 2/3] iotests: _filter_qmp for pretty JSON out
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v4 2/3] iotests: _filter_qmp for pretty JSON output |
Date: |
Mon, 17 Nov 2014 09:04:32 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
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 <address@hidden>
> ---
> 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\' \
> + -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 <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
Re: [Qemu-devel] [PATCH v4 0/3] chardev: Add -qmp-pretty, Kevin Wolf, 2014/11/20
Re: [Qemu-devel] [PATCH v4 0/3] chardev: Add -qmp-pretty, Markus Armbruster, 2014/11/28