qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 2/3] qemu-iotests: Filter HMP readline escape


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 2/3] qemu-iotests: Filter HMP readline escape characters
Date: Wed, 19 Apr 2017 10:31:06 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0

On 04/19/2017 10:16 AM, Kevin Wolf wrote:
> The only thing the escape characters achieve is making the reference
> output unreadable and lines that are potentially so long that git
> doesn't want to put them into an email any more. Let's filter them out.
> 
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  tests/qemu-iotests/028.out       |   2 +-
>  tests/qemu-iotests/051           |   3 +-
>  tests/qemu-iotests/051.out       | 106 +++++++++++++++----------------
>  tests/qemu-iotests/051.pc.out    | 132 
> +++++++++++++++++++--------------------
>  tests/qemu-iotests/068           |   4 +-
>  tests/qemu-iotests/068.out       |   6 +-
>  tests/qemu-iotests/130.out       |   4 +-
>  tests/qemu-iotests/142           |   2 +-
>  tests/qemu-iotests/142.out       |  10 +--
>  tests/qemu-iotests/145           |   3 +-
>  tests/qemu-iotests/145.out       |   2 +-
>  tests/qemu-iotests/common.filter |   7 +++
>  tests/qemu-iotests/common.qemu   |   4 +-
>  13 files changed, 147 insertions(+), 138 deletions(-)

> +++ b/tests/qemu-iotests/common.filter
> @@ -86,6 +86,13 @@ _filter_qmp()
>          -e '    QMP_VERSION'
>  }
>  
> +# readline makes HMP command strings so long that git complains
> +_filter_hmp()
> +{
> +    sed -e $'s/^\((qemu) \)\\?.*\e\\[D/\\1/g' \

Inside $'', \ must be escaped to guarantee defined behavior in cases
where you want literal \ in the result (the fact that bash lets \( pass
through literally for now is not good to rely on).

sed -e $'s/^\\((qemu) \\)\\?.*\e\\[D/\\1/g' \

The other way is to use token concatenation, using '' for the bulk of
the string and $'' only for \e, although I don't know if it reads any
better:

sed -e 's/^\((qemu) \)\?.*'$'\e''\[D/\1/g' \

With that line fixed (by either style),
Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]