aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2017-06-15 17:38:11 +0100
committerKevin Wolf <kwolf@redhat.com>2017-06-26 14:51:13 +0200
commit79645e0569e7a95f5c9bee67eb62b06daaed8099 (patch)
treed07bd2b15792c4bdb82bf8188b5787125bfedc00 /tests/qemu-iotests
parent1575829d2aaced8ce6a5728d8e9fbbdee8f80885 (diff)
downloadqemu-79645e0569e7a95f5c9bee67eb62b06daaed8099.zip
qemu-79645e0569e7a95f5c9bee67eb62b06daaed8099.tar.gz
qemu-79645e0569e7a95f5c9bee67eb62b06daaed8099.tar.bz2
qemu-iotests: 068: extract _qemu() function
Avoid duplicating the QEMU command-line. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests')
-rwxr-xr-xtests/qemu-iotests/06815
1 files 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"