From patchwork Fri Jun 23 16:21:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 780104 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 3wvPCV5dzGz9sNW for ; Sat, 24 Jun 2017 02:33:42 +1000 (AEST) Received: from localhost ([::1]:36273 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dORWd-00036B-CL for incoming@patchwork.ozlabs.org; Fri, 23 Jun 2017 12:33:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dORLj-0000o8-Sd for qemu-devel@nongnu.org; Fri, 23 Jun 2017 12:22:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dORLi-0007YJ-Vb for qemu-devel@nongnu.org; Fri, 23 Jun 2017 12:22:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45996) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dORLg-0007Wc-Vm; Fri, 23 Jun 2017 12:22:21 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F37F5120E8; Fri, 23 Jun 2017 16:22:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F37F5120E8 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kwolf@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com F37F5120E8 Received: from noname.redhat.com (ovpn-117-196.ams2.redhat.com [10.36.117.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14BD26EC75; Fri, 23 Jun 2017 16:22:18 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Fri, 23 Jun 2017 18:21:11 +0200 Message-Id: <1498234919-27316-14-git-send-email-kwolf@redhat.com> In-Reply-To: <1498234919-27316-1-git-send-email-kwolf@redhat.com> References: <1498234919-27316-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 23 Jun 2017 16:22:20 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 13/61] qemu-iotests: 068: extract _qemu() function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Stefan Hajnoczi Avoid duplicating the QEMU command-line. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- tests/qemu-iotests/068 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/068 b/tests/qemu-iotests/068 index 9c1687d..61936d5 100755 --- a/tests/qemu-iotests/068 +++ b/tests/qemu-iotests/068 @@ -59,14 +59,17 @@ case "$QEMU_DEFAULT_MACHINE" in ;; esac -# Give qemu some time to boot before saving the VM state -bash -c 'sleep 1; echo -e "savevm 0\nquit"' |\ - $QEMU $platform_parm -nographic -monitor stdio -serial none -hda "$TEST_IMG" |\ +_qemu() +{ + $QEMU $platform_parm -nographic -monitor stdio -serial none -hda "$TEST_IMG" \ + "$@" |\ _filter_qemu | _filter_hmp +} + +# Give qemu some time to boot before saving the VM state +bash -c 'sleep 1; echo -e "savevm 0\nquit"' | _qemu # Now try to continue from that VM state (this should just work) -echo quit |\ - $QEMU $platform_parm -nographic -monitor stdio -serial none -hda "$TEST_IMG" -loadvm 0 |\ - _filter_qemu | _filter_hmp +echo quit | _qemu -loadvm 0 # success, all done echo "*** done"