aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/common.qemu
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2018-11-16 15:50:02 -0600
committerEric Blake <eblake@redhat.com>2018-11-19 11:16:46 -0600
commit8cedcffdc195bc39aeb1373826ba0a45629741e0 (patch)
tree46509d211d6dcf12f6d2923e9a37a1667177f762 /tests/qemu-iotests/common.qemu
parentbb39c47d70e84acf5066f79eba27ae5945b837be (diff)
iotests: Drop use of bash keyword 'function'
Bash allows functions to be declared with or without the leading keyword 'function'; but including the keyword does not comply with POSIX syntax, and is confusing to ksh users where the use of the keyword changes the scoping rules for functions. Stick to the POSIX form through iotests. Done mechanically with: sed -i 's/^function //' $(git ls-files tests/qemu-iotests) Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20181116215002.2124581-1-eblake@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/common.qemu')
-rw-r--r--tests/qemu-iotests/common.qemu8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu
index dadde2a266..7c87b897fa 100644
--- a/tests/qemu-iotests/common.qemu
+++ b/tests/qemu-iotests/common.qemu
@@ -60,7 +60,7 @@ _in_fd=4
# $3: A string to search for in the response; if found, this indicates
# failure and the test is either aborted (if $qemu_error_no_exit
# is not set) or ${QEMU_STATUS[$1]} is set to -1 (otherwise).
-function _timed_wait_for()
+_timed_wait_for()
{
local h=${1}
shift
@@ -131,7 +131,7 @@ function _timed_wait_for()
# strings the response will be scanned for. The first of the two
# indicates success, the latter indicates failure. Failure is handled
# like a timeout.
-function _send_qemu_cmd()
+_send_qemu_cmd()
{
local h=${1}
local count=1
@@ -186,7 +186,7 @@ function _send_qemu_cmd()
# Returns:
# $QEMU_HANDLE: set to a handle value to communicate with this QEMU instance.
#
-function _launch_qemu()
+_launch_qemu()
{
local comm=
local fifo_out=
@@ -262,7 +262,7 @@ function _launch_qemu()
# If $wait is set to anything other than the empty string, the process will not
# be killed but only waited for, and any output will be forwarded to stdout. If
# $wait is empty, the process will be killed and all output will be suppressed.
-function _cleanup_qemu()
+_cleanup_qemu()
{
# QEMU_PID[], QEMU_IN[], QEMU_OUT[] all use same indices
for i in "${!QEMU_OUT[@]}"