summaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/common
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2012-06-28 16:55:54 +0200
committerKevin Wolf <kwolf@redhat.com>2012-07-17 16:48:32 +0200
commit2f24e8fb8d684f576f3dcced820860d70652a7f9 (patch)
tree3b643eee61034d6b1b1e9bee5617f1adc976009b /tests/qemu-iotests/common
parent3f4349dc8b9494315f8331b2ea4e8d1f83fb801d (diff)
downloadqemu-2f24e8fb8d684f576f3dcced820860d70652a7f9.tar.gz
qemu-iotests: Valgrind support
check -valgrind wraps all qemu-io calls with valgrind. This makes it a bit easier to debug problems that occur somewhere deep in a test case. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/common')
-rw-r--r--tests/qemu-iotests/common11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index eeb70cbcdc..1f6fdf5c56 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -41,6 +41,7 @@ sortme=false
expunge=true
have_test_arg=false
randomize=false
+valgrind=false
rm -f $tmp.list $tmp.tmp $tmp.sed
export IMGFMT=raw
@@ -212,6 +213,11 @@ testlist options
xpand=false
;;
+ -valgrind)
+ valgrind=true
+ xpand=false
+ ;;
+
-g) # -g group ... pick from group file
group=true
xpand=false
@@ -345,3 +351,8 @@ fi
[ "$QEMU" = "" ] && _fatal "qemu not found"
[ "$QEMU_IMG" = "" ] && _fatal "qemu-img not found"
[ "$QEMU_IO" = "" ] && _fatal "qemu-img not found"
+
+if $valgrind; then
+ export REAL_QEMU_IO="$QEMU_IO_PROG"
+ export QEMU_IO_PROG=valgrind_qemu_io
+fi