summaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/common.config
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2016-05-10 17:11:27 +0100
committerMax Reitz <mreitz@redhat.com>2016-05-12 15:33:24 +0200
commit076003f526cebbf5bbef826f752019da5d2c3e89 (patch)
tree9ae26099af9695c6c4deb782a9b62e3dea6e7833 /tests/qemu-iotests/common.config
parentc2e001cc829031f9c2e2c364c77861e3f75ac871 (diff)
downloadqemu-076003f526cebbf5bbef826f752019da5d2c3e89.zip
block: add support for --image-opts in block I/O tests
Currently all block tests use the traditional syntax for images just specifying a filename. To support the LUKS driver without resorting to JSON, the tests need to be able to use the new --image-opts argument to qemu-img and qemu-io. This introduces a new env variable IMGOPTSSYNTAX. If this is set to 'true', then qemu-img/qemu-io should use --image-opts. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 1462896689-18450-2-git-send-email-berrange@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/common.config')
-rw-r--r--tests/qemu-iotests/common.config15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index f824651bac..ea698da92e 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -123,12 +123,16 @@ _qemu_img_wrapper()
_qemu_io_wrapper()
{
local VALGRIND_LOGFILE="${TEST_DIR}"/$$.valgrind
+ local QEMU_IO_ARGS="$QEMU_IO_OPTIONS"
+ if [ "$IMGOPTSSYNTAX" = "true" ]; then
+ QEMU_IO_ARGS="--image-opts $QEMU_IO_ARGS"
+ fi
local RETVAL
(
if [ "${VALGRIND_QEMU}" == "y" ]; then
- exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"
+ exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
else
- exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@"
+ exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
fi
)
RETVAL=$?
@@ -154,6 +158,13 @@ export QEMU_IMG=_qemu_img_wrapper
export QEMU_IO=_qemu_io_wrapper
export QEMU_NBD=_qemu_nbd_wrapper
+QEMU_IMG_EXTRA_ARGS=
+if [ "$IMGOPTSSYNTAX" = "true" ]; then
+ QEMU_IMG_EXTRA_ARGS="--image-opts $QEMU_IMG_EXTRA_ARGS"
+fi
+export QEMU_IMG_EXTRA_ARGS
+
+
default_machine=$($QEMU -machine help | sed -n '/(default)/ s/ .*//p')
default_alias_machine=$($QEMU -machine help | \
sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }")