{"id":812893,"url":"http://patchwork.ozlabs.org/api/patches/812893/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170912144459.11359-6-pbonzini@redhat.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170912144459.11359-6-pbonzini@redhat.com>","list_archive_url":null,"date":"2017-09-12T14:44:54","name":"[05/10] qemu-iotests: limit non-_PROG-suffixed variables to common.rc","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"44f52df7147352e7fbf841a798a73004cafdf8c3","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/?format=json","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170912144459.11359-6-pbonzini@redhat.com/mbox/","series":[{"id":2722,"url":"http://patchwork.ozlabs.org/api/series/2722/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2722","date":"2017-09-12T14:44:51","name":"cleanup qemu-iotests","version":1,"mbox":"http://patchwork.ozlabs.org/series/2722/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812893/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812893/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=pbonzini@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xs74G3SgGz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 00:49:50 +1000 (AEST)","from localhost ([::1]:36321 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drmVY-0007An-HA\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 10:49:48 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:51907)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1drmRS-00043X-Mg\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 10:45:36 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <pbonzini@redhat.com>) id 1drmRO-0001uD-1f\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 10:45:34 -0400","from mx1.redhat.com ([209.132.183.28]:56102)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <pbonzini@redhat.com>)\n\tid 1drmRB-0001nN-50; Tue, 12 Sep 2017 10:45:17 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 2889E85550;\n\tTue, 12 Sep 2017 14:45:16 +0000 (UTC)","from donizetti.redhat.com (ovpn-117-43.ams2.redhat.com\n\t[10.36.117.43])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 70920784A6;\n\tTue, 12 Sep 2017 14:45:14 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 2889E85550","From":"Paolo Bonzini <pbonzini@redhat.com>","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\n\t(mx1.redhat.com [10.5.110.28]);\n\tTue, 12 Sep 2017 14:45:16 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"[Qemu-devel] [PATCH 05/10] qemu-iotests: limit non-_PROG-suffixed\n\tvariables to common.rc","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"kwolf@redhat.com, qemu-block@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"These are never used by \"check\", with one exception that does not need\n$QEMU_OPTIONS.  Keep them in common.rc, which will be soon included only\nby the tests.\n\nSigned-off-by: Paolo Bonzini <pbonzini@redhat.com>\n---\n tests/qemu-iotests/039.out       | 10 +++---\n tests/qemu-iotests/061.out       |  4 +--\n tests/qemu-iotests/137.out       |  2 +-\n tests/qemu-iotests/common.config | 69 ++--------------------------------------\n tests/qemu-iotests/common.rc     | 65 +++++++++++++++++++++++++++++++++++++\n 5 files changed, 75 insertions(+), 75 deletions(-)","diff":"diff --git a/tests/qemu-iotests/039.out b/tests/qemu-iotests/039.out\nindex c6e0ac2da3..724d7b2508 100644\n--- a/tests/qemu-iotests/039.out\n+++ b/tests/qemu-iotests/039.out\n@@ -11,7 +11,7 @@ No errors were found on the image.\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728\n wrote 512/512 bytes at offset 0\n 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n-./common.config: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n+./common.rc: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n     exec valgrind --log-file=\"${VALGRIND_LOGFILE}\" --error-exitcode=99 \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\n else\n     exec \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\n@@ -50,7 +50,7 @@ read 512/512 bytes at offset 0\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728\n wrote 512/512 bytes at offset 0\n 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n-./common.config: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n+./common.rc: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n     exec valgrind --log-file=\"${VALGRIND_LOGFILE}\" --error-exitcode=99 \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\n else\n     exec \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\n@@ -68,7 +68,7 @@ incompatible_features     0x0\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728\n wrote 512/512 bytes at offset 0\n 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n-./common.config: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n+./common.rc: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n     exec valgrind --log-file=\"${VALGRIND_LOGFILE}\" --error-exitcode=99 \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\n else\n     exec \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\n@@ -91,7 +91,7 @@ No errors were found on the image.\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728\n wrote 512/512 bytes at offset 0\n 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n-./common.config: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n+./common.rc: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n     exec valgrind --log-file=\"${VALGRIND_LOGFILE}\" --error-exitcode=99 \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\n else\n     exec \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\n@@ -105,7 +105,7 @@ Data may be corrupted, or further writes to the image may corrupt it.\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728\n wrote 512/512 bytes at offset 0\n 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n-./common.config: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n+./common.rc: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n     exec valgrind --log-file=\"${VALGRIND_LOGFILE}\" --error-exitcode=99 \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\n else\n     exec \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\ndiff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out\nindex a431b7f305..942485de99 100644\n--- a/tests/qemu-iotests/061.out\n+++ b/tests/qemu-iotests/061.out\n@@ -57,7 +57,7 @@ No errors were found on the image.\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864\n wrote 131072/131072 bytes at offset 0\n 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n-./common.config: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n+./common.rc: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n     exec valgrind --log-file=\"${VALGRIND_LOGFILE}\" --error-exitcode=99 \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\n else\n     exec \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\n@@ -219,7 +219,7 @@ No errors were found on the image.\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864\n wrote 131072/131072 bytes at offset 0\n 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n-./common.config: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n+./common.rc: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n     exec valgrind --log-file=\"${VALGRIND_LOGFILE}\" --error-exitcode=99 \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\n else\n     exec \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\ndiff --git a/tests/qemu-iotests/137.out b/tests/qemu-iotests/137.out\nindex c0e753483b..05efd74d17 100644\n--- a/tests/qemu-iotests/137.out\n+++ b/tests/qemu-iotests/137.out\n@@ -31,7 +31,7 @@ Cache clean interval too big\n Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are any of the following: none, constant, cached, all\n wrote 512/512 bytes at offset 0\n 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n-./common.config: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n+./common.rc: Killed                  ( if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n     exec valgrind --log-file=\"${VALGRIND_LOGFILE}\" --error-exitcode=99 \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\n else\n     exec \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\";\ndiff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config\nindex c97c63983f..c7f0a7a7e0 100644\n--- a/tests/qemu-iotests/common.config\n+++ b/tests/qemu-iotests/common.config\n@@ -40,71 +40,6 @@ _optstr_add()\n     fi\n }\n \n-_qemu_wrapper()\n-{\n-    (\n-        if [ -n \"${QEMU_NEED_PID}\" ]; then\n-            echo $BASHPID > \"${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid\"\n-        fi\n-        exec \"$QEMU_PROG\" $QEMU_OPTIONS \"$@\"\n-    )\n-}\n-\n-_qemu_img_wrapper()\n-{\n-    (exec \"$QEMU_IMG_PROG\" $QEMU_IMG_OPTIONS \"$@\")\n-}\n-\n-_qemu_io_wrapper()\n-{\n-    local VALGRIND_LOGFILE=\"${TEST_DIR}\"/$$.valgrind\n-    local QEMU_IO_ARGS=\"$QEMU_IO_OPTIONS\"\n-    if [ \"$IMGOPTSSYNTAX\" = \"true\" ]; then\n-        QEMU_IO_ARGS=\"--image-opts $QEMU_IO_ARGS\"\n-        if [ -n \"$IMGKEYSECRET\" ]; then\n-            QEMU_IO_ARGS=\"--object secret,id=keysec0,data=$IMGKEYSECRET $QEMU_IO_ARGS\"\n-        fi\n-    fi\n-    local RETVAL\n-    (\n-        if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n-            exec valgrind --log-file=\"${VALGRIND_LOGFILE}\" --error-exitcode=99 \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\"\n-        else\n-            exec \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\"\n-        fi\n-    )\n-    RETVAL=$?\n-    if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n-        if [ $RETVAL == 99 ]; then\n-            cat \"${VALGRIND_LOGFILE}\"\n-        fi\n-        rm -f \"${VALGRIND_LOGFILE}\"\n-    fi\n-    (exit $RETVAL)\n-}\n-\n-_qemu_nbd_wrapper()\n-{\n-    (\n-        echo $BASHPID > \"${QEMU_TEST_DIR}/qemu-nbd.pid\"\n-        exec \"$QEMU_NBD_PROG\" $QEMU_NBD_OPTIONS \"$@\"\n-    )\n-}\n-\n-_qemu_vxhs_wrapper()\n-{\n-    (\n-        echo $BASHPID > \"${TEST_DIR}/qemu-vxhs.pid\"\n-        exec \"$QEMU_VXHS_PROG\" $QEMU_VXHS_OPTIONS \"$@\"\n-    )\n-}\n-\n-export QEMU=_qemu_wrapper\n-export QEMU_IMG=_qemu_img_wrapper\n-export QEMU_IO=_qemu_io_wrapper\n-export QEMU_NBD=_qemu_nbd_wrapper\n-export QEMU_VXHS=_qemu_vxhs_wrapper\n-\n QEMU_IMG_EXTRA_ARGS=\n if [ \"$IMGOPTSSYNTAX\" = \"true\" ]; then\n     QEMU_IMG_EXTRA_ARGS=\"--image-opts $QEMU_IMG_EXTRA_ARGS\"\n@@ -115,8 +50,8 @@ fi\n export QEMU_IMG_EXTRA_ARGS\n \n \n-default_machine=$($QEMU -machine help | sed -n '/(default)/ s/ .*//p')\n-default_alias_machine=$($QEMU -machine help | \\\n+default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')\n+default_alias_machine=$($QEMU_PROG -machine help | \\\n    sed -n \"/(alias of $default_machine)/ { s/ .*//p; q; }\")\n if [[ \"$default_alias_machine\" ]]; then\n     default_machine=\"$default_alias_machine\"\ndiff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc\nindex 6f6e03366f..e7f74b4dbd 100644\n--- a/tests/qemu-iotests/common.rc\n+++ b/tests/qemu-iotests/common.rc\n@@ -50,6 +50,71 @@ then\n     fi\n fi\n \n+_qemu_wrapper()\n+{\n+    (\n+        if [ -n \"${QEMU_NEED_PID}\" ]; then\n+            echo $BASHPID > \"${QEMU_TEST_DIR}/qemu-${_QEMU_HANDLE}.pid\"\n+        fi\n+        exec \"$QEMU_PROG\" $QEMU_OPTIONS \"$@\"\n+    )\n+}\n+\n+_qemu_img_wrapper()\n+{\n+    (exec \"$QEMU_IMG_PROG\" $QEMU_IMG_OPTIONS \"$@\")\n+}\n+\n+_qemu_io_wrapper()\n+{\n+    local VALGRIND_LOGFILE=\"${TEST_DIR}\"/$$.valgrind\n+    local QEMU_IO_ARGS=\"$QEMU_IO_OPTIONS\"\n+    if [ \"$IMGOPTSSYNTAX\" = \"true\" ]; then\n+        QEMU_IO_ARGS=\"--image-opts $QEMU_IO_ARGS\"\n+        if [ -n \"$IMGKEYSECRET\" ]; then\n+            QEMU_IO_ARGS=\"--object secret,id=keysec0,data=$IMGKEYSECRET $QEMU_IO_ARGS\"\n+        fi\n+    fi\n+    local RETVAL\n+    (\n+        if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n+            exec valgrind --log-file=\"${VALGRIND_LOGFILE}\" --error-exitcode=99 \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\"\n+        else\n+            exec \"$QEMU_IO_PROG\" $QEMU_IO_ARGS \"$@\"\n+        fi\n+    )\n+    RETVAL=$?\n+    if [ \"${VALGRIND_QEMU}\" == \"y\" ]; then\n+        if [ $RETVAL == 99 ]; then\n+            cat \"${VALGRIND_LOGFILE}\"\n+        fi\n+        rm -f \"${VALGRIND_LOGFILE}\"\n+    fi\n+    (exit $RETVAL)\n+}\n+\n+_qemu_nbd_wrapper()\n+{\n+    (\n+        echo $BASHPID > \"${QEMU_TEST_DIR}/qemu-nbd.pid\"\n+        exec \"$QEMU_NBD_PROG\" $QEMU_NBD_OPTIONS \"$@\"\n+    )\n+}\n+\n+_qemu_vxhs_wrapper()\n+{\n+    (\n+        echo $BASHPID > \"${TEST_DIR}/qemu-vxhs.pid\"\n+        exec \"$QEMU_VXHS_PROG\" $QEMU_VXHS_OPTIONS \"$@\"\n+    )\n+}\n+\n+export QEMU=_qemu_wrapper\n+export QEMU_IMG=_qemu_img_wrapper\n+export QEMU_IO=_qemu_io_wrapper\n+export QEMU_NBD=_qemu_nbd_wrapper\n+export QEMU_VXHS=_qemu_vxhs_wrapper\n+\n if [ \"$IMGOPTSSYNTAX\" = \"true\" ]; then\n     DRIVER=\"driver=$IMGFMT\"\n     if [ \"$IMGFMT\" = \"luks\" ]; then\n","prefixes":["05/10"]}