From: tu bo <tubo@linux.vnet.ibm.com>
To: Max Reitz <mreitz@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, silbe@linux.vnet.ibm.com, armbru@redhat.com,
mimu@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH v2 1/4] qemu-iotests: refine common.config
Date: Thu, 19 Nov 2015 13:58:40 +0800 [thread overview]
Message-ID: <564D6510.9090203@linux.vnet.ibm.com> (raw)
In-Reply-To: <564CAB2F.9060300@redhat.com>
Hi Max:
On 11/19/2015 12:45 AM, Max Reitz wrote:
> On 04.11.2015 03:26, Bo Tu wrote:
>> Replacing sed with awk, then it's easier to read.
>
> I think you meant "awk with sed".
It's my fault. thanks :-)
>
>> Replacing "[ ! -z "$default_alias_machine" ]" with
>> "[[ $default_alias_machine ]]", then it's slightly shorter.
>>
>> Suggested-By: Sascha Silbe <silbe@linux.vnet.ibm.com>
>> Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>> Signed-off-by: Bo Tu <tubo@linux.vnet.ibm.com>
>> ---
>> tests/qemu-iotests/common.config | 9 ++++-----
>> 1 file changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
>> index 596bb2b..08f4b4e 100644
>> --- a/tests/qemu-iotests/common.config
>> +++ b/tests/qemu-iotests/common.config
>> @@ -128,11 +128,10 @@ export QEMU_IMG=_qemu_img_wrapper
>> export QEMU_IO=_qemu_io_wrapper
>> export QEMU_NBD=_qemu_nbd_wrapper
>>
>> -default_machine=$($QEMU -machine \? | awk '/(default)/{print $1}')
>> -default_alias_machine=$($QEMU -machine \? |\
>> - awk -v var_default_machine="$default_machine"\)\
>> - '{if ($(NF-2)=="(alias"&&$(NF-1)=="of"&&$(NF)==var_default_machine){print $1}}')
>> -if [ ! -z "$default_alias_machine" ]; then
>> +default_machine=$($QEMU -machine help | sed -n '/(default)/ s/ .*//p')
>> +default_alias_machine=$($QEMU -machine help | \
>> + sed -n "/(alias of $default_machine)"/' { s/ .*//p; q; }')
>
> Could be shortened to "/(alias of $default_machine)/ { s/ .*//p; q; }"
> (superfluous quotation marks), but that doesn't make it less correct.
Yes. it can reduce two quotation marks. Good suggestion.
>
>
> With the commit message fixed:
>
> Reviewed-by: Max Reitz <mreitz@redhat.com>
I'll add it in the patch of v3.
>
>> +if [[ "$default_alias_machine" ]]; then
>> default_machine="$default_alias_machine"
>> fi
>>
>>
>
>
next prev parent reply other threads:[~2015-11-19 5:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 2:26 [Qemu-devel] [PATCH v2 0/4] Update tests/qemu-iotests failing cases for the s390 platform Bo Tu
2015-11-04 2:26 ` [Qemu-devel] [PATCH v2 1/4] qemu-iotests: refine common.config Bo Tu
2015-11-18 16:45 ` Max Reitz
2015-11-19 5:58 ` tu bo [this message]
2015-11-04 2:26 ` [Qemu-devel] [PATCH v2 2/4] qemu-iotests: s390x: fix test 051 Bo Tu
2015-11-18 16:52 ` Max Reitz
2015-11-19 7:28 ` tu bo
2015-11-20 16:24 ` Max Reitz
2015-11-23 3:34 ` tu bo
2015-11-24 21:17 ` Sascha Silbe
2015-11-25 15:41 ` Max Reitz
2015-11-26 10:15 ` tu bo
2015-11-04 2:26 ` [Qemu-devel] [PATCH v2 3/4] qemu-iotests: s390x: fix test 068 Bo Tu
2015-11-18 16:57 ` Max Reitz
2015-11-04 2:26 ` [Qemu-devel] [PATCH v2 4/4] qemu-iotests: disable VNC server for test 120 Bo Tu
2015-11-18 16:56 ` Max Reitz
2015-11-19 7:06 ` tu bo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=564D6510.9090203@linux.vnet.ibm.com \
--to=tubo@linux.vnet.ibm.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mimu@linux.vnet.ibm.com \
--cc=mreitz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=silbe@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).