From patchwork Fri Oct 30 07:13:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bo Tu X-Patchwork-Id: 538183 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 80D981412D8 for ; Fri, 30 Oct 2015 18:16:37 +1100 (AEDT) Received: from localhost ([::1]:48891 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zs3vP-0001Dz-8d for incoming@patchwork.ozlabs.org; Fri, 30 Oct 2015 03:16:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zs3tA-0006oh-SE for qemu-devel@nongnu.org; Fri, 30 Oct 2015 03:14:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zs3t7-0007W7-DS for qemu-devel@nongnu.org; Fri, 30 Oct 2015 03:14:16 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:38648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zs3t6-0007Vk-Qt for qemu-devel@nongnu.org; Fri, 30 Oct 2015 03:14:13 -0400 Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Oct 2015 17:14:06 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 30 Oct 2015 17:14:04 +1000 X-IBM-Helo: d23dlp02.au.ibm.com X-IBM-MailFrom: tubo@linux.vnet.ibm.com X-IBM-RcptTo: qemu-devel@nongnu.org Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id A66BC2BB0054 for ; Fri, 30 Oct 2015 18:14:04 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t9U7DlGE12517578 for ; Fri, 30 Oct 2015 18:13:59 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t9U7DSDi001241 for ; Fri, 30 Oct 2015 18:13:29 +1100 Received: from oc6333346435.ibm.com ([9.115.114.149]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t9U7DQZl000811; Fri, 30 Oct 2015 18:13:27 +1100 From: Bo Tu To: qemu-devel@nongnu.org Date: Fri, 30 Oct 2015 15:13:03 +0800 Message-Id: <1446189186-23104-1-git-send-email-tubo@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15103007-0017-0000-0000-00000221F0D8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 202.81.31.147 Cc: kwolf@redhat.com, silbe@linux.vnet.ibm.com, mreitz@redhat.com, armbru@redhat.com, mimu@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH v1 1/4] qemu-iotests: refine common.config X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Be easier to read, and be slightly shorter. Suggested-By: Sascha Silbe Reviewed-by: Sascha Silbe Signed-off-by: Bo Tu --- tests/qemu-iotests/common.config | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config index 596bb2b..0a165e8 100644 --- a/tests/qemu-iotests/common.config +++ b/tests/qemu-iotests/common.config @@ -129,10 +129,9 @@ 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_alias_machine=$($QEMU -machine \? \ + | grep -F "(alias of ${default_machine})" |cut -d ' ' -f 1 |head -n 1) +if [ -n "$default_alias_machine" ]; then default_machine="$default_alias_machine" fi