Skip to content

Commit

Permalink
iotests: Give access to the qemu-storage-daemon
Browse files Browse the repository at this point in the history
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20201027190600.192171-18-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
XanClic authored and kevmw committed Dec 11, 2020
1 parent b55a3c8 commit cc575c3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/qemu-iotests/check
Expand Up @@ -644,6 +644,17 @@ if [ -z $QEMU_NBD_PROG ]; then
fi
export QEMU_NBD_PROG="$(type -p "$QEMU_NBD_PROG")"

if [ -z "$QSD_PROG" ]; then
if [ -x "$build_iotests/qemu-storage-daemon" ]; then
export QSD_PROG="$build_iotests/qemu-storage-daemon"
elif [ -x "$build_root/storage-daemon/qemu-storage-daemon" ]; then
export QSD_PROG="$build_root/storage-daemon/qemu-storage-daemon"
else
_init_error "qemu-storage-daemon not found"
fi
fi
export QSD_PROG="$(type -p "$QSD_PROG")"

if [ -x "$build_iotests/socket_scm_helper" ]
then
export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
Expand Down
17 changes: 17 additions & 0 deletions tests/qemu-iotests/common.rc
Expand Up @@ -124,6 +124,7 @@ fi
: ${VALGRIND_QEMU_IMG=$VALGRIND_QEMU}
: ${VALGRIND_QEMU_IO=$VALGRIND_QEMU}
: ${VALGRIND_QEMU_NBD=$VALGRIND_QEMU}
: ${VALGRIND_QSD=$VALGRIND_QEMU}

# The Valgrind own parameters may be set with
# its environment variable VALGRIND_OPTS, e.g.
Expand Down Expand Up @@ -211,6 +212,21 @@ _qemu_nbd_wrapper()
return $RETVAL
}

_qemu_storage_daemon_wrapper()
{
local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
(
if [ -n "${QSD_NEED_PID}" ]; then
echo $BASHPID > "${QEMU_TEST_DIR}/qemu-storage-daemon.pid"
fi
VALGRIND_QEMU="${VALGRIND_QSD}" _qemu_proc_exec "${VALGRIND_LOGFILE}" \
"$QSD_PROG" $QSD_OPTIONS "$@"
)
RETVAL=$?
_qemu_proc_valgrind_log "${VALGRIND_LOGFILE}" $RETVAL
return $RETVAL
}

# Valgrind bug #409141 https://bugs.kde.org/show_bug.cgi?id=409141
# Until valgrind 3.16+ is ubiquitous, we must work around a hang in
# valgrind when issuing sigkill. Disable valgrind for this invocation.
Expand All @@ -223,6 +239,7 @@ export QEMU=_qemu_wrapper
export QEMU_IMG=_qemu_img_wrapper
export QEMU_IO=_qemu_io_wrapper
export QEMU_NBD=_qemu_nbd_wrapper
export QSD=_qemu_storage_daemon_wrapper

if [ "$IMGOPTSSYNTAX" = "true" ]; then
DRIVER="driver=$IMGFMT"
Expand Down

0 comments on commit cc575c3

Please sign in to comment.