From nobody Tue Feb 10 19:23:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505227868417168.19979374972922; Tue, 12 Sep 2017 07:51:08 -0700 (PDT) Received: from localhost ([::1]:36331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drmWp-0000Ju-L1 for importer@patchew.org; Tue, 12 Sep 2017 10:51:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drmRS-00043X-Mg for qemu-devel@nongnu.org; Tue, 12 Sep 2017 10:45:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drmRO-0001uD-1f for qemu-devel@nongnu.org; Tue, 12 Sep 2017 10:45:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56102) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1drmRB-0001nN-50; Tue, 12 Sep 2017 10:45:17 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2889E85550; Tue, 12 Sep 2017 14:45:16 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-43.ams2.redhat.com [10.36.117.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70920784A6; Tue, 12 Sep 2017 14:45:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2889E85550 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 12 Sep 2017 16:44:54 +0200 Message-Id: <20170912144459.11359-6-pbonzini@redhat.com> In-Reply-To: <20170912144459.11359-1-pbonzini@redhat.com> References: <20170912144459.11359-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 12 Sep 2017 14:45:16 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 05/10] qemu-iotests: limit non-_PROG-suffixed variables to common.rc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Eric Blake --- 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=3DIMGFMT size=3D134217728 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}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$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=3DIMGFMT size=3D134217728 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}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$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=3DIMGFMT size=3D134217728 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}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$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=3DIMGFMT size=3D134217728 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}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$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 m= ay corrupt it. Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 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}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$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=3DIMGFMT size=3D67108864 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}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$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=3DIMGFMT size=3D67108864 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}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$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 an= y 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}" =3D=3D = "y" ]; then +./common.rc: Killed ( if [ "${VALGRIND_QEMU}" =3D=3D "y" = ]; then exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitcode=3D99= "$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.c= onfig index c97c63983f..c7f0a7a7e0 100644 --- a/tests/qemu-iotests/common.config +++ b/tests/qemu-iotests/common.config @@ -40,71 +40,6 @@ _optstr_add() fi } =20 -_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=3D"${TEST_DIR}"/$$.valgrind - local QEMU_IO_ARGS=3D"$QEMU_IO_OPTIONS" - if [ "$IMGOPTSSYNTAX" =3D "true" ]; then - QEMU_IO_ARGS=3D"--image-opts $QEMU_IO_ARGS" - if [ -n "$IMGKEYSECRET" ]; then - QEMU_IO_ARGS=3D"--object secret,id=3Dkeysec0,data=3D$IMGKEYSEC= RET $QEMU_IO_ARGS" - fi - fi - local RETVAL - ( - if [ "${VALGRIND_QEMU}" =3D=3D "y" ]; then - exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitc= ode=3D99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" - else - exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" - fi - ) - RETVAL=3D$? - if [ "${VALGRIND_QEMU}" =3D=3D "y" ]; then - if [ $RETVAL =3D=3D 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=3D_qemu_wrapper -export QEMU_IMG=3D_qemu_img_wrapper -export QEMU_IO=3D_qemu_io_wrapper -export QEMU_NBD=3D_qemu_nbd_wrapper -export QEMU_VXHS=3D_qemu_vxhs_wrapper - QEMU_IMG_EXTRA_ARGS=3D if [ "$IMGOPTSSYNTAX" =3D "true" ]; then QEMU_IMG_EXTRA_ARGS=3D"--image-opts $QEMU_IMG_EXTRA_ARGS" @@ -115,8 +50,8 @@ fi export QEMU_IMG_EXTRA_ARGS =20 =20 -default_machine=3D$($QEMU -machine help | sed -n '/(default)/ s/ .*//p') -default_alias_machine=3D$($QEMU -machine help | \ +default_machine=3D$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//= p') +default_alias_machine=3D$($QEMU_PROG -machine help | \ sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }") if [[ "$default_alias_machine" ]]; then default_machine=3D"$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 =20 +_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=3D"${TEST_DIR}"/$$.valgrind + local QEMU_IO_ARGS=3D"$QEMU_IO_OPTIONS" + if [ "$IMGOPTSSYNTAX" =3D "true" ]; then + QEMU_IO_ARGS=3D"--image-opts $QEMU_IO_ARGS" + if [ -n "$IMGKEYSECRET" ]; then + QEMU_IO_ARGS=3D"--object secret,id=3Dkeysec0,data=3D$IMGKEYSEC= RET $QEMU_IO_ARGS" + fi + fi + local RETVAL + ( + if [ "${VALGRIND_QEMU}" =3D=3D "y" ]; then + exec valgrind --log-file=3D"${VALGRIND_LOGFILE}" --error-exitc= ode=3D99 "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" + else + exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@" + fi + ) + RETVAL=3D$? + if [ "${VALGRIND_QEMU}" =3D=3D "y" ]; then + if [ $RETVAL =3D=3D 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=3D_qemu_wrapper +export QEMU_IMG=3D_qemu_img_wrapper +export QEMU_IO=3D_qemu_io_wrapper +export QEMU_NBD=3D_qemu_nbd_wrapper +export QEMU_VXHS=3D_qemu_vxhs_wrapper + if [ "$IMGOPTSSYNTAX" =3D "true" ]; then DRIVER=3D"driver=3D$IMGFMT" if [ "$IMGFMT" =3D "luks" ]; then --=20 2.13.5