summaryrefslogtreecommitdiffstats
path: root/tests/qemu-iotests/common.config
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qemu-iotests/common.config')
-rw-r--r--tests/qemu-iotests/common.config18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index be99730..3ed51b8 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -122,7 +122,23 @@ _qemu_img_wrapper()
_qemu_io_wrapper()
{
- (exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@")
+ local VALGRIND_LOGFILE=/tmp/$$.valgrind
+ local RETVAL
+ (
+ if [ "${VALGRIND_QEMU}" == "y" ]; then
+ exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"
+ else
+ exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"
+ fi
+ )
+ RETVAL=$?
+ if [ "${VALGRIND_QEMU}" == "y" ]; then
+ if [ $RETVAL == 99 ]; then
+ cat "${VALGRIND_LOGFILE}"
+ fi
+ rm -f "${VALGRIND_LOGFILE}"
+ fi
+ (exit $RETVAL)
}
_qemu_nbd_wrapper()
OpenPOWER on IntegriCloud