Blame SOURCES/kvm-iotests-Drop-use-of-bash-keyword-function.patch

7711c0
From 65003ace540a37ec135d30020e2c0f829a0979ae Mon Sep 17 00:00:00 2001
7711c0
From: John Snow <jsnow@redhat.com>
7711c0
Date: Fri, 22 Mar 2019 03:22:37 +0100
7711c0
Subject: [PATCH 070/163] iotests: Drop use of bash keyword 'function'
7711c0
MIME-Version: 1.0
7711c0
Content-Type: text/plain; charset=UTF-8
7711c0
Content-Transfer-Encoding: 8bit
7711c0
7711c0
RH-Author: John Snow <jsnow@redhat.com>
7711c0
Message-id: <20190322032241.8111-25-jsnow@redhat.com>
7711c0
Patchwork-id: 85112
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 24/28] iotests: Drop use of bash keyword 'function'
7711c0
Bugzilla: 1691563
7711c0
RH-Acked-by: Max Reitz <mreitz@redhat.com>
7711c0
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
7711c0
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
7711c0
From: Eric Blake <eblake@redhat.com>
7711c0
7711c0
Bash allows functions to be declared with or without the leading
7711c0
keyword 'function'; but including the keyword does not comply with
7711c0
POSIX syntax, and is confusing to ksh users where the use of the
7711c0
keyword changes the scoping rules for functions.  Stick to the
7711c0
POSIX form through iotests.
7711c0
7711c0
Done mechanically with:
7711c0
  sed -i 's/^function //' $(git ls-files tests/qemu-iotests)
7711c0
7711c0
Signed-off-by: Eric Blake <eblake@redhat.com>
7711c0
Message-Id: <20181116215002.2124581-1-eblake@redhat.com>
7711c0
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7711c0
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
7711c0
(cherry picked from commit 8cedcffdc195bc39aeb1373826ba0a45629741e0)
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 tests/qemu-iotests/035            |  2 +-
7711c0
 tests/qemu-iotests/037            |  2 +-
7711c0
 tests/qemu-iotests/038            |  6 +++---
7711c0
 tests/qemu-iotests/046            |  6 +++---
7711c0
 tests/qemu-iotests/047            |  2 +-
7711c0
 tests/qemu-iotests/049            |  4 ++--
7711c0
 tests/qemu-iotests/051            |  4 ++--
7711c0
 tests/qemu-iotests/067            |  4 ++--
7711c0
 tests/qemu-iotests/071            |  4 ++--
7711c0
 tests/qemu-iotests/077            |  4 ++--
7711c0
 tests/qemu-iotests/081            |  4 ++--
7711c0
 tests/qemu-iotests/082            |  2 +-
7711c0
 tests/qemu-iotests/085            | 10 +++++-----
7711c0
 tests/qemu-iotests/086            |  2 +-
7711c0
 tests/qemu-iotests/087            |  6 +++---
7711c0
 tests/qemu-iotests/099            |  6 +++---
7711c0
 tests/qemu-iotests/109            |  2 +-
7711c0
 tests/qemu-iotests/112            |  2 +-
7711c0
 tests/qemu-iotests/142            |  8 ++++----
7711c0
 tests/qemu-iotests/153            |  4 ++--
7711c0
 tests/qemu-iotests/157            |  4 ++--
7711c0
 tests/qemu-iotests/172            |  6 +++---
7711c0
 tests/qemu-iotests/176            |  2 +-
7711c0
 tests/qemu-iotests/177            |  2 +-
7711c0
 tests/qemu-iotests/184            |  4 ++--
7711c0
 tests/qemu-iotests/186            |  4 ++--
7711c0
 tests/qemu-iotests/195            |  4 ++--
7711c0
 tests/qemu-iotests/204            |  2 +-
7711c0
 tests/qemu-iotests/223            |  4 ++--
7711c0
 tests/qemu-iotests/227            |  4 ++--
7711c0
 tests/qemu-iotests/232            |  6 +++---
7711c0
 tests/qemu-iotests/common.nbd     | 12 ++++++------
7711c0
 tests/qemu-iotests/common.pattern | 16 ++++++++--------
7711c0
 tests/qemu-iotests/common.qemu    |  8 ++++----
7711c0
 tests/qemu-iotests/common.tls     | 10 +++++-----
7711c0
 35 files changed, 86 insertions(+), 86 deletions(-)
7711c0
7711c0
diff --git a/tests/qemu-iotests/035 b/tests/qemu-iotests/035
7711c0
index a5716ca..85d9ef7 100755
7711c0
--- a/tests/qemu-iotests/035
7711c0
+++ b/tests/qemu-iotests/035
7711c0
@@ -49,7 +49,7 @@ echo
7711c0
 echo "creating image"
7711c0
 _make_test_img $size
7711c0
 
7711c0
-function generate_requests() {
7711c0
+generate_requests() {
7711c0
     for i in $(seq 0 63); do
7711c0
         echo "aio_write ${i}M 512"
7711c0
         echo "aio_write ${i}M 512"
7711c0
diff --git a/tests/qemu-iotests/037 b/tests/qemu-iotests/037
7711c0
index 2e43b19..a11992d 100755
7711c0
--- a/tests/qemu-iotests/037
7711c0
+++ b/tests/qemu-iotests/037
7711c0
@@ -54,7 +54,7 @@ TEST_IMG="$TEST_IMG.base"
7711c0
 
7711c0
 _make_test_img $size
7711c0
 
7711c0
-function backing_io()
7711c0
+backing_io()
7711c0
 {
7711c0
     local offset=$1
7711c0
     local sectors=$2
7711c0
diff --git a/tests/qemu-iotests/038 b/tests/qemu-iotests/038
7711c0
index 4e03976..575093e 100755
7711c0
--- a/tests/qemu-iotests/038
7711c0
+++ b/tests/qemu-iotests/038
7711c0
@@ -51,7 +51,7 @@ TEST_IMG="$TEST_IMG.base"
7711c0
 
7711c0
 _make_test_img $size
7711c0
 
7711c0
-function backing_io()
7711c0
+backing_io()
7711c0
 {
7711c0
     local offset=$1
7711c0
     local sectors=$2
7711c0
@@ -76,7 +76,7 @@ _make_test_img -b "$TEST_IMG.base" 6G
7711c0
 echo
7711c0
 echo "== Some concurrent requests touching the same cluster =="
7711c0
 
7711c0
-function overlay_io()
7711c0
+overlay_io()
7711c0
 {
7711c0
     # Start with a request touching two clusters
7711c0
     echo aio_write -P 0x80 2020k 80k
7711c0
@@ -102,7 +102,7 @@ overlay_io | $QEMU_IO "$TEST_IMG" | _filter_qemu_io |\
7711c0
 echo
7711c0
 echo "== Verify image content =="
7711c0
 
7711c0
-function verify_io()
7711c0
+verify_io()
7711c0
 {
7711c0
     echo read -P 31 2016k 4k
7711c0
     echo read -P 0x80 2020k 80k
7711c0
diff --git a/tests/qemu-iotests/046 b/tests/qemu-iotests/046
7711c0
index 01c0de6..5e41d96 100755
7711c0
--- a/tests/qemu-iotests/046
7711c0
+++ b/tests/qemu-iotests/046
7711c0
@@ -48,7 +48,7 @@ echo "== creating backing file for COW tests =="
7711c0
 
7711c0
 _make_test_img $size
7711c0
 
7711c0
-function backing_io()
7711c0
+backing_io()
7711c0
 {
7711c0
     local offset=$1
7711c0
     local sectors=$2
7711c0
@@ -73,7 +73,7 @@ _make_test_img -b "$TEST_IMG.base" 6G
7711c0
 echo
7711c0
 echo "== Some concurrent requests touching the same cluster =="
7711c0
 
7711c0
-function overlay_io()
7711c0
+overlay_io()
7711c0
 {
7711c0
 # Allocate middle of cluster 1, then write to somewhere before and after it
7711c0
 cat  <
7711c0
@@ -189,7 +189,7 @@ overlay_io | $QEMU_IO blkdebug::"$TEST_IMG" | _filter_qemu_io |\
7711c0
 echo
7711c0
 echo "== Verify image content =="
7711c0
 
7711c0
-function verify_io()
7711c0
+verify_io()
7711c0
 {
7711c0
     if ($QEMU_IMG info -U -f "$IMGFMT" "$TEST_IMG" | grep "compat: 0.10" > /dev/null); then
7711c0
         # For v2 images, discarded clusters are read from the backing file
7711c0
diff --git a/tests/qemu-iotests/047 b/tests/qemu-iotests/047
7711c0
index c168373..6e776d2 100755
7711c0
--- a/tests/qemu-iotests/047
7711c0
+++ b/tests/qemu-iotests/047
7711c0
@@ -45,7 +45,7 @@ size=128M
7711c0
 
7711c0
 _make_test_img $size
7711c0
 
7711c0
-function qemu_io_cmds()
7711c0
+qemu_io_cmds()
7711c0
 {
7711c0
 cat <
7711c0
 write -P 0x66 0 320k
7711c0
diff --git a/tests/qemu-iotests/049 b/tests/qemu-iotests/049
7711c0
index 4d0ad5c..97d8a64 100755
7711c0
--- a/tests/qemu-iotests/049
7711c0
+++ b/tests/qemu-iotests/049
7711c0
@@ -40,13 +40,13 @@ _supported_fmt qcow2
7711c0
 _supported_proto file
7711c0
 _supported_os Linux
7711c0
 
7711c0
-function filter_test_dir()
7711c0
+filter_test_dir()
7711c0
 {
7711c0
     sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
7711c0
         -e "s#$TEST_DIR#TEST_DIR#g"
7711c0
 }
7711c0
 
7711c0
-function test_qemu_img()
7711c0
+test_qemu_img()
7711c0
 {
7711c0
     echo qemu-img "$@" | filter_test_dir
7711c0
     $QEMU_IMG "$@" 2>&1 | filter_test_dir
7711c0
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
7711c0
index 4f20265..a73c73f 100755
7711c0
--- a/tests/qemu-iotests/051
7711c0
+++ b/tests/qemu-iotests/051
7711c0
@@ -43,7 +43,7 @@ _supported_os Linux
7711c0
 # other than refcount_bits=16
7711c0
 _unsupported_imgopts 'refcount_bits=\([^1]\|.\([^6]\|$\)\)'
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     echo Testing: "$@"
7711c0
     (
7711c0
@@ -57,7 +57,7 @@ function do_run_qemu()
7711c0
     echo
7711c0
 }
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu |
7711c0
         _filter_generated_node_ids | _filter_hmp
7711c0
diff --git a/tests/qemu-iotests/067 b/tests/qemu-iotests/067
7711c0
index f8d584f..342b2b0 100755
7711c0
--- a/tests/qemu-iotests/067
7711c0
+++ b/tests/qemu-iotests/067
7711c0
@@ -36,7 +36,7 @@ _supported_os Linux
7711c0
 # Because anything other than 16 would change the output of query-block
7711c0
 _unsupported_imgopts 'refcount_bits=\([^1]\|.\([^6]\|$\)\)'
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     echo Testing: "$@"
7711c0
     $QEMU -nographic -qmp-pretty stdio -serial none "$@"
7711c0
@@ -52,7 +52,7 @@ _filter_qmp_events()
7711c0
 	| tr '\t' '\n'
7711c0
 }
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp | _filter_qemu \
7711c0
                           | _filter_actual_image_size \
7711c0
diff --git a/tests/qemu-iotests/071 b/tests/qemu-iotests/071
7711c0
index 6448e9e..6e467dc 100755
7711c0
--- a/tests/qemu-iotests/071
7711c0
+++ b/tests/qemu-iotests/071
7711c0
@@ -40,14 +40,14 @@ _supported_fmt qcow2
7711c0
 _supported_proto file
7711c0
 _supported_os Linux
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     echo Testing: "$@" | _filter_imgfmt
7711c0
     $QEMU -nographic -qmp stdio -serial none "$@"
7711c0
     echo
7711c0
 }
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp | _filter_qemu_io
7711c0
 }
7711c0
diff --git a/tests/qemu-iotests/077 b/tests/qemu-iotests/077
7711c0
index a40f319..58fe893 100755
7711c0
--- a/tests/qemu-iotests/077
7711c0
+++ b/tests/qemu-iotests/077
7711c0
@@ -48,7 +48,7 @@ _make_test_img $size
7711c0
 echo
7711c0
 echo "== Some concurrent requests involving RMW =="
7711c0
 
7711c0
-function test_io()
7711c0
+test_io()
7711c0
 {
7711c0
 echo "open -o driver=$IMGFMT,file.align=4k blkdebug::$TEST_IMG"
7711c0
 # A simple RMW request
7711c0
@@ -193,7 +193,7 @@ test_io | $QEMU_IO  | _filter_qemu_io | \
7711c0
 echo
7711c0
 echo "== Verify image content =="
7711c0
 
7711c0
-function verify_io()
7711c0
+verify_io()
7711c0
 {
7711c0
     # A simple RMW request
7711c0
     echo read -P 0       0 0x200
7711c0
diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081
7711c0
index c5d4616..4dc6b04 100755
7711c0
--- a/tests/qemu-iotests/081
7711c0
+++ b/tests/qemu-iotests/081
7711c0
@@ -42,14 +42,14 @@ _supported_fmt raw
7711c0
 _supported_proto file
7711c0
 _supported_os Linux
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     echo Testing: "$@" | _filter_imgfmt
7711c0
     $QEMU -nographic -qmp stdio -serial none "$@"
7711c0
     echo
7711c0
 }
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp\
7711c0
                           | _filter_qemu_io | _filter_generated_node_ids
7711c0
diff --git a/tests/qemu-iotests/082 b/tests/qemu-iotests/082
7711c0
index 14f6631..61eec63 100755
7711c0
--- a/tests/qemu-iotests/082
7711c0
+++ b/tests/qemu-iotests/082
7711c0
@@ -40,7 +40,7 @@ _supported_fmt qcow2
7711c0
 _supported_proto file nfs
7711c0
 _supported_os Linux
7711c0
 
7711c0
-function run_qemu_img()
7711c0
+run_qemu_img()
7711c0
 {
7711c0
     echo
7711c0
     echo Testing: "$@" | _filter_testdir
7711c0
diff --git a/tests/qemu-iotests/085 b/tests/qemu-iotests/085
7711c0
index 2ef8407..ade68ef 100755
7711c0
--- a/tests/qemu-iotests/085
7711c0
+++ b/tests/qemu-iotests/085
7711c0
@@ -60,7 +60,7 @@ _supported_os Linux
7711c0
 
7711c0
 
7711c0
 # ${1}: unique identifier for the snapshot filename
7711c0
-function create_single_snapshot()
7711c0
+create_single_snapshot()
7711c0
 {
7711c0
     cmd="{ 'execute': 'blockdev-snapshot-sync',
7711c0
                       'arguments': { 'device': 'virtio0',
7711c0
@@ -70,7 +70,7 @@ function create_single_snapshot()
7711c0
 }
7711c0
 
7711c0
 # ${1}: unique identifier for the snapshot filename
7711c0
-function create_group_snapshot()
7711c0
+create_group_snapshot()
7711c0
 {
7711c0
     cmd="{ 'execute': 'transaction', 'arguments':
7711c0
            {'actions': [
7711c0
@@ -88,7 +88,7 @@ function create_group_snapshot()
7711c0
 # ${1}: unique identifier for the snapshot filename
7711c0
 # ${2}: extra_params to the blockdev-add command
7711c0
 # ${3}: filename
7711c0
-function do_blockdev_add()
7711c0
+do_blockdev_add()
7711c0
 {
7711c0
     cmd="{ 'execute': 'blockdev-add', 'arguments':
7711c0
            { 'driver': 'qcow2', 'node-name': 'snap_${1}', ${2}
7711c0
@@ -99,7 +99,7 @@ function do_blockdev_add()
7711c0
 }
7711c0
 
7711c0
 # ${1}: unique identifier for the snapshot filename
7711c0
-function add_snapshot_image()
7711c0
+add_snapshot_image()
7711c0
 {
7711c0
     base_image="${TEST_DIR}/$((${1}-1))-${snapshot_virt0}"
7711c0
     snapshot_file="${TEST_DIR}/${1}-${snapshot_virt0}"
7711c0
@@ -110,7 +110,7 @@ function add_snapshot_image()
7711c0
 
7711c0
 # ${1}: unique identifier for the snapshot filename
7711c0
 # ${2}: expected response, defaults to 'return'
7711c0
-function blockdev_snapshot()
7711c0
+blockdev_snapshot()
7711c0
 {
7711c0
     cmd="{ 'execute': 'blockdev-snapshot',
7711c0
                       'arguments': { 'node': 'virtio0',
7711c0
diff --git a/tests/qemu-iotests/086 b/tests/qemu-iotests/086
7711c0
index f9e4722..06613fd 100755
7711c0
--- a/tests/qemu-iotests/086
7711c0
+++ b/tests/qemu-iotests/086
7711c0
@@ -40,7 +40,7 @@ _supported_fmt qcow2 raw
7711c0
 _supported_proto file nfs
7711c0
 _supported_os Linux
7711c0
 
7711c0
-function run_qemu_img()
7711c0
+run_qemu_img()
7711c0
 {
7711c0
     echo
7711c0
     echo Testing: "$@" | _filter_testdir
7711c0
diff --git a/tests/qemu-iotests/087 b/tests/qemu-iotests/087
7711c0
index 109cdf5..f625887 100755
7711c0
--- a/tests/qemu-iotests/087
7711c0
+++ b/tests/qemu-iotests/087
7711c0
@@ -34,14 +34,14 @@ _supported_fmt qcow2
7711c0
 _supported_proto file
7711c0
 _supported_os Linux
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     echo Testing: "$@"
7711c0
     $QEMU -nographic -qmp stdio -serial none "$@"
7711c0
     echo
7711c0
 }
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp \
7711c0
                           | _filter_qemu | _filter_imgfmt \
7711c0
@@ -102,7 +102,7 @@ echo === aio=native without O_DIRECT ===
7711c0
 echo
7711c0
 
7711c0
 # Skip this test if AIO is not enabled in this build
7711c0
-function run_qemu_filter_aio()
7711c0
+run_qemu_filter_aio()
7711c0
 {
7711c0
     run_qemu "$@" | \
7711c0
         sed -e 's/is not supported in this build/it requires cache.direct=on, which was not specified/'
7711c0
diff --git a/tests/qemu-iotests/099 b/tests/qemu-iotests/099
7711c0
index 4a6275d..578808b 100755
7711c0
--- a/tests/qemu-iotests/099
7711c0
+++ b/tests/qemu-iotests/099
7711c0
@@ -45,12 +45,12 @@ _supported_os Linux
7711c0
 _unsupported_imgopts "subformat=monolithicFlat" "subformat=twoGbMaxExtentFlat" \
7711c0
     "subformat=twoGbMaxExtentSparse"
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     $QEMU -nographic -qmp stdio -serial none "$@"
7711c0
 }
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     # Get the "file": "foo" entry ($foo may only contain escaped double quotes,
7711c0
     # which is how we can extract it)
7711c0
@@ -59,7 +59,7 @@ function run_qemu()
7711c0
         | sed -e 's/^.*"file": "\(\(\\"\|[^"]\)*\)".*$/\1/' -e 's/\\"/"/g'
7711c0
 }
7711c0
 
7711c0
-function test_qemu()
7711c0
+test_qemu()
7711c0
 {
7711c0
     run_qemu -drive "if=none,id=drv0,$1" <
7711c0
         { 'execute': 'qmp_capabilities' }
7711c0
diff --git a/tests/qemu-iotests/109 b/tests/qemu-iotests/109
7711c0
index 90bdae4..b51e461 100755
7711c0
--- a/tests/qemu-iotests/109
7711c0
+++ b/tests/qemu-iotests/109
7711c0
@@ -45,7 +45,7 @@ _supported_os Linux
7711c0
 
7711c0
 qemu_comm_method=qmp
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     local raw_img="$1"
7711c0
     local source_img="$2"
7711c0
diff --git a/tests/qemu-iotests/112 b/tests/qemu-iotests/112
7711c0
index fba2965..d67e6eb 100755
7711c0
--- a/tests/qemu-iotests/112
7711c0
+++ b/tests/qemu-iotests/112
7711c0
@@ -44,7 +44,7 @@ _supported_os Linux
7711c0
 # manual setting; compat will be overridden as well
7711c0
 _unsupported_imgopts refcount_bits 'compat=0.10'
7711c0
 
7711c0
-function print_refcount_bits()
7711c0
+print_refcount_bits()
7711c0
 {
7711c0
     $QEMU_IMG info "$TEST_IMG" | sed -n '/refcount bits:/ s/^ *//p'
7711c0
 }
7711c0
diff --git a/tests/qemu-iotests/142 b/tests/qemu-iotests/142
7711c0
index c7c360d..5fc488f 100755
7711c0
--- a/tests/qemu-iotests/142
7711c0
+++ b/tests/qemu-iotests/142
7711c0
@@ -45,7 +45,7 @@ _supported_os Linux
7711c0
 _default_cache_mode none
7711c0
 _supported_cache_modes none directsync
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     echo Testing: "$@"
7711c0
     (
7711c0
@@ -59,7 +59,7 @@ function do_run_qemu()
7711c0
     echo
7711c0
 }
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_hmp
7711c0
 }
7711c0
@@ -88,7 +88,7 @@ echo
7711c0
 files="if=none,file=$TEST_IMG,backing.file.filename=$TEST_IMG.base"
7711c0
 ids="node-name=image,backing.node-name=backing,backing.file.node-name=backing-file,file.node-name=file"
7711c0
 
7711c0
-function check_cache_all()
7711c0
+check_cache_all()
7711c0
 {
7711c0
     # cache.direct is supposed to be inherited by both bs->file and
7711c0
     # bs->backing
7711c0
@@ -231,7 +231,7 @@ drv_bk="if=none,file=json:{'driver':'$IMGFMT',,'file':'backing-file',,'node-name
7711c0
 drv_file="if=none,driver=file,filename=$TEST_IMG,node-name=file"
7711c0
 drv_img="if=none,id=blk,file=json:{'driver':'$IMGFMT',,'file':'file',,'backing':'backing',,'node-name':'image'}"
7711c0
 
7711c0
-function check_cache_all_separate()
7711c0
+check_cache_all_separate()
7711c0
 {
7711c0
     # Check cache.direct
7711c0
 
7711c0
diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153
7711c0
index 00092b8..3120a61 100755
7711c0
--- a/tests/qemu-iotests/153
7711c0
+++ b/tests/qemu-iotests/153
7711c0
@@ -70,7 +70,7 @@ _run_cmd()
7711c0
     (echo "$@"; "$@" 2>&1 1>/dev/null) | _filter_testdir
7711c0
 }
7711c0
 
7711c0
-function _do_run_qemu()
7711c0
+_do_run_qemu()
7711c0
 {
7711c0
     (
7711c0
         if ! test -t 0; then
7711c0
@@ -82,7 +82,7 @@ function _do_run_qemu()
7711c0
     ) | $QEMU -nographic -monitor stdio -serial none "$@" 1>/dev/null
7711c0
 }
7711c0
 
7711c0
-function _run_qemu_with_images()
7711c0
+_run_qemu_with_images()
7711c0
 {
7711c0
     _do_run_qemu \
7711c0
         $(for i in $@; do echo "-drive if=none,file=$i"; done) 2>&1 \
7711c0
diff --git a/tests/qemu-iotests/157 b/tests/qemu-iotests/157
7711c0
index c3231b7..6fb2659 100755
7711c0
--- a/tests/qemu-iotests/157
7711c0
+++ b/tests/qemu-iotests/157
7711c0
@@ -40,7 +40,7 @@ _supported_fmt generic
7711c0
 _supported_proto file
7711c0
 _supported_os Linux
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     (
7711c0
         if ! test -t 0; then
7711c0
@@ -53,7 +53,7 @@ function do_run_qemu()
7711c0
     echo
7711c0
 }
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_imgfmt \
7711c0
                           | _filter_qemu | _filter_generated_node_ids
7711c0
diff --git a/tests/qemu-iotests/172 b/tests/qemu-iotests/172
7711c0
index c5ee33e..1e60a7e 100755
7711c0
--- a/tests/qemu-iotests/172
7711c0
+++ b/tests/qemu-iotests/172
7711c0
@@ -46,7 +46,7 @@ if [ "$QEMU_DEFAULT_MACHINE" != "pc" ]; then
7711c0
     _notrun "Requires a PC machine"
7711c0
 fi
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     (
7711c0
         if ! test -t 0; then
7711c0
@@ -59,7 +59,7 @@ function do_run_qemu()
7711c0
     echo
7711c0
 }
7711c0
 
7711c0
-function check_floppy_qtree()
7711c0
+check_floppy_qtree()
7711c0
 {
7711c0
     echo
7711c0
     echo Testing: "$@" | _filter_testdir
7711c0
@@ -75,7 +75,7 @@ function check_floppy_qtree()
7711c0
     _filter_win32 | _filter_qemu
7711c0
 }
7711c0
 
7711c0
-function check_cache_mode()
7711c0
+check_cache_mode()
7711c0
 {
7711c0
     echo "info block none0" |
7711c0
     QEMU_OPTIONS="" do_run_qemu -drive if=none,file="$TEST_IMG" "$@" |
7711c0
diff --git a/tests/qemu-iotests/176 b/tests/qemu-iotests/176
7711c0
index c091d0b..4ecd589 100755
7711c0
--- a/tests/qemu-iotests/176
7711c0
+++ b/tests/qemu-iotests/176
7711c0
@@ -50,7 +50,7 @@ _supported_os Linux
7711c0
 # Persistent dirty bitmaps require compat=1.1
7711c0
 _unsupported_imgopts 'compat=0.10'
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     $QEMU -nographic -qmp stdio -serial none "$@" 2>&1 \
7711c0
 	| _filter_testdir | _filter_qmp | _filter_qemu \
7711c0
diff --git a/tests/qemu-iotests/177 b/tests/qemu-iotests/177
7711c0
index 7bf8e1d..f0c1155 100755
7711c0
--- a/tests/qemu-iotests/177
7711c0
+++ b/tests/qemu-iotests/177
7711c0
@@ -85,7 +85,7 @@ $QEMU_IO -c "open -o $options,$limits blkdebug::$TEST_IMG" \
7711c0
 echo
7711c0
 echo "== verify image content =="
7711c0
 
7711c0
-function verify_io()
7711c0
+verify_io()
7711c0
 {
7711c0
     if ($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" |
7711c0
 	    grep "compat: 0.10" > /dev/null); then
7711c0
diff --git a/tests/qemu-iotests/184 b/tests/qemu-iotests/184
7711c0
index 2f3259d..0af7a73 100755
7711c0
--- a/tests/qemu-iotests/184
7711c0
+++ b/tests/qemu-iotests/184
7711c0
@@ -34,14 +34,14 @@ trap "exit \$status" 0 1 2 3 15
7711c0
 
7711c0
 _supported_os Linux
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     echo Testing: "$@" | _filter_imgfmt
7711c0
     $QEMU -nographic -qmp-pretty stdio -serial none "$@"
7711c0
     echo
7711c0
 }
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp\
7711c0
                           | _filter_qemu_io | _filter_generated_node_ids \
7711c0
diff --git a/tests/qemu-iotests/186 b/tests/qemu-iotests/186
7711c0
index 29681bf..c27dc95 100755
7711c0
--- a/tests/qemu-iotests/186
7711c0
+++ b/tests/qemu-iotests/186
7711c0
@@ -44,7 +44,7 @@ if [ "$QEMU_DEFAULT_MACHINE" != "pc" ]; then
7711c0
     _notrun "Requires a PC machine"
7711c0
 fi
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     echo Testing: "$@"
7711c0
 
7711c0
@@ -59,7 +59,7 @@ function do_run_qemu()
7711c0
     echo
7711c0
 }
7711c0
 
7711c0
-function check_info_block()
7711c0
+check_info_block()
7711c0
 {
7711c0
     echo "info block" |
7711c0
     do_run_qemu "$@" | _filter_win32 | _filter_hmp | _filter_qemu |
7711c0
diff --git a/tests/qemu-iotests/195 b/tests/qemu-iotests/195
7711c0
index f56f255..a977c97 100755
7711c0
--- a/tests/qemu-iotests/195
7711c0
+++ b/tests/qemu-iotests/195
7711c0
@@ -41,14 +41,14 @@ _supported_fmt qcow2
7711c0
 _supported_proto file
7711c0
 _supported_os Linux
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     echo Testing: "$@"
7711c0
     $QEMU -nographic -qmp-pretty stdio -serial none "$@"
7711c0
     echo
7711c0
 }
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_imgfmt | _filter_qemu \
7711c0
                           | _filter_qmp | _filter_qemu_io \
7711c0
diff --git a/tests/qemu-iotests/204 b/tests/qemu-iotests/204
7711c0
index 57f3afe..30f0653 100755
7711c0
--- a/tests/qemu-iotests/204
7711c0
+++ b/tests/qemu-iotests/204
7711c0
@@ -93,7 +93,7 @@ $QEMU_IO -c "open -o $options,$limits blkdebug::$TEST_IMG" \
7711c0
 echo
7711c0
 echo "== verify image content =="
7711c0
 
7711c0
-function verify_io()
7711c0
+verify_io()
7711c0
 {
7711c0
     echo read -P 22 0 1000
7711c0
     echo read -P 33 1000 128k
7711c0
diff --git a/tests/qemu-iotests/223 b/tests/qemu-iotests/223
7711c0
index 29e1951..5513dc6 100755
7711c0
--- a/tests/qemu-iotests/223
7711c0
+++ b/tests/qemu-iotests/223
7711c0
@@ -42,14 +42,14 @@ _supported_os Linux
7711c0
 # Persistent dirty bitmaps require compat=1.1
7711c0
 _unsupported_imgopts 'compat=0.10'
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     echo Testing: "$@"
7711c0
     $QEMU -nographic -qmp stdio -serial none "$@"
7711c0
     echo
7711c0
 }
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp \
7711c0
                           | _filter_qemu | _filter_imgfmt \
7711c0
diff --git a/tests/qemu-iotests/227 b/tests/qemu-iotests/227
7711c0
index 43f2323..be1b636 100755
7711c0
--- a/tests/qemu-iotests/227
7711c0
+++ b/tests/qemu-iotests/227
7711c0
@@ -40,14 +40,14 @@ _supported_fmt generic
7711c0
 _supported_proto file
7711c0
 _supported_os Linux
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     echo Testing: "$@"
7711c0
     $QEMU -nographic -qmp-pretty stdio -serial none "$@"
7711c0
     echo
7711c0
 }
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp \
7711c0
                           | _filter_qemu | _filter_imgfmt \
7711c0
diff --git a/tests/qemu-iotests/232 b/tests/qemu-iotests/232
7711c0
index ae63f13..e48bc8f 100755
7711c0
--- a/tests/qemu-iotests/232
7711c0
+++ b/tests/qemu-iotests/232
7711c0
@@ -40,7 +40,7 @@ _supported_fmt generic
7711c0
 _supported_proto file
7711c0
 _supported_os Linux
7711c0
 
7711c0
-function do_run_qemu()
7711c0
+do_run_qemu()
7711c0
 {
7711c0
     echo Testing: "$@"
7711c0
     (
7711c0
@@ -54,13 +54,13 @@ function do_run_qemu()
7711c0
     echo
7711c0
 }
7711c0
 
7711c0
-function run_qemu()
7711c0
+run_qemu()
7711c0
 {
7711c0
     do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_hmp |
7711c0
         _filter_generated_node_ids | _filter_imgfmt
7711c0
 }
7711c0
 
7711c0
-function run_qemu_info_block()
7711c0
+run_qemu_info_block()
7711c0
 {
7711c0
     echo "info block -n" | run_qemu "$@" | grep -e "(file" -e "QEMU_PROG"
7711c0
 }
7711c0
diff --git a/tests/qemu-iotests/common.nbd b/tests/qemu-iotests/common.nbd
7711c0
index 0f4497a..233187a 100644
7711c0
--- a/tests/qemu-iotests/common.nbd
7711c0
+++ b/tests/qemu-iotests/common.nbd
7711c0
@@ -23,7 +23,7 @@ nbd_unix_socket="${TEST_DIR}/qemu-nbd.sock"
7711c0
 nbd_tcp_addr="127.0.0.1"
7711c0
 nbd_pid_file="${TEST_DIR}/qemu-nbd.pid"
7711c0
 
7711c0
-function nbd_server_stop()
7711c0
+nbd_server_stop()
7711c0
 {
7711c0
     local NBD_PID
7711c0
     if [ -f "$nbd_pid_file" ]; then
7711c0
@@ -36,7 +36,7 @@ function nbd_server_stop()
7711c0
     rm -f "$nbd_unix_socket"
7711c0
 }
7711c0
 
7711c0
-function nbd_server_wait_for_unix_socket()
7711c0
+nbd_server_wait_for_unix_socket()
7711c0
 {
7711c0
     pid=$1
7711c0
 
7711c0
@@ -57,14 +57,14 @@ function nbd_server_wait_for_unix_socket()
7711c0
     exit 1
7711c0
 }
7711c0
 
7711c0
-function nbd_server_start_unix_socket()
7711c0
+nbd_server_start_unix_socket()
7711c0
 {
7711c0
     nbd_server_stop
7711c0
     $QEMU_NBD -v -t -k "$nbd_unix_socket" "$@" &
7711c0
     nbd_server_wait_for_unix_socket $!
7711c0
 }
7711c0
 
7711c0
-function nbd_server_set_tcp_port()
7711c0
+nbd_server_set_tcp_port()
7711c0
 {
7711c0
     (ss --help) >/dev/null 2>&1 || _notrun "ss utility not found, skipping test"
7711c0
 
7711c0
@@ -80,7 +80,7 @@ function nbd_server_set_tcp_port()
7711c0
     exit 1
7711c0
 }
7711c0
 
7711c0
-function nbd_server_wait_for_tcp_socket()
7711c0
+nbd_server_wait_for_tcp_socket()
7711c0
 {
7711c0
     pid=$1
7711c0
 
7711c0
@@ -101,7 +101,7 @@ function nbd_server_wait_for_tcp_socket()
7711c0
     exit 1
7711c0
 }
7711c0
 
7711c0
-function nbd_server_start_tcp_socket()
7711c0
+nbd_server_start_tcp_socket()
7711c0
 {
7711c0
     nbd_server_stop
7711c0
     $QEMU_NBD -v -t -b $nbd_tcp_addr -p $nbd_tcp_port "$@" &
7711c0
diff --git a/tests/qemu-iotests/common.pattern b/tests/qemu-iotests/common.pattern
7711c0
index 34f4a8d..b67bb34 100644
7711c0
--- a/tests/qemu-iotests/common.pattern
7711c0
+++ b/tests/qemu-iotests/common.pattern
7711c0
@@ -16,7 +16,7 @@
7711c0
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
7711c0
 #
7711c0
 
7711c0
-function do_is_allocated() {
7711c0
+do_is_allocated() {
7711c0
     local start=$1
7711c0
     local size=$2
7711c0
     local step=$3
7711c0
@@ -27,11 +27,11 @@ function do_is_allocated() {
7711c0
     done
7711c0
 }
7711c0
 
7711c0
-function is_allocated() {
7711c0
+is_allocated() {
7711c0
     do_is_allocated "$@" | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
7711c0
 }
7711c0
 
7711c0
-function do_io() {
7711c0
+do_io() {
7711c0
     local op=$1
7711c0
     local start=$2
7711c0
     local size=$3
7711c0
@@ -45,22 +45,22 @@ function do_io() {
7711c0
     done
7711c0
 }
7711c0
 
7711c0
-function io_pattern() {
7711c0
+io_pattern() {
7711c0
     do_io "$@" | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
7711c0
 }
7711c0
 
7711c0
-function io() {
7711c0
+io() {
7711c0
     local start=$2
7711c0
     local pattern=$(( (start >> 9) % 256 ))
7711c0
 
7711c0
     do_io "$@" $pattern | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
7711c0
 }
7711c0
 
7711c0
-function io_zero() {
7711c0
+io_zero() {
7711c0
     do_io "$@" 0 | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
7711c0
 }
7711c0
 
7711c0
-function io_test() {
7711c0
+io_test() {
7711c0
     local op=$1
7711c0
     local offset=$2
7711c0
     local cluster_size=$3
7711c0
@@ -100,7 +100,7 @@ function io_test() {
7711c0
     offset=$((offset + num_large * ( l2_size + half_cluster )))
7711c0
 }
7711c0
 
7711c0
-function io_test2() {
7711c0
+io_test2() {
7711c0
     local orig_offset=$1
7711c0
     local cluster_size=$2
7711c0
     local num=$3
7711c0
diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu
7711c0
index f285484..6b8eb9b 100644
7711c0
--- a/tests/qemu-iotests/common.qemu
7711c0
+++ b/tests/qemu-iotests/common.qemu
7711c0
@@ -60,7 +60,7 @@ _in_fd=4
7711c0
 # $3: A string to search for in the response; if found, this indicates
7711c0
 #     failure and the test is either aborted (if $qemu_error_no_exit
7711c0
 #     is not set) or ${QEMU_STATUS[$1]} is set to -1 (otherwise).
7711c0
-function _timed_wait_for()
7711c0
+_timed_wait_for()
7711c0
 {
7711c0
     local h=${1}
7711c0
     shift
7711c0
@@ -131,7 +131,7 @@ function _timed_wait_for()
7711c0
 # strings the response will be scanned for.  The first of the two
7711c0
 # indicates success, the latter indicates failure.  Failure is handled
7711c0
 # like a timeout.
7711c0
-function _send_qemu_cmd()
7711c0
+_send_qemu_cmd()
7711c0
 {
7711c0
     local h=${1}
7711c0
     local count=1
7711c0
@@ -186,7 +186,7 @@ function _send_qemu_cmd()
7711c0
 # Returns:
7711c0
 # $QEMU_HANDLE: set to a handle value to communicate with this QEMU instance.
7711c0
 #
7711c0
-function _launch_qemu()
7711c0
+_launch_qemu()
7711c0
 {
7711c0
     local comm=
7711c0
     local fifo_out=
7711c0
@@ -262,7 +262,7 @@ function _launch_qemu()
7711c0
 # If $wait is set to anything other than the empty string, the process will not
7711c0
 # be killed but only waited for, and any output will be forwarded to stdout. If
7711c0
 # $wait is empty, the process will be killed and all output will be suppressed.
7711c0
-function _cleanup_qemu()
7711c0
+_cleanup_qemu()
7711c0
 {
7711c0
     # QEMU_PID[], QEMU_IN[], QEMU_OUT[] all use same indices
7711c0
     for i in "${!QEMU_OUT[@]}"
7711c0
diff --git a/tests/qemu-iotests/common.tls b/tests/qemu-iotests/common.tls
7711c0
index cecab26..39f17c1 100644
7711c0
--- a/tests/qemu-iotests/common.tls
7711c0
+++ b/tests/qemu-iotests/common.tls
7711c0
@@ -20,7 +20,7 @@
7711c0
 
7711c0
 tls_dir="${TEST_DIR}/tls"
7711c0
 
7711c0
-function tls_x509_cleanup()
7711c0
+tls_x509_cleanup()
7711c0
 {
7711c0
     rm -f "${tls_dir}"/*.pem
7711c0
     rm -f "${tls_dir}"/*/*.pem
7711c0
@@ -29,7 +29,7 @@ function tls_x509_cleanup()
7711c0
 }
7711c0
 
7711c0
 
7711c0
-function tls_x509_init()
7711c0
+tls_x509_init()
7711c0
 {
7711c0
     mkdir -p "${tls_dir}"
7711c0
 
7711c0
@@ -58,7 +58,7 @@ EOF
7711c0
 }
7711c0
 
7711c0
 
7711c0
-function tls_x509_create_root_ca()
7711c0
+tls_x509_create_root_ca()
7711c0
 {
7711c0
     name=${1:-ca-cert}
7711c0
 
7711c0
@@ -77,7 +77,7 @@ EOF
7711c0
 }
7711c0
 
7711c0
 
7711c0
-function tls_x509_create_server()
7711c0
+tls_x509_create_server()
7711c0
 {
7711c0
     caname=$1
7711c0
     name=$2
7711c0
@@ -108,7 +108,7 @@ EOF
7711c0
 }
7711c0
 
7711c0
 
7711c0
-function tls_x509_create_client()
7711c0
+tls_x509_create_client()
7711c0
 {
7711c0
     caname=$1
7711c0
     name=$2
7711c0
-- 
7711c0
1.8.3.1
7711c0