[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 38/41] qemu-iotests: Valgrind support
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 38/41] qemu-iotests: Valgrind support |
Date: |
Tue, 17 Jul 2012 18:00:35 +0200 |
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 <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
---
tests/qemu-iotests/common | 11 +++++++++++
tests/qemu-iotests/common.rc | 10 ++++++++++
2 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index eeb70cb..1f6fdf5 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
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index e535874..5e3a524 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -53,6 +53,16 @@ else
TEST_IMG=$IMGPROTO:$TEST_DIR/t.$IMGFMT
fi
+function valgrind_qemu_io()
+{
+ valgrind --log-file=/tmp/$$.valgrind --error-exitcode=99 $REAL_QEMU_IO "$@"
+ if [ $? != 0 ]; then
+ cat /tmp/$$.valgrind
+ fi
+ rm -f /tmp/$$.valgrind
+}
+
+
_optstr_add()
{
if [ -n "$1" ]; then
--
1.7.6.5
- [Qemu-devel] [PATCH 30/41] blockdev: Drop redundant CHS validation for if=ide, (continued)
- [Qemu-devel] [PATCH 30/41] blockdev: Drop redundant CHS validation for if=ide, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 27/41] ide pc: Put hard disk info into CMOS only for hard disks, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 31/41] Relax IDE CHS limits from 16383, 16, 63 to 65535, 16, 255, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 41/41] fdc-test: Clean up a bit, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 37/41] coroutine-ucontext: Help valgrind understand coroutines, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 24/41] ide: qdev property for BIOS CHS translation, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 25/41] qtest: Cover qdev property for BIOS CHS translation, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 18/41] scsi-hd: qdev properties for disk geometry, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 26/41] block: Geometry and translation hints are now useless, purge them, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 32/41] hw/block-common: Move BlockConf & friends from block.h, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 38/41] qemu-iotests: Valgrind support,
Kevin Wolf <=
- [Qemu-devel] [PATCH 28/41] qtest: Test we don't put hard disk info into CMOS for a CD-ROM, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 34/41] blockdev: Don't limit DriveInfo serial to 20 characters, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 12/41] hd-geometry: Clean up confusing use of prior translation hint, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 21/41] qtest: Cover qdev properties for disk geometry, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 23/41] qdev: New property type chs-translation, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 17/41] hd-geometry: Switch to uint32_t to match BlockConf, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 40/41] fdc-test: introduce test_relative_seek, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 36/41] qemu-io: Fix memory leaks, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 19/41] virtio-blk: qdev properties for disk geometry, Kevin Wolf, 2012/07/17
- [Qemu-devel] [PATCH 20/41] ide: qdev properties for disk geometry, Kevin Wolf, 2012/07/17