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 From: Kevin Wolf 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> Subject: [Qemu-devel] [PULL 13/61] qemu-iotests: 068: extract _qemu() function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org 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" -- 1.8.3.1