From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzIFE-0008Hz-7p for qemu-devel@nongnu.org; Thu, 19 Nov 2015 00:58:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzIF9-0003bi-8J for qemu-devel@nongnu.org; Thu, 19 Nov 2015 00:58:56 -0500 Received: from e39.co.us.ibm.com ([32.97.110.160]:49412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzIF9-0003bS-1i for qemu-devel@nongnu.org; Thu, 19 Nov 2015 00:58:51 -0500 Received: from localhost by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 18 Nov 2015 22:58:47 -0700 Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id E285B6E8048 for ; Thu, 19 Nov 2015 00:46:54 -0500 (EST) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tAJ5wiAF58458164 for ; Thu, 19 Nov 2015 05:58:44 GMT Received: from d01av02.pok.ibm.com (localhost [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tAJ5whk6032711 for ; Thu, 19 Nov 2015 00:58:43 -0500 References: <1446604018-14025-1-git-send-email-tubo@linux.vnet.ibm.com> <1446604018-14025-2-git-send-email-tubo@linux.vnet.ibm.com> <564CAB2F.9060300@redhat.com> From: tu bo Message-ID: <564D6510.9090203@linux.vnet.ibm.com> Date: Thu, 19 Nov 2015 13:58:40 +0800 MIME-Version: 1.0 In-Reply-To: <564CAB2F.9060300@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/4] qemu-iotests: refine common.config List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: kwolf@redhat.com, silbe@linux.vnet.ibm.com, armbru@redhat.com, mimu@linux.vnet.ibm.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 >> Reviewed-by: Sascha Silbe >> Reviewed-by: Eric Blake >> Signed-off-by: Bo Tu >> --- >> 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 I'll add it in the patch of v3. > >> +if [[ "$default_alias_machine" ]]; then >> default_machine="$default_alias_machine" >> fi >> >> > >