[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 27/54] qemu-iotests: limit non-_PROG-suffixed variabl
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 27/54] qemu-iotests: limit non-_PROG-suffixed variables to common.rc |
Date: |
Fri, 6 Oct 2017 17:53:55 +0200 |
From: Paolo Bonzini <address@hidden>
These are never used by "check", with one exception that does not need
$QEMU_OPTIONS. Keep them in common.rc, which will be soon included only
by the tests.
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/039.out | 10 +++---
tests/qemu-iotests/061.out | 4 +--
tests/qemu-iotests/137.out | 2 +-
tests/qemu-iotests/common.config | 69 ++--------------------------------------
tests/qemu-iotests/common.rc | 65 +++++++++++++++++++++++++++++++++++++
5 files changed, 75 insertions(+), 75 deletions(-)
diff --git a/tests/qemu-iotests/039.out b/tests/qemu-iotests/039.out
index c6e0ac2da3..724d7b2508 100644
--- a/tests/qemu-iotests/039.out
+++ b/tests/qemu-iotests/039.out
@@ -11,7 +11,7 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ];
then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
@@ -50,7 +50,7 @@ read 512/512 bytes at offset 0
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ];
then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
@@ -68,7 +68,7 @@ incompatible_features 0x0
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ];
then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
@@ -91,7 +91,7 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ];
then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
@@ -105,7 +105,7 @@ Data may be corrupted, or further writes to the image may
corrupt it.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ];
then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out
index a431b7f305..942485de99 100644
--- a/tests/qemu-iotests/061.out
+++ b/tests/qemu-iotests/061.out
@@ -57,7 +57,7 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
wrote 131072/131072 bytes at offset 0
128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ];
then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
@@ -219,7 +219,7 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
wrote 131072/131072 bytes at offset 0
128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ];
then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
diff --git a/tests/qemu-iotests/137.out b/tests/qemu-iotests/137.out
index c0e753483b..05efd74d17 100644
--- a/tests/qemu-iotests/137.out
+++ b/tests/qemu-iotests/137.out
@@ -31,7 +31,7 @@ Cache clean interval too big
Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are any of
the following: none, constant, cached, all
wrote 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-./common.config: Killed ( if [ "${VALGRIND_QEMU}" == "y" ];
then
+./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then
exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
else
exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index c97c63983f..c7f0a7a7e0 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -40,71 +40,6 @@ _optstr_add()
fi
}
-_qemu_wrapper()
-{
- (
- if [ -n "${QEMU_NEED_PID}" ]; then
- echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid"
- fi
- exec "$QEMU_PROG" $QEMU_OPTIONS "$@"
- )
-}
-
-_qemu_img_wrapper()
-{
- (exec "$QEMU_IMG_PROG" $QEMU_IMG_OPTIONS "$@")
-}
-
-_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"
- if [ -n "$IMGKEYSECRET" ]; then
- QEMU_IO_ARGS="--object secret,id=keysec0,data=$IMGKEYSECRET
$QEMU_IO_ARGS"
- fi
- fi
- local RETVAL
- (
- if [ "${VALGRIND_QEMU}" == "y" ]; then
- exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
- else
- exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
- 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()
-{
- (
- echo $BASHPID > "${QEMU_TEST_DIR}/qemu-nbd.pid"
- exec "$QEMU_NBD_PROG" $QEMU_NBD_OPTIONS "$@"
- )
-}
-
-_qemu_vxhs_wrapper()
-{
- (
- echo $BASHPID > "${TEST_DIR}/qemu-vxhs.pid"
- exec "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@"
- )
-}
-
-export QEMU=_qemu_wrapper
-export QEMU_IMG=_qemu_img_wrapper
-export QEMU_IO=_qemu_io_wrapper
-export QEMU_NBD=_qemu_nbd_wrapper
-export QEMU_VXHS=_qemu_vxhs_wrapper
-
QEMU_IMG_EXTRA_ARGS=
if [ "$IMGOPTSSYNTAX" = "true" ]; then
QEMU_IMG_EXTRA_ARGS="--image-opts $QEMU_IMG_EXTRA_ARGS"
@@ -115,8 +50,8 @@ fi
export QEMU_IMG_EXTRA_ARGS
-default_machine=$($QEMU -machine help | sed -n '/(default)/ s/ .*//p')
-default_alias_machine=$($QEMU -machine help | \
+default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')
+default_alias_machine=$($QEMU_PROG -machine help | \
sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }")
if [[ "$default_alias_machine" ]]; then
default_machine="$default_alias_machine"
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 6f6e03366f..e7f74b4dbd 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -50,6 +50,71 @@ then
fi
fi
+_qemu_wrapper()
+{
+ (
+ if [ -n "${QEMU_NEED_PID}" ]; then
+ echo $BASHPID > "${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid"
+ fi
+ exec "$QEMU_PROG" $QEMU_OPTIONS "$@"
+ )
+}
+
+_qemu_img_wrapper()
+{
+ (exec "$QEMU_IMG_PROG" $QEMU_IMG_OPTIONS "$@")
+}
+
+_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"
+ if [ -n "$IMGKEYSECRET" ]; then
+ QEMU_IO_ARGS="--object secret,id=keysec0,data=$IMGKEYSECRET
$QEMU_IO_ARGS"
+ fi
+ fi
+ local RETVAL
+ (
+ if [ "${VALGRIND_QEMU}" == "y" ]; then
+ exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
+ else
+ exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@"
+ 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()
+{
+ (
+ echo $BASHPID > "${QEMU_TEST_DIR}/qemu-nbd.pid"
+ exec "$QEMU_NBD_PROG" $QEMU_NBD_OPTIONS "$@"
+ )
+}
+
+_qemu_vxhs_wrapper()
+{
+ (
+ echo $BASHPID > "${TEST_DIR}/qemu-vxhs.pid"
+ exec "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@"
+ )
+}
+
+export QEMU=_qemu_wrapper
+export QEMU_IMG=_qemu_img_wrapper
+export QEMU_IO=_qemu_io_wrapper
+export QEMU_NBD=_qemu_nbd_wrapper
+export QEMU_VXHS=_qemu_vxhs_wrapper
+
if [ "$IMGOPTSSYNTAX" = "true" ]; then
DRIVER="driver=$IMGFMT"
if [ "$IMGFMT" = "luks" ]; then
--
2.13.6
- [Qemu-block] [PULL 18/54] qcow2: Switch load_bitmap_data() to byte-based iteration, (continued)
- [Qemu-block] [PULL 18/54] qcow2: Switch load_bitmap_data() to byte-based iteration, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 20/54] dirty-bitmap: Switch bdrv_set_dirty() to bytes, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 21/54] dirty-bitmap: Convert internal hbitmap size/granularity, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 23/54] qemu-iotests: remove dead code, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 22/54] hw/block/onenand: Remove dead code block, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 24/54] qemu-iotests: get rid of AWK_PROG, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 25/54] qemu-iotests: move "check" code out of common.rc, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 26/54] qemu-iotests: cleanup and fix search for programs, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 30/54] qemu-iotests: fix uninitialized variable, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 28/54] qemu-iotests: do not include common.rc in "check", Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 27/54] qemu-iotests: limit non-_PROG-suffixed variables to common.rc,
Kevin Wolf <=
- [Qemu-block] [PULL 31/54] qemu-iotests: get rid of $iam, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 29/54] qemu-iotests: disintegrate more parts of common.config, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 33/54] block: Introduce BdrvChildRole.update_filename, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 32/54] qemu-iotests: merge "check" and "common", Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 34/54] commit: Support multiple roots above top node, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 35/54] qemu-iotests: Allow QMP pretty printing in common.qemu, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 38/54] qemu-io: Add -C for opening with copy-on-read, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 41/54] block: Add blkdebug hook for copy-on-read, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 37/54] commit: Remove overlay_bs, Kevin Wolf, 2017/10/06
- [Qemu-block] [PULL 39/54] block: Uniform handling of 0-length bdrv_get_block_status(), Kevin Wolf, 2017/10/06