yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
218e99
From 75745b6eee8522c8b1eb05dc2be56f3245abae1b Mon Sep 17 00:00:00 2001
218e99
From: Max Reitz <mreitz@redhat.com>
218e99
Date: Wed, 6 Nov 2013 16:53:32 +0100
218e99
Subject: [PATCH 75/87] qemu-iotests: Quote $TEST_IMG* and $TEST_DIR usage
218e99
218e99
RH-Author: Max Reitz <mreitz@redhat.com>
218e99
Message-id: <1383756824-6921-10-git-send-email-mreitz@redhat.com>
218e99
Patchwork-id: 55564
218e99
O-Subject: [RHEL-7.0 qemu-kvm PATCH v2 09/21] qemu-iotests: Quote $TEST_IMG* and $TEST_DIR usage
218e99
Bugzilla: 980771
218e99
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
218e99
RH-Acked-by: Fam Zheng <famz@redhat.com>
218e99
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
218e99
218e99
From: Jeff Cody <jcody@redhat.com>
218e99
218e99
BZ: 980771
218e99
218e99
A lot of image filename and paths are used unquoted.  Quote these to
218e99
make sure that directories / filenames with spaces are not problematic.
218e99
218e99
Signed-off-by: Jeff Cody <jcody@redhat.com>
218e99
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
218e99
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
218e99
(cherry picked from commit fef9c19139f4d69a080d99b8cbade163d0bbf0fc)
218e99
218e99
Signed-off-by: Max Reitz <mreitz@redhat.com>
218e99
218e99
Conflicts:
218e99
	tests/qemu-iotests/051
218e99
218e99
Conflicts because of the downstream-only patch
218e99
9dcde11f25f85804f31d00fc45eed16595aebeec.
218e99
---
218e99
 tests/qemu-iotests/001       |  6 ++---
218e99
 tests/qemu-iotests/002       | 36 ++++++++++++-------------
218e99
 tests/qemu-iotests/003       | 10 +++----
218e99
 tests/qemu-iotests/004       | 24 ++++++++---------
218e99
 tests/qemu-iotests/005       |  4 +--
218e99
 tests/qemu-iotests/007       |  2 +-
218e99
 tests/qemu-iotests/008       |  6 ++---
218e99
 tests/qemu-iotests/009       |  2 +-
218e99
 tests/qemu-iotests/010       |  2 +-
218e99
 tests/qemu-iotests/011       |  2 +-
218e99
 tests/qemu-iotests/012       |  4 +--
218e99
 tests/qemu-iotests/013       |  4 +--
218e99
 tests/qemu-iotests/014       |  2 +-
218e99
 tests/qemu-iotests/015       | 16 +++++------
218e99
 tests/qemu-iotests/016       | 12 ++++-----
218e99
 tests/qemu-iotests/018       |  6 ++---
218e99
 tests/qemu-iotests/019       | 12 ++++-----
218e99
 tests/qemu-iotests/020       | 12 ++++-----
218e99
 tests/qemu-iotests/021       |  2 +-
218e99
 tests/qemu-iotests/023       |  4 +--
218e99
 tests/qemu-iotests/024       | 12 ++++-----
218e99
 tests/qemu-iotests/025       |  4 +--
218e99
 tests/qemu-iotests/026       | 20 +++++++-------
218e99
 tests/qemu-iotests/027       | 10 +++----
218e99
 tests/qemu-iotests/028       |  6 ++---
218e99
 tests/qemu-iotests/029       | 12 ++++-----
218e99
 tests/qemu-iotests/031       | 12 ++++-----
218e99
 tests/qemu-iotests/032       |  4 +--
218e99
 tests/qemu-iotests/033       | 18 ++++++-------
218e99
 tests/qemu-iotests/034       | 64 ++++++++++++++++++++++----------------------
218e99
 tests/qemu-iotests/035       |  2 +-
218e99
 tests/qemu-iotests/036       |  6 ++---
218e99
 tests/qemu-iotests/037       | 62 +++++++++++++++++++++---------------------
218e99
 tests/qemu-iotests/038       | 10 +++----
218e99
 tests/qemu-iotests/039       | 28 +++++++++----------
218e99
 tests/qemu-iotests/042       | 10 +++----
218e99
 tests/qemu-iotests/043       | 32 +++++++++++-----------
218e99
 tests/qemu-iotests/046       | 10 +++----
218e99
 tests/qemu-iotests/047       |  2 +-
218e99
 tests/qemu-iotests/048       |  8 +++---
218e99
 tests/qemu-iotests/049       | 36 ++++++++++++-------------
218e99
 tests/qemu-iotests/050       | 20 +++++++-------
218e99
 tests/qemu-iotests/051       | 50 +++++++++++++++++-----------------
218e99
 tests/qemu-iotests/052       |  6 ++---
218e99
 tests/qemu-iotests/053       | 10 +++----
218e99
 tests/qemu-iotests/054       |  2 +-
218e99
 tests/qemu-iotests/059       |  6 ++---
218e99
 tests/qemu-iotests/063       | 28 +++++++++----------
218e99
 tests/qemu-iotests/common.rc | 16 +++++------
218e99
 49 files changed, 337 insertions(+), 337 deletions(-)
218e99
218e99
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
---
218e99
 tests/qemu-iotests/001       |    6 ++--
218e99
 tests/qemu-iotests/002       |   36 ++++++++++++------------
218e99
 tests/qemu-iotests/003       |   10 +++---
218e99
 tests/qemu-iotests/004       |   24 ++++++++--------
218e99
 tests/qemu-iotests/005       |    4 +-
218e99
 tests/qemu-iotests/007       |    2 +-
218e99
 tests/qemu-iotests/008       |    6 ++--
218e99
 tests/qemu-iotests/009       |    2 +-
218e99
 tests/qemu-iotests/010       |    2 +-
218e99
 tests/qemu-iotests/011       |    2 +-
218e99
 tests/qemu-iotests/012       |    4 +-
218e99
 tests/qemu-iotests/013       |    4 +-
218e99
 tests/qemu-iotests/014       |    2 +-
218e99
 tests/qemu-iotests/015       |   16 +++++-----
218e99
 tests/qemu-iotests/016       |   12 ++++----
218e99
 tests/qemu-iotests/018       |    6 ++--
218e99
 tests/qemu-iotests/019       |   12 ++++----
218e99
 tests/qemu-iotests/020       |   12 ++++----
218e99
 tests/qemu-iotests/021       |    2 +-
218e99
 tests/qemu-iotests/023       |    4 +-
218e99
 tests/qemu-iotests/024       |   12 ++++----
218e99
 tests/qemu-iotests/025       |    4 +-
218e99
 tests/qemu-iotests/026       |   20 ++++++------
218e99
 tests/qemu-iotests/027       |   10 +++---
218e99
 tests/qemu-iotests/028       |    6 ++--
218e99
 tests/qemu-iotests/029       |   12 ++++----
218e99
 tests/qemu-iotests/031       |   12 ++++----
218e99
 tests/qemu-iotests/032       |    4 +-
218e99
 tests/qemu-iotests/033       |   18 ++++++------
218e99
 tests/qemu-iotests/034       |   64 +++++++++++++++++++++---------------------
218e99
 tests/qemu-iotests/035       |    2 +-
218e99
 tests/qemu-iotests/036       |    6 ++--
218e99
 tests/qemu-iotests/037       |   62 ++++++++++++++++++++--------------------
218e99
 tests/qemu-iotests/038       |   10 +++---
218e99
 tests/qemu-iotests/039       |   28 +++++++++---------
218e99
 tests/qemu-iotests/042       |   10 +++---
218e99
 tests/qemu-iotests/043       |   32 ++++++++++----------
218e99
 tests/qemu-iotests/046       |   10 +++---
218e99
 tests/qemu-iotests/047       |    2 +-
218e99
 tests/qemu-iotests/048       |    8 ++--
218e99
 tests/qemu-iotests/049       |   36 ++++++++++++------------
218e99
 tests/qemu-iotests/050       |   20 ++++++------
218e99
 tests/qemu-iotests/051       |   50 ++++++++++++++++----------------
218e99
 tests/qemu-iotests/052       |    6 ++--
218e99
 tests/qemu-iotests/053       |   10 +++---
218e99
 tests/qemu-iotests/054       |    2 +-
218e99
 tests/qemu-iotests/059       |    6 ++--
218e99
 tests/qemu-iotests/063       |   28 +++++++++---------
218e99
 tests/qemu-iotests/common.rc |   16 +++++-----
218e99
 49 files changed, 337 insertions(+), 337 deletions(-)
218e99
218e99
diff --git a/tests/qemu-iotests/001 b/tests/qemu-iotests/001
218e99
index bd88dde..4e16469 100755
218e99
--- a/tests/qemu-iotests/001
218e99
+++ b/tests/qemu-iotests/001
218e99
@@ -48,15 +48,15 @@ _make_test_img $size
218e99
 
218e99
 echo
218e99
 echo "== reading whole image =="
218e99
-$QEMU_IO -c "read 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== rewriting whole image =="
218e99
-$QEMU_IO -c "write -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== verify pattern =="
218e99
-$QEMU_IO -c "read -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 
218e99
 # success, all done
218e99
diff --git a/tests/qemu-iotests/002 b/tests/qemu-iotests/002
218e99
index 51d0a8f..6a865aa 100755
218e99
--- a/tests/qemu-iotests/002
218e99
+++ b/tests/qemu-iotests/002
218e99
@@ -48,36 +48,36 @@ _make_test_img $size
218e99
 
218e99
 echo
218e99
 echo "== reading whole image =="
218e99
-$QEMU_IO -c "read -p 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -p 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== rewriting whole image =="
218e99
-$QEMU_IO -c "write -pP 0xa 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -pP 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== verify pattern =="
218e99
-$QEMU_IO -c "read -pP 0xa 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -pP 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "unaligned pwrite"
218e99
-$QEMU_IO -c 'write -pP 0xab 66 42' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c 'write -pP 0xac 512 288' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c 'write -pP 0xad 800 224' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c 'write -pP 0xae 66000 128k' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c 'write -pP 0xaf 256k 42' $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c 'write -pP 0xab 66 42' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c 'write -pP 0xac 512 288' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c 'write -pP 0xad 800 224' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c 'write -pP 0xae 66000 128k' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c 'write -pP 0xaf 256k 42' "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "verify pattern"
218e99
-$QEMU_IO -c 'read -pP 0xa 0 66' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c 'read -pP 0xab 66 42' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c 'read -pP 0xa 108 404' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c 'read -pP 0xac 512 288' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c 'read -pP 0xad 800 224' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c 'read -pP 0xa 1k 64976' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c 'read -pP 0xae 66000 128k' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c 'read -pP 0xa 197072 65072' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c 'read -pP 0xaf 256k 42' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c 'read -pP 0xa 262186 470' $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c 'read -pP 0xa 0 66' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c 'read -pP 0xab 66 42' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c 'read -pP 0xa 108 404' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c 'read -pP 0xac 512 288' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c 'read -pP 0xad 800 224' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c 'read -pP 0xa 1k 64976' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c 'read -pP 0xae 66000 128k' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c 'read -pP 0xa 197072 65072' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c 'read -pP 0xaf 256k 42' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c 'read -pP 0xa 262186 470' "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # success, all done
218e99
 echo "*** done"
218e99
diff --git a/tests/qemu-iotests/003 b/tests/qemu-iotests/003
218e99
index ee25fb8..98638d4 100755
218e99
--- a/tests/qemu-iotests/003
218e99
+++ b/tests/qemu-iotests/003
218e99
@@ -50,27 +50,27 @@ _make_test_img $size
218e99
 
218e99
 echo
218e99
 echo "== reading whole image =="
218e99
-$QEMU_IO -c "readv 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "readv 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== rewriting whole image =="
218e99
-$QEMU_IO -c "writev -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "writev -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== verify pattern =="
218e99
-$QEMU_IO -c "readv -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "readv -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== vectored write =="
218e99
 $QEMU_IO -c "writev -P 0xb $offset $chunksize $chunksize \
218e99
 	$chunksize $chunksize $chunksize $chunksize $chunksize" \
218e99
-	$TEST_IMG | _filter_qemu_io
218e99
+	"$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== verify pattern =="
218e99
 $QEMU_IO -c "readv -P 0xb $offset $chunksize $chunksize \
218e99
 	$chunksize $chunksize $chunksize $chunksize $chunksize" \
218e99
-	$TEST_IMG | _filter_qemu_io
218e99
+	"$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # success, all done
218e99
 echo "*** done"
218e99
diff --git a/tests/qemu-iotests/004 b/tests/qemu-iotests/004
218e99
index c76451c..651072e 100755
218e99
--- a/tests/qemu-iotests/004
218e99
+++ b/tests/qemu-iotests/004
218e99
@@ -51,51 +51,51 @@ _make_test_img $size
218e99
 
218e99
 echo
218e99
 echo "write before image boundary"
218e99
-$QEMU_IO -c "write $pre_offset 1M" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write $pre_offset 1M" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "write into image boundary"
218e99
-$QEMU_IO -c "write $pre_offset 4M" $TEST_IMG
218e99
+$QEMU_IO -c "write $pre_offset 4M" "$TEST_IMG"
218e99
 
218e99
 echo
218e99
 echo "write at image boundary"
218e99
-$QEMU_IO -c "write $size 4096" $TEST_IMG
218e99
+$QEMU_IO -c "write $size 4096" "$TEST_IMG"
218e99
 
218e99
 echo
218e99
 echo "write past image boundary"
218e99
-$QEMU_IO -c "write $past_offset 4096" $TEST_IMG
218e99
+$QEMU_IO -c "write $past_offset 4096" "$TEST_IMG"
218e99
 
218e99
 echo
218e99
 echo "pwrite past image boundary"
218e99
-$QEMU_IO -c "write -p $past_offset 4096" $TEST_IMG
218e99
+$QEMU_IO -c "write -p $past_offset 4096" "$TEST_IMG"
218e99
 
218e99
 echo
218e99
 echo "writev past image boundary"
218e99
-$QEMU_IO -c "writev $past_offset 4096" $TEST_IMG
218e99
+$QEMU_IO -c "writev $past_offset 4096" "$TEST_IMG"
218e99
 
218e99
 echo
218e99
 echo "read before image boundary"
218e99
-$QEMU_IO -c "read $pre_offset 1M" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read $pre_offset 1M" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "read into image boundary"
218e99
-$QEMU_IO -c "read $pre_offset 4M" $TEST_IMG
218e99
+$QEMU_IO -c "read $pre_offset 4M" "$TEST_IMG"
218e99
 
218e99
 echo
218e99
 echo "read at image boundary"
218e99
-$QEMU_IO -c "read $size 4096" $TEST_IMG
218e99
+$QEMU_IO -c "read $size 4096" "$TEST_IMG"
218e99
 
218e99
 echo
218e99
 echo "read past image boundary"
218e99
-$QEMU_IO -c "read $past_offset 4096" $TEST_IMG
218e99
+$QEMU_IO -c "read $past_offset 4096" "$TEST_IMG"
218e99
 
218e99
 echo
218e99
 echo "pread past image boundary"
218e99
-$QEMU_IO -c "read -p $past_offset 4096" $TEST_IMG
218e99
+$QEMU_IO -c "read -p $past_offset 4096" "$TEST_IMG"
218e99
 
218e99
 echo
218e99
 echo "readv past image boundary"
218e99
-$QEMU_IO -c "readv $past_offset 4096" $TEST_IMG
218e99
+$QEMU_IO -c "readv $past_offset 4096" "$TEST_IMG"
218e99
 
218e99
 
218e99
 # success, all done
218e99
diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005
218e99
index b7970e3..9abcb84 100755
218e99
--- a/tests/qemu-iotests/005
218e99
+++ b/tests/qemu-iotests/005
218e99
@@ -61,11 +61,11 @@ _make_test_img 5000G
218e99
 
218e99
 echo
218e99
 echo "small read"
218e99
-$QEMU_IO -c "read 1024 4096" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read 1024 4096" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "small write"
218e99
-$QEMU_IO -c "write 8192 4096" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write 8192 4096" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # success, all done
218e99
 echo "*** done"
218e99
diff --git a/tests/qemu-iotests/007 b/tests/qemu-iotests/007
218e99
index c454f2c..fc84445 100755
218e99
--- a/tests/qemu-iotests/007
218e99
+++ b/tests/qemu-iotests/007
218e99
@@ -50,7 +50,7 @@ _make_test_img 1M
218e99
 
218e99
 for i in `seq 1 10`; do
218e99
     echo "savevm $i"
218e99
-    $QEMU -nographic -hda $TEST_IMG -serial none -monitor stdio >/dev/null 2>&1 <
218e99
+    $QEMU -nographic -hda "$TEST_IMG" -serial none -monitor stdio >/dev/null 2>&1 <
218e99
 savevm test-$i
218e99
 quit
218e99
 EOF
218e99
diff --git a/tests/qemu-iotests/008 b/tests/qemu-iotests/008
218e99
index 2c53bac..2d28efd 100755
218e99
--- a/tests/qemu-iotests/008
218e99
+++ b/tests/qemu-iotests/008
218e99
@@ -48,15 +48,15 @@ _make_test_img $size
218e99
 
218e99
 echo
218e99
 echo "== reading whole image =="
218e99
-$QEMU_IO -c "aio_read 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "aio_read 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== rewriting whole image =="
218e99
-$QEMU_IO -c "aio_write -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "aio_write -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== verify pattern =="
218e99
-$QEMU_IO -c "aio_read -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "aio_read -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 
218e99
 # success, all done
218e99
diff --git a/tests/qemu-iotests/009 b/tests/qemu-iotests/009
218e99
index 25368c8..57a43f5 100755
218e99
--- a/tests/qemu-iotests/009
218e99
+++ b/tests/qemu-iotests/009
218e99
@@ -57,7 +57,7 @@ $QEMU_IO \
218e99
 	-c "write 4k 4k" \
218e99
 	-c "write 9M 4k" \
218e99
 	-c "read -P 65 -s 4k -l 4k 2044k 8k" \
218e99
-$TEST_IMG | _filter_qemu_io
218e99
+"$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "checking image for errors"
218e99
diff --git a/tests/qemu-iotests/010 b/tests/qemu-iotests/010
218e99
index 7b57929..896a005 100755
218e99
--- a/tests/qemu-iotests/010
218e99
+++ b/tests/qemu-iotests/010
218e99
@@ -59,7 +59,7 @@ $QEMU_IO \
218e99
 	-c "write -P 165 2044k 4k" \
218e99
 	-c "write -P 99 8M 4k" \
218e99
 	-c "read -P 165 2044k 8k" \
218e99
-$TEST_IMG | _filter_qemu_io
218e99
+"$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "checking image for errors"
218e99
diff --git a/tests/qemu-iotests/011 b/tests/qemu-iotests/011
218e99
index b03df68..1c5158a 100755
218e99
--- a/tests/qemu-iotests/011
218e99
+++ b/tests/qemu-iotests/011
218e99
@@ -60,7 +60,7 @@ for i in `seq 1 10`; do
218e99
     # Note that we filter away the actual offset.  That's because qemu
218e99
     # may re-order the two aio requests.  We only want to make sure the
218e99
     # filesystem isn't corrupted afterwards anyway.
218e99
-    $QEMU_IO -c "aio_write $off1 1M" -c "aio_write $off2 1M" $TEST_IMG | \
218e99
+    $QEMU_IO -c "aio_write $off1 1M" -c "aio_write $off2 1M" "$TEST_IMG" | \
218e99
     	_filter_qemu_io | \
218e99
 	sed -e 's/bytes at offset [0-9]*/bytes at offset XXX/g'
218e99
 done
218e99
diff --git a/tests/qemu-iotests/012 b/tests/qemu-iotests/012
218e99
index 4052956..7c5b689 100755
218e99
--- a/tests/qemu-iotests/012
218e99
+++ b/tests/qemu-iotests/012
218e99
@@ -50,11 +50,11 @@ _make_test_img $size
218e99
 
218e99
 echo
218e99
 echo "== mark image read-only"
218e99
-chmod a-w $TEST_IMG
218e99
+chmod a-w "$TEST_IMG"
218e99
 
218e99
 echo
218e99
 echo "== read from read-only image"
218e99
-$QEMU_IO -r -c "read 0 512" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -r -c "read 0 512" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # success, all done
218e99
 echo "*** done"
218e99
diff --git a/tests/qemu-iotests/013 b/tests/qemu-iotests/013
218e99
index ce40d5c..389f4b8 100755
218e99
--- a/tests/qemu-iotests/013
218e99
+++ b/tests/qemu-iotests/013
218e99
@@ -65,8 +65,8 @@ done
218e99
 echo "Compressing image"
218e99
 echo
218e99
 
218e99
-mv $TEST_IMG $TEST_IMG.orig
218e99
-$QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c $TEST_IMG.orig $TEST_IMG
218e99
+mv "$TEST_IMG" "$TEST_IMG.orig"
218e99
+$QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c "$TEST_IMG.orig" "$TEST_IMG"
218e99
 
218e99
 echo "Testing compressed image"
218e99
 echo
218e99
diff --git a/tests/qemu-iotests/014 b/tests/qemu-iotests/014
218e99
index a6d0aea..0edeb4b 100755
218e99
--- a/tests/qemu-iotests/014
218e99
+++ b/tests/qemu-iotests/014
218e99
@@ -61,7 +61,7 @@ done
218e99
 
218e99
 # With snapshots
218e99
 for i in `seq 1 3`; do
218e99
-    $QEMU_IMG snapshot -c test$i $TEST_IMG
218e99
+    $QEMU_IMG snapshot -c test$i "$TEST_IMG"
218e99
     for offset in $TEST_OFFSETS; do
218e99
         echo With snapshot test$i, offset $offset
218e99
         for op in $TEST_OPS; do
218e99
diff --git a/tests/qemu-iotests/015 b/tests/qemu-iotests/015
218e99
index 44c134f..099d757 100755
218e99
--- a/tests/qemu-iotests/015
218e99
+++ b/tests/qemu-iotests/015
218e99
@@ -61,19 +61,19 @@ _make_test_img $size
218e99
 
218e99
 # Create two snapshots which fill the image with two different patterns
218e99
 echo "creating first snapshot"
218e99
-$QEMU_IO -c "aio_write -P 123 0 $size" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IMG snapshot -c snap1 $TEST_IMG
218e99
+$QEMU_IO -c "aio_write -P 123 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IMG snapshot -c snap1 "$TEST_IMG"
218e99
 echo "creating second snapshot"
218e99
-$QEMU_IO -c "aio_write -P 165 0 $size" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IMG snapshot -c snap2 $TEST_IMG
218e99
+$QEMU_IO -c "aio_write -P 165 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IMG snapshot -c snap2 "$TEST_IMG"
218e99
 
218e99
 # Now check the pattern
218e99
 echo "checking first snapshot"
218e99
-$QEMU_IMG snapshot -a snap1 $TEST_IMG
218e99
-$QEMU_IO -c "aio_read -P 123 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IMG snapshot -a snap1 "$TEST_IMG"
218e99
+$QEMU_IO -c "aio_read -P 123 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 echo "checking second snapshot"
218e99
-$QEMU_IMG snapshot -a snap2 $TEST_IMG
218e99
-$QEMU_IO -c "aio_read -P 165 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IMG snapshot -a snap2 "$TEST_IMG"
218e99
+$QEMU_IO -c "aio_read -P 165 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "checking image for errors"
218e99
diff --git a/tests/qemu-iotests/016 b/tests/qemu-iotests/016
218e99
index a1467b8..b87a32b 100755
218e99
--- a/tests/qemu-iotests/016
218e99
+++ b/tests/qemu-iotests/016
218e99
@@ -48,21 +48,21 @@ _make_test_img $size
218e99
 
218e99
 echo
218e99
 echo "== reading at EOF =="
218e99
-$QEMU_IO -g -c "read -P 0 $size 512" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -g -c "read -P 0 $size 512" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== reading far past EOF =="
218e99
-$QEMU_IO -g -c "read -P 0 256M 512" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -g -c "read -P 0 256M 512" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== writing at EOF =="
218e99
-$QEMU_IO -g -c "write -P 66 $size 512" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 66 $size 512" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -g -c "write -P 66 $size 512" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 66 $size 512" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== writing far past EOF =="
218e99
-$QEMU_IO -g -c "write -P 66 256M 512" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 66 256M 512" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -g -c "write -P 66 256M 512" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 66 256M 512" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # success, all done
218e99
 echo "*** done"
218e99
diff --git a/tests/qemu-iotests/018 b/tests/qemu-iotests/018
218e99
index 453ce61..15fcfe5 100755
218e99
--- a/tests/qemu-iotests/018
218e99
+++ b/tests/qemu-iotests/018
218e99
@@ -66,7 +66,7 @@ echo "Creating test image with backing file"
218e99
 echo
218e99
 
218e99
 TEST_IMG=$TEST_IMG_SAVE
218e99
-_make_test_img -b $TEST_IMG.base 6G
218e99
+_make_test_img -b "$TEST_IMG.base" 6G
218e99
 
218e99
 echo "Filling test image"
218e99
 echo
218e99
@@ -80,8 +80,8 @@ for offset in $TEST_OFFSETS; do
218e99
 done
218e99
 _check_test_img
218e99
 
218e99
-mv $TEST_IMG $TEST_IMG.orig
218e99
-$QEMU_IMG convert -O $IMGFMT $TEST_IMG.orig $TEST_IMG
218e99
+mv "$TEST_IMG" "$TEST_IMG.orig"
218e99
+$QEMU_IMG convert -O $IMGFMT "$TEST_IMG.orig" "$TEST_IMG"
218e99
 
218e99
 echo "Reading"
218e99
 echo
218e99
diff --git a/tests/qemu-iotests/019 b/tests/qemu-iotests/019
218e99
index 8872b30..cd3582c 100755
218e99
--- a/tests/qemu-iotests/019
218e99
+++ b/tests/qemu-iotests/019
218e99
@@ -33,8 +33,8 @@ status=1	# failure is the default!
218e99
 _cleanup()
218e99
 {
218e99
 	_cleanup_test_img
218e99
-    rm -f $TEST_IMG.base
218e99
-    rm -f $TEST_IMG.orig
218e99
+    rm -f "$TEST_IMG.base"
218e99
+    rm -f "$TEST_IMG.orig"
218e99
 }
218e99
 trap "_cleanup; exit \$status" 0 1 2 3 15
218e99
 
218e99
@@ -68,8 +68,8 @@ _check_test_img
218e99
 echo "Creating test image with backing file"
218e99
 echo
218e99
 
218e99
-mv $TEST_IMG $TEST_IMG.base
218e99
-_make_test_img -b $TEST_IMG.base 6G
218e99
+mv "$TEST_IMG" "$TEST_IMG.base"
218e99
+_make_test_img -b "$TEST_IMG.base" 6G
218e99
 
218e99
 echo "Filling test image"
218e99
 echo
218e99
@@ -83,7 +83,7 @@ for offset in $TEST_OFFSETS; do
218e99
 done
218e99
 _check_test_img
218e99
 
218e99
-mv $TEST_IMG $TEST_IMG.orig
218e99
+mv "$TEST_IMG" "$TEST_IMG.orig"
218e99
 
218e99
 
218e99
 
218e99
@@ -95,7 +95,7 @@ for backing_option in "-B $TEST_IMG.base" "-o backing_file=$TEST_IMG.base"; do
218e99
     echo
218e99
     echo Testing conversion with $backing_option | _filter_testdir | _filter_imgfmt
218e99
     echo
218e99
-    $QEMU_IMG convert -O $IMGFMT $backing_option $TEST_IMG.orig $TEST_IMG
218e99
+    $QEMU_IMG convert -O $IMGFMT $backing_option "$TEST_IMG.orig" "$TEST_IMG"
218e99
 
218e99
     echo "Checking if backing clusters are allocated when they shouldn't"
218e99
     echo
218e99
diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020
218e99
index 2fb0ff8..b3c86d8 100755
218e99
--- a/tests/qemu-iotests/020
218e99
+++ b/tests/qemu-iotests/020
218e99
@@ -31,8 +31,8 @@ status=1	# failure is the default!
218e99
 _cleanup()
218e99
 {
218e99
 	_cleanup_test_img
218e99
-    rm -f $TEST_IMG.base
218e99
-    rm -f $TEST_IMG.orig
218e99
+    rm -f "$TEST_IMG.base"
218e99
+    rm -f "$TEST_IMG.orig"
218e99
 }
218e99
 trap "_cleanup; exit \$status" 0 1 2 3 15
218e99
 
218e99
@@ -65,8 +65,8 @@ _check_test_img
218e99
 echo "Creating test image with backing file"
218e99
 echo
218e99
 
218e99
-mv $TEST_IMG $TEST_IMG.base
218e99
-_make_test_img -b $TEST_IMG.base 6G
218e99
+mv "$TEST_IMG" "$TEST_IMG.base"
218e99
+_make_test_img -b "$TEST_IMG.base" 6G
218e99
 
218e99
 echo "Filling test image"
218e99
 echo
218e99
@@ -80,8 +80,8 @@ for offset in $TEST_OFFSETS; do
218e99
 done
218e99
 _check_test_img
218e99
 
218e99
-$QEMU_IMG commit $TEST_IMG
218e99
-mv $TEST_IMG.base $TEST_IMG
218e99
+$QEMU_IMG commit "$TEST_IMG"
218e99
+mv "$TEST_IMG.base" "$TEST_IMG"
218e99
 
218e99
 echo "Reading from the backing file"
218e99
 echo
218e99
diff --git a/tests/qemu-iotests/021 b/tests/qemu-iotests/021
218e99
index 6da79eb..1c69024 100755
218e99
--- a/tests/qemu-iotests/021
218e99
+++ b/tests/qemu-iotests/021
218e99
@@ -53,7 +53,7 @@ for pattern in $INVALID_PATTERNS; do
218e99
     for op in $TEST_OPS; do
218e99
         echo
218e99
 	echo "== testing $op -P $pattern =="
218e99
-	$QEMU_IO -c "$op -P $pattern 0 4096" $TEST_IMG | _filter_qemu_io
218e99
+	$QEMU_IO -c "$op -P $pattern 0 4096" "$TEST_IMG" | _filter_qemu_io
218e99
     done
218e99
 done
218e99
 
218e99
diff --git a/tests/qemu-iotests/023 b/tests/qemu-iotests/023
218e99
index 4f31b56..090ed23 100755
218e99
--- a/tests/qemu-iotests/023
218e99
+++ b/tests/qemu-iotests/023
218e99
@@ -71,8 +71,8 @@ for CLUSTER_SIZE in $CLUSTER_SIZES; do
218e99
     echo "Compressing image"
218e99
     echo
218e99
 
218e99
-    mv $TEST_IMG $TEST_IMG.orig
218e99
-    $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c $TEST_IMG.orig $TEST_IMG
218e99
+    mv "$TEST_IMG" "$TEST_IMG.orig"
218e99
+    $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -c "$TEST_IMG.orig" "$TEST_IMG"
218e99
 
218e99
     echo "Testing compressed image"
218e99
     echo
218e99
diff --git a/tests/qemu-iotests/024 b/tests/qemu-iotests/024
218e99
index 554b74b..be974f0 100755
218e99
--- a/tests/qemu-iotests/024
218e99
+++ b/tests/qemu-iotests/024
218e99
@@ -31,8 +31,8 @@ status=1	# failure is the default!
218e99
 _cleanup()
218e99
 {
218e99
 	_cleanup_test_img
218e99
-	rm -f $TEST_DIR/t.$IMGFMT.base_old
218e99
-	rm -f $TEST_DIR/t.$IMGFMT.base_new
218e99
+	rm -f "$TEST_DIR/t.$IMGFMT.base_old"
218e99
+	rm -f "$TEST_DIR/t.$IMGFMT.base_new"
218e99
 }
218e99
 trap "_cleanup; exit \$status" 0 1 2 3 15
218e99
 
218e99
@@ -62,19 +62,19 @@ echo
218e99
 
218e99
 _make_test_img 1G
218e99
 io_pattern writev 0 $CLUSTER_SIZE $((2 * CLUSTER_SIZE)) 8 0x11
218e99
-mv $TEST_IMG $TEST_IMG.base_old
218e99
+mv "$TEST_IMG" "$TEST_IMG.base_old"
218e99
 
218e99
 echo "Creating new backing file"
218e99
 echo
218e99
 
218e99
 _make_test_img 1G
218e99
 io_pattern writev 0 $((2 * CLUSTER_SIZE)) $((4 * CLUSTER_SIZE)) 4 0x22
218e99
-mv $TEST_IMG $TEST_IMG.base_new
218e99
+mv "$TEST_IMG" "$TEST_IMG.base_new"
218e99
 
218e99
 echo "Creating COW image"
218e99
 echo
218e99
 
218e99
-_make_test_img -b $TEST_IMG.base_old 1G
218e99
+_make_test_img -b "$TEST_IMG.base_old" 1G
218e99
 io_pattern writev 0 $((4 * CLUSTER_SIZE)) 0 1 0x33
218e99
 io_pattern writev $((8 * CLUSTER_SIZE)) $((4 * CLUSTER_SIZE)) 0 1 0x33
218e99
 
218e99
@@ -100,7 +100,7 @@ io_pattern readv $((15 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x00
218e99
 echo
218e99
 echo Rebase and test again
218e99
 echo
218e99
-$QEMU_IMG rebase -b $TEST_IMG.base_new $TEST_IMG
218e99
+$QEMU_IMG rebase -b "$TEST_IMG.base_new" "$TEST_IMG"
218e99
 io_pattern readv $((0 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33
218e99
 io_pattern readv $((1 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33
218e99
 io_pattern readv $((2 * CLUSTER_SIZE)) $CLUSTER_SIZE 0 1 0x33
218e99
diff --git a/tests/qemu-iotests/025 b/tests/qemu-iotests/025
218e99
index 7062aa6..a7241cc 100755
218e99
--- a/tests/qemu-iotests/025
218e99
+++ b/tests/qemu-iotests/025
218e99
@@ -56,7 +56,7 @@ _check_test_img
218e99
 
218e99
 echo
218e99
 echo "=== Resizing image"
218e99
-$QEMU_IO $TEST_IMG <
218e99
+$QEMU_IO "$TEST_IMG" <
218e99
 length
218e99
 truncate $big_size
218e99
 length
218e99
@@ -65,7 +65,7 @@ _check_test_img
218e99
 
218e99
 echo
218e99
 echo "=== Verifying image size after reopen"
218e99
-$QEMU_IO -c "length" $TEST_IMG
218e99
+$QEMU_IO -c "length" "$TEST_IMG"
218e99
 
218e99
 echo
218e99
 echo "=== Verifying resized image"
218e99
diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026
218e99
index 107a3ff..ebe29d0 100755
218e99
--- a/tests/qemu-iotests/026
218e99
+++ b/tests/qemu-iotests/026
218e99
@@ -31,7 +31,7 @@ status=1	# failure is the default!
218e99
 _cleanup()
218e99
 {
218e99
 	_cleanup_test_img
218e99
-    rm $TEST_DIR/blkdebug.conf
218e99
+    rm "$TEST_DIR/blkdebug.conf"
218e99
 }
218e99
 trap "_cleanup; exit \$status" 0 1 2 3 15
218e99
 
218e99
@@ -75,7 +75,7 @@ for imm in off; do
218e99
 for once in on off; do
218e99
 for vmstate in "" "-b"; do
218e99
 
218e99
-cat > $TEST_DIR/blkdebug.conf <
218e99
+cat > "$TEST_DIR/blkdebug.conf" <
218e99
 [inject-error]
218e99
 event = "$event"
218e99
 errno = "$errno"
218e99
@@ -90,16 +90,16 @@ echo "Event: $event; errno: $errno; imm: $imm; once: $once; write $vmstate"
218e99
 
218e99
 # We want to catch a simple L2 update, not the allocation of the first L2 table
218e99
 if [ "$event" == "l2_update" ]; then
218e99
-    $QEMU_IO -c "write $vmstate 0 512" $TEST_IMG > /dev/null 2>&1
218e99
+    $QEMU_IO -c "write $vmstate 0 512" "$TEST_IMG" > /dev/null 2>&1
218e99
 fi
218e99
 
218e99
-$QEMU_IO -c "write $vmstate 0 128k " $BLKDBG_TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write $vmstate 0 128k " "$BLKDBG_TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # l2_load is not called on allocation, so issue a second write
218e99
 # Reads are another path to trigger l2_load, so do a read, too
218e99
 if [ "$event" == "l2_load" ]; then
218e99
-    $QEMU_IO -c "write $vmstate 0 128k " $BLKDBG_TEST_IMG | _filter_qemu_io
218e99
-    $QEMU_IO -c "read $vmstate 0 128k " $BLKDBG_TEST_IMG | _filter_qemu_io
218e99
+    $QEMU_IO -c "write $vmstate 0 128k " "$BLKDBG_TEST_IMG" | _filter_qemu_io
218e99
+    $QEMU_IO -c "read $vmstate 0 128k " "$BLKDBG_TEST_IMG" | _filter_qemu_io
218e99
 fi
218e99
 
218e99
 _check_test_img 2>&1 | grep -v "refcount=1 reference=0"
218e99
@@ -133,7 +133,7 @@ for imm in off; do
218e99
 for once in on off; do
218e99
 for vmstate in "" "-b"; do
218e99
 
218e99
-cat > $TEST_DIR/blkdebug.conf <
218e99
+cat > "$TEST_DIR/blkdebug.conf" <
218e99
 [inject-error]
218e99
 event = "$event"
218e99
 errno = "$errno"
218e99
@@ -145,7 +145,7 @@ _make_test_img 1G
218e99
 
218e99
 echo
218e99
 echo "Event: $event; errno: $errno; imm: $imm; once: $once; write $vmstate"
218e99
-$QEMU_IO -c "write $vmstate 0 64M" $BLKDBG_TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write $vmstate 0 64M" "$BLKDBG_TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 _check_test_img 2>&1 | grep -v "refcount=1 reference=0"
218e99
 
218e99
@@ -172,7 +172,7 @@ for errno in 5 28; do
218e99
 for imm in off; do
218e99
 for once in on off; do
218e99
 
218e99
-cat > $TEST_DIR/blkdebug.conf <
218e99
+cat > "$TEST_DIR/blkdebug.conf" <
218e99
 [inject-error]
218e99
 event = "$event"
218e99
 errno = "$errno"
218e99
@@ -184,7 +184,7 @@ _make_test_img 1G
218e99
 
218e99
 echo
218e99
 echo "Event: $event; errno: $errno; imm: $imm; once: $once"
218e99
-$QEMU_IO -c "write -b 0 64k" $BLKDBG_TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -b 0 64k" "$BLKDBG_TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 _check_test_img 2>&1 | grep -v "refcount=1 reference=0"
218e99
 
218e99
diff --git a/tests/qemu-iotests/027 b/tests/qemu-iotests/027
218e99
index 7d90481..3fa81b8 100755
218e99
--- a/tests/qemu-iotests/027
218e99
+++ b/tests/qemu-iotests/027
218e99
@@ -54,23 +54,23 @@ _make_test_img $size
218e99
 # Otherwise an L2 table could get in the way after the data cluster.
218e99
 echo
218e99
 echo "== writing first cluster to populate metadata =="
218e99
-$QEMU_IO -c "write -pP 0xde $cluster_size $cluster_size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -pP 0xde $cluster_size $cluster_size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== writing at sub-cluster granularity =="
218e99
-$QEMU_IO -c "write -pP 0xa $subcluster_offset $subcluster_size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -pP 0xa $subcluster_offset $subcluster_size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== verify pattern =="
218e99
-$QEMU_IO -c "read -pP 0xa $subcluster_offset $subcluster_size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -pP 0xa $subcluster_offset $subcluster_size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== verify zeroes before sub-cluster pattern =="
218e99
-$QEMU_IO -c "read -pP 0 -l $subcluster_offset 0 $subcluster_size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -pP 0 -l $subcluster_offset 0 $subcluster_size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== verify zeroes after sub-cluster pattern =="
218e99
-$QEMU_IO -c "read -pP 0 -l 512 -s $subcluster_size $subcluster_offset $(( subcluster_size + 512 ))" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -pP 0 -l 512 -s $subcluster_size $subcluster_offset $(( subcluster_size + 512 ))" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # success, all done
218e99
 echo "*** done"
218e99
diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
218e99
index b091ba9..93a9fa6 100755
218e99
--- a/tests/qemu-iotests/028
218e99
+++ b/tests/qemu-iotests/028
218e99
@@ -71,8 +71,8 @@ _check_test_img
218e99
 echo "Creating test image with backing file"
218e99
 echo
218e99
 
218e99
-mv $TEST_IMG $TEST_IMG.base
218e99
-_make_test_img -b $TEST_IMG.base $image_size
218e99
+mv "$TEST_IMG" "$TEST_IMG.base"
218e99
+_make_test_img -b "$TEST_IMG.base" $image_size
218e99
 
218e99
 echo "Filling test image"
218e99
 echo
218e99
@@ -97,7 +97,7 @@ io_zero readv $(( offset + 32 * 1024 )) 512 1024 32
218e99
 _check_test_img
218e99
 
218e99
 # Rebase it on top of its base image
218e99
-$QEMU_IMG rebase -b $TEST_IMG.base $TEST_IMG
218e99
+$QEMU_IMG rebase -b "$TEST_IMG.base" "$TEST_IMG"
218e99
 
218e99
 _check_test_img
218e99
 
218e99
diff --git a/tests/qemu-iotests/029 b/tests/qemu-iotests/029
218e99
index 0ad5e45..b424726 100755
218e99
--- a/tests/qemu-iotests/029
218e99
+++ b/tests/qemu-iotests/029
218e99
@@ -47,16 +47,16 @@ _supported_os Linux
218e99
 
218e99
 CLUSTER_SIZE=65536
218e99
 _make_test_img 64M
218e99
-$QEMU_IMG snapshot -c foo $TEST_IMG
218e99
-$QEMU_IO -c 'write -b 0 4k' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IMG snapshot -a foo $TEST_IMG
218e99
+$QEMU_IMG snapshot -c foo "$TEST_IMG"
218e99
+$QEMU_IO -c 'write -b 0 4k' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IMG snapshot -a foo "$TEST_IMG"
218e99
 _check_test_img
218e99
 
218e99
 CLUSTER_SIZE=1024
218e99
 _make_test_img 16M
218e99
-$QEMU_IMG snapshot -c foo $TEST_IMG
218e99
-$QEMU_IO -c 'write -b 0 4M' $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IMG snapshot -a foo $TEST_IMG
218e99
+$QEMU_IMG snapshot -c foo "$TEST_IMG"
218e99
+$QEMU_IO -c 'write -b 0 4M' "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IMG snapshot -a foo "$TEST_IMG"
218e99
 _check_test_img
218e99
 
218e99
 # success, all done
218e99
diff --git a/tests/qemu-iotests/031 b/tests/qemu-iotests/031
218e99
index 2d5e3b1..c9070b0 100755
218e99
--- a/tests/qemu-iotests/031
218e99
+++ b/tests/qemu-iotests/031
218e99
@@ -56,22 +56,22 @@ for IMGOPTS in "compat=0.10" "compat=1.1"; do
218e99
     echo === Create image with unknown header extension ===
218e99
     echo
218e99
     _make_test_img 64M
218e99
-    ./qcow2.py $TEST_IMG add-header-ext 0x12345678 "This is a test header extension"
218e99
-    ./qcow2.py $TEST_IMG dump-header
218e99
+    ./qcow2.py "$TEST_IMG" add-header-ext 0x12345678 "This is a test header extension"
218e99
+    ./qcow2.py "$TEST_IMG" dump-header
218e99
     _check_test_img
218e99
 
218e99
     echo
218e99
     echo === Rewrite header with no backing file ===
218e99
     echo
218e99
-    $QEMU_IMG rebase -u -b "" $TEST_IMG
218e99
-    ./qcow2.py $TEST_IMG dump-header
218e99
+    $QEMU_IMG rebase -u -b "" "$TEST_IMG"
218e99
+    ./qcow2.py "$TEST_IMG" dump-header
218e99
     _check_test_img
218e99
 
218e99
     echo
218e99
     echo === Add a backing file and format ===
218e99
     echo
218e99
-    $QEMU_IMG rebase -u -b "/some/backing/file/path" -F host_device $TEST_IMG
218e99
-    ./qcow2.py $TEST_IMG dump-header
218e99
+    $QEMU_IMG rebase -u -b "/some/backing/file/path" -F host_device "$TEST_IMG"
218e99
+    ./qcow2.py "$TEST_IMG" dump-header
218e99
 done
218e99
 
218e99
 # success, all done
218e99
diff --git a/tests/qemu-iotests/032 b/tests/qemu-iotests/032
218e99
index 7155568..b1ba5c3 100755
218e99
--- a/tests/qemu-iotests/032
218e99
+++ b/tests/qemu-iotests/032
218e99
@@ -55,12 +55,12 @@ _make_test_img 64M
218e99
 
218e99
 # Allocate every other cluster so that afterwards a big write request will
218e99
 # actually loop a while and issue many I/O requests for the lower layer
218e99
-for i in $(seq 0 128 4096); do echo "write ${i}k 64k"; done | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
+for i in $(seq 0 128 4096); do echo "write ${i}k 64k"; done | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo === AIO request during close ===
218e99
 echo
218e99
-$QEMU_IO -c "aio_write 0 4M" -c "close" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "aio_write 0 4M" -c "close" "$TEST_IMG" | _filter_qemu_io
218e99
 _check_test_img
218e99
 
218e99
 # success, all done
218e99
diff --git a/tests/qemu-iotests/033 b/tests/qemu-iotests/033
218e99
index 9aee078..ea3351c 100755
218e99
--- a/tests/qemu-iotests/033
218e99
+++ b/tests/qemu-iotests/033
218e99
@@ -48,24 +48,24 @@ _make_test_img $size
218e99
 
218e99
 echo
218e99
 echo "== preparing image =="
218e99
-$QEMU_IO -c "write -P 0xa 0x200 0x400" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -P 0xa 0x20000 0x600" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -z 0x400 0x20000" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0xa 0x200 0x400" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0xa 0x20000 0x600" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -z 0x400 0x20000" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== verifying patterns (1) =="
218e99
-$QEMU_IO -c "read -P 0xa 0x200 0x200" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x0 0x400 0x20000" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0xa 0x20400 0x200" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0xa 0x200 0x200" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x0 0x400 0x20000" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0xa 0x20400 0x200" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== rewriting zeroes =="
218e99
-$QEMU_IO -c "write -P 0xb 0x10000 0x10000" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -z 0x10000 0x10000" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0xb 0x10000 0x10000" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -z 0x10000 0x10000" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== verifying patterns (2) =="
218e99
-$QEMU_IO -c "read -P 0x0 0x400 0x20000" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x0 0x400 0x20000" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # success, all done
218e99
 echo "*** done"
218e99
diff --git a/tests/qemu-iotests/034 b/tests/qemu-iotests/034
218e99
index 8254df8..67f1959 100755
218e99
--- a/tests/qemu-iotests/034
218e99
+++ b/tests/qemu-iotests/034
218e99
@@ -49,63 +49,63 @@ echo
218e99
 echo "== creating backing file for COW tests =="
218e99
 
218e99
 _make_test_img $size
218e99
-$QEMU_IO -c "write -P 0x55 0 1M" $TEST_IMG | _filter_qemu_io
218e99
-mv $TEST_IMG $TEST_IMG.base
218e99
+$QEMU_IO -c "write -P 0x55 0 1M" "$TEST_IMG" | _filter_qemu_io
218e99
+mv "$TEST_IMG" "$TEST_IMG.base"
218e99
 
218e99
-_make_test_img -b $TEST_IMG.base 6G
218e99
+_make_test_img -b "$TEST_IMG.base" 6G
218e99
 
218e99
 echo
218e99
 echo "== zero write with backing file =="
218e99
-$QEMU_IO -c "write -z 64k 192k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -z 513k 13k" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -z 64k 192k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -z 513k 13k" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 _check_test_img
218e99
 
218e99
 echo
218e99
 echo "== verifying patterns (3) =="
218e99
-$QEMU_IO -c "read -P 0x55 0 64k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x0 64k 192k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x55 256k 257k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x0 513k 13k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x55 526k 498k" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x55 0 64k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x0 64k 192k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x55 256k 257k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x0 513k 13k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x55 526k 498k" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== overwriting zero cluster =="
218e99
-$QEMU_IO -c "write -P 0xa 60k 8k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -P 0xb 64k 8k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -P 0xc 76k 4k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -P 0xd 252k 8k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -P 0xe 248k 8k" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0xa 60k 8k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0xb 64k 8k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0xc 76k 4k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0xd 252k 8k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0xe 248k 8k" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 _check_test_img
218e99
 
218e99
 echo
218e99
 echo "== verifying patterns (4) =="
218e99
-$QEMU_IO -c "read -P 0x55 0 60k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0xa 60k 4k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0xb 64k 8k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x0 72k 4k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0xc 76k 4k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x0 80k 168k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0xe 248k 8k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0xd 256k 4k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x55 260k 64k" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x55 0 60k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0xa 60k 4k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0xb 64k 8k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x0 72k 4k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0xc 76k 4k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x0 80k 168k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0xe 248k 8k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0xd 256k 4k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x55 260k 64k" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== re-zeroing overwritten area =="
218e99
-$QEMU_IO -c "write -z 64k 192k" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -z 64k 192k" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 _check_test_img
218e99
 
218e99
 echo
218e99
 echo "== verifying patterns (5) =="
218e99
-$QEMU_IO -c "read -P 0x55 0 60k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0xa 60k 4k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x0 64k 192k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0xd 256k 4k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x55 260k 253k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x0 513k 13k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x55 526k 498k" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x55 0 60k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0xa 60k 4k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x0 64k 192k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0xd 256k 4k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x55 260k 253k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x0 513k 13k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x55 526k 498k" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # success, all done
218e99
 echo "*** done"
218e99
diff --git a/tests/qemu-iotests/035 b/tests/qemu-iotests/035
218e99
index 9d2d347..ebe9b8c 100755
218e99
--- a/tests/qemu-iotests/035
218e99
+++ b/tests/qemu-iotests/035
218e99
@@ -59,7 +59,7 @@ function generate_requests() {
218e99
     done
218e99
 }
218e99
 
218e99
-generate_requests | $QEMU_IO $TEST_IMG | _filter_qemu_io |\
218e99
+generate_requests | $QEMU_IO "$TEST_IMG" | _filter_qemu_io |\
218e99
 	sed -e 's/bytes at offset [0-9]*/bytes at offset XXX/g'
218e99
 
218e99
 echo
218e99
diff --git a/tests/qemu-iotests/036 b/tests/qemu-iotests/036
218e99
index 4dbfc57..e049a64 100755
218e99
--- a/tests/qemu-iotests/036
218e99
+++ b/tests/qemu-iotests/036
218e99
@@ -53,15 +53,15 @@ IMGOPTS="compat=1.1"
218e99
 echo === Create image with unknown autoclear feature bit ===
218e99
 echo
218e99
 _make_test_img 64M
218e99
-./qcow2.py $TEST_IMG set-feature-bit autoclear 63
218e99
-./qcow2.py $TEST_IMG dump-header
218e99
+./qcow2.py "$TEST_IMG" set-feature-bit autoclear 63
218e99
+./qcow2.py "$TEST_IMG" dump-header
218e99
 
218e99
 echo
218e99
 echo === Repair image ===
218e99
 echo
218e99
 _check_test_img -r all
218e99
 
218e99
-./qcow2.py $TEST_IMG dump-header
218e99
+./qcow2.py "$TEST_IMG" dump-header
218e99
 
218e99
 # success, all done
218e99
 echo "*** done"
218e99
diff --git a/tests/qemu-iotests/037 b/tests/qemu-iotests/037
218e99
index c11460b..743bae3 100755
218e99
--- a/tests/qemu-iotests/037
218e99
+++ b/tests/qemu-iotests/037
218e99
@@ -66,50 +66,50 @@ function backing_io()
218e99
     done
218e99
 }
218e99
 
218e99
-backing_io 0 256 write | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
+backing_io 0 256 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
-mv $TEST_IMG $TEST_IMG.base
218e99
+mv "$TEST_IMG" "$TEST_IMG.base"
218e99
 
218e99
-_make_test_img -b $TEST_IMG.base 6G
218e99
+_make_test_img -b "$TEST_IMG.base" 6G
218e99
 
218e99
 echo
218e99
 echo "== COW in a single cluster =="
218e99
-$QEMU_IO -c "write -P 0x77 0 2k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -P 0x88 6k 2k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -P 0x99 9k 2k" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0x77 0 2k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0x88 6k 2k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0x99 9k 2k" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
-$QEMU_IO -c "read -P 0x77 0 2k" $TEST_IMG | _filter_qemu_io
218e99
-backing_io $((2 * 1024)) 8 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x88 6k 2k" $TEST_IMG | _filter_qemu_io
218e99
-backing_io $((8 * 1024)) 2 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x99 9k 2k" $TEST_IMG | _filter_qemu_io
218e99
-backing_io $((11 * 1024)) 2 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x77 0 2k" "$TEST_IMG" | _filter_qemu_io
218e99
+backing_io $((2 * 1024)) 8 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x88 6k 2k" "$TEST_IMG" | _filter_qemu_io
218e99
+backing_io $((8 * 1024)) 2 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x99 9k 2k" "$TEST_IMG" | _filter_qemu_io
218e99
+backing_io $((11 * 1024)) 2 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== COW in two-cluster allocations =="
218e99
-$QEMU_IO -c "write -P 0x77 16k 6k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -P 0x88 26k 6k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -P 0x99 33k 5k" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0x77 16k 6k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0x88 26k 6k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0x99 33k 5k" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
-$QEMU_IO -c "read -P 0x77 16k 6k" $TEST_IMG | _filter_qemu_io
218e99
-backing_io $((22 * 1024)) 8 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x88 26k 6k" $TEST_IMG | _filter_qemu_io
218e99
-backing_io $((32 * 1024)) 2 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x99 33k 5k" $TEST_IMG | _filter_qemu_io
218e99
-backing_io $((38 * 1024)) 4 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x77 16k 6k" "$TEST_IMG" | _filter_qemu_io
218e99
+backing_io $((22 * 1024)) 8 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x88 26k 6k" "$TEST_IMG" | _filter_qemu_io
218e99
+backing_io $((32 * 1024)) 2 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x99 33k 5k" "$TEST_IMG" | _filter_qemu_io
218e99
+backing_io $((38 * 1024)) 4 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== COW in multi-cluster allocations =="
218e99
-$QEMU_IO -c "write -P 0x77 48k 15k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -P 0x88 66k 14k" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "write -P 0x99 83k 15k" $TEST_IMG | _filter_qemu_io
218e99
-
218e99
-$QEMU_IO -c "read -P 0x77 48k 15k" $TEST_IMG | _filter_qemu_io
218e99
-backing_io $((63 * 1024)) 6 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x88 66k 14k" $TEST_IMG | _filter_qemu_io
218e99
-backing_io $((80 * 1024)) 6 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0x99 83k 15k" $TEST_IMG | _filter_qemu_io
218e99
-backing_io $((98 * 1024)) 4 read | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0x77 48k 15k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0x88 66k 14k" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0x99 83k 15k" "$TEST_IMG" | _filter_qemu_io
218e99
+
218e99
+$QEMU_IO -c "read -P 0x77 48k 15k" "$TEST_IMG" | _filter_qemu_io
218e99
+backing_io $((63 * 1024)) 6 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x88 66k 14k" "$TEST_IMG" | _filter_qemu_io
218e99
+backing_io $((80 * 1024)) 6 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x99 83k 15k" "$TEST_IMG" | _filter_qemu_io
218e99
+backing_io $((98 * 1024)) 4 read | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 _check_test_img
218e99
 
218e99
diff --git a/tests/qemu-iotests/038 b/tests/qemu-iotests/038
218e99
index 90de1a7..7bb7906 100755
218e99
--- a/tests/qemu-iotests/038
218e99
+++ b/tests/qemu-iotests/038
218e99
@@ -66,11 +66,11 @@ function backing_io()
218e99
     done
218e99
 }
218e99
 
218e99
-backing_io 0 256 write | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
+backing_io 0 256 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
-mv $TEST_IMG $TEST_IMG.base
218e99
+mv "$TEST_IMG" "$TEST_IMG.base"
218e99
 
218e99
-_make_test_img -b $TEST_IMG.base 6G
218e99
+_make_test_img -b "$TEST_IMG.base" 6G
218e99
 
218e99
 echo
218e99
 echo "== Some concurrent requests touching the same cluster =="
218e99
@@ -94,7 +94,7 @@ function overlay_io()
218e99
     echo aio_write -P 0x90 4080k 80k
218e99
 }
218e99
 
218e99
-overlay_io | $QEMU_IO $TEST_IMG | _filter_qemu_io |\
218e99
+overlay_io | $QEMU_IO "$TEST_IMG" | _filter_qemu_io |\
218e99
     sed -e 's/bytes at offset [0-9]*/bytes at offset XXX/g' \
218e99
     -e 's/qemu-io> //g' | paste - - | sort | tr '\t' '\n'
218e99
 
218e99
@@ -124,7 +124,7 @@ function verify_io()
218e99
     done
218e99
 }
218e99
 
218e99
-verify_io | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
+verify_io | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 _check_test_img
218e99
 
218e99
diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
218e99
index ae35175..f85b4ce 100755
218e99
--- a/tests/qemu-iotests/039
218e99
+++ b/tests/qemu-iotests/039
218e99
@@ -54,10 +54,10 @@ echo "== Checking that image is clean on shutdown =="
218e99
 IMGOPTS="compat=1.1,lazy_refcounts=on"
218e99
 _make_test_img $size
218e99
 
218e99
-$QEMU_IO -c "write -P 0x5a 0 512" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0x5a 0 512" ""$TEST_IMG"" | _filter_qemu_io
218e99
 
218e99
 # The dirty bit must not be set
218e99
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
218e99
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
218e99
 _check_test_img
218e99
 
218e99
 echo
218e99
@@ -68,20 +68,20 @@ _make_test_img $size
218e99
 
218e99
 old_ulimit=$(ulimit -c)
218e99
 ulimit -c 0 # do not produce a core dump on abort(3)
218e99
-$QEMU_IO -c "write -P 0x5a 0 512" -c "abort" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0x5a 0 512" -c "abort" "$TEST_IMG" | _filter_qemu_io
218e99
 ulimit -c "$old_ulimit"
218e99
 
218e99
 # The dirty bit must be set
218e99
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
218e99
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
218e99
 _check_test_img
218e99
 
218e99
 echo
218e99
 echo "== Read-only access must still work =="
218e99
 
218e99
-$QEMU_IO -r -c "read -P 0x5a 0 512" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -r -c "read -P 0x5a 0 512" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # The dirty bit must be set
218e99
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
218e99
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
218e99
 
218e99
 echo
218e99
 echo "== Repairing the image file must succeed =="
218e99
@@ -89,12 +89,12 @@ echo "== Repairing the image file must succeed =="
218e99
 _check_test_img -r all
218e99
 
218e99
 # The dirty bit must not be set
218e99
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
218e99
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
218e99
 
218e99
 echo
218e99
 echo "== Data should still be accessible after repair =="
218e99
 
218e99
-$QEMU_IO -c "read -P 0x5a 0 512" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0x5a 0 512" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== Opening a dirty image read/write should repair it =="
218e99
@@ -104,16 +104,16 @@ _make_test_img $size
218e99
 
218e99
 old_ulimit=$(ulimit -c)
218e99
 ulimit -c 0 # do not produce a core dump on abort(3)
218e99
-$QEMU_IO -c "write -P 0x5a 0 512" -c "abort" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0x5a 0 512" -c "abort" "$TEST_IMG" | _filter_qemu_io
218e99
 ulimit -c "$old_ulimit"
218e99
 
218e99
 # The dirty bit must be set
218e99
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
218e99
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
218e99
 
218e99
-$QEMU_IO -c "write 0 512" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write 0 512" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # The dirty bit must not be set
218e99
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
218e99
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
218e99
 
218e99
 echo
218e99
 echo "== Creating an image file with lazy_refcounts=off =="
218e99
@@ -123,11 +123,11 @@ _make_test_img $size
218e99
 
218e99
 old_ulimit=$(ulimit -c)
218e99
 ulimit -c 0 # do not produce a core dump on abort(3)
218e99
-$QEMU_IO -c "write -P 0x5a 0 512" -c "abort" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "write -P 0x5a 0 512" -c "abort" "$TEST_IMG" | _filter_qemu_io
218e99
 ulimit -c "$old_ulimit"
218e99
 
218e99
 # The dirty bit must not be set since lazy_refcounts=off
218e99
-./qcow2.py $TEST_IMG dump-header | grep incompatible_features
218e99
+./qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
218e99
 _check_test_img
218e99
 
218e99
 # success, all done
218e99
diff --git a/tests/qemu-iotests/042 b/tests/qemu-iotests/042
218e99
index 16b2fdb..94ce3a9 100755
218e99
--- a/tests/qemu-iotests/042
218e99
+++ b/tests/qemu-iotests/042
218e99
@@ -48,27 +48,27 @@ echo "== Creating zero size image =="
218e99
 _make_test_img 0
218e99
 _check_test_img
218e99
 
218e99
-mv $TEST_IMG $TEST_IMG.orig
218e99
+mv "$TEST_IMG" "$TEST_IMG.orig"
218e99
 
218e99
 echo
218e99
 echo "== Converting the image =="
218e99
 
218e99
-$QEMU_IMG convert -O $IMGFMT $TEST_IMG.orig $TEST_IMG
218e99
+$QEMU_IMG convert -O $IMGFMT "$TEST_IMG.orig" "$TEST_IMG"
218e99
 _check_test_img
218e99
 
218e99
 echo
218e99
 echo "== Converting the image, compressed =="
218e99
 
218e99
 if [ "$IMGFMT" == "qcow2" ]; then
218e99
-    $QEMU_IMG convert -c -O $IMGFMT $TEST_IMG.orig $TEST_IMG
218e99
+    $QEMU_IMG convert -c -O $IMGFMT "$TEST_IMG.orig" "$TEST_IMG"
218e99
 fi
218e99
 _check_test_img
218e99
 
218e99
 echo
218e99
 echo "== Rebasing the image =="
218e99
 
218e99
-$QEMU_IMG rebase -u -b $TEST_IMG.orig $TEST_IMG
218e99
-$QEMU_IMG rebase -b $TEST_IMG.orig $TEST_IMG
218e99
+$QEMU_IMG rebase -u -b "$TEST_IMG.orig" "$TEST_IMG"
218e99
+$QEMU_IMG rebase -b "$TEST_IMG.orig" "$TEST_IMG"
218e99
 _check_test_img
218e99
 
218e99
 # success, all done
218e99
diff --git a/tests/qemu-iotests/043 b/tests/qemu-iotests/043
218e99
index 478773d..d7f1231 100755
218e99
--- a/tests/qemu-iotests/043
218e99
+++ b/tests/qemu-iotests/043
218e99
@@ -31,7 +31,7 @@ status=1	# failure is the default!
218e99
 _cleanup()
218e99
 {
218e99
     _cleanup_test_img
218e99
-    rm -f $TEST_IMG.[123].base
218e99
+    rm -f "$TEST_IMG".[123].base
218e99
 }
218e99
 trap "_cleanup; exit \$status" 0 1 2 3 15
218e99
 
218e99
@@ -47,39 +47,39 @@ _supported_os Linux
218e99
 
218e99
 size=128M
218e99
 _make_test_img $size
218e99
-$QEMU_IMG rebase -u -b $TEST_IMG $TEST_IMG
218e99
+$QEMU_IMG rebase -u -b "$TEST_IMG" "$TEST_IMG"
218e99
 
218e99
 echo
218e99
 echo "== backing file references self =="
218e99
 _img_info --backing-chain
218e99
 
218e99
 _make_test_img $size
218e99
-mv $TEST_IMG $TEST_IMG.base
218e99
-_make_test_img -b $TEST_IMG.base $size
218e99
-$QEMU_IMG rebase -u -b $TEST_IMG $TEST_IMG.base
218e99
+mv "$TEST_IMG" "$TEST_IMG.base"
218e99
+_make_test_img -b "$TEST_IMG.base" $size
218e99
+$QEMU_IMG rebase -u -b "$TEST_IMG" "$TEST_IMG.base"
218e99
 
218e99
 echo
218e99
 echo "== parent references self =="
218e99
 _img_info --backing-chain
218e99
 
218e99
 _make_test_img $size
218e99
-mv $TEST_IMG $TEST_IMG.1.base
218e99
-_make_test_img -b $TEST_IMG.1.base $size
218e99
-mv $TEST_IMG $TEST_IMG.2.base
218e99
-_make_test_img -b $TEST_IMG.2.base $size
218e99
-mv $TEST_IMG $TEST_IMG.3.base
218e99
-_make_test_img -b $TEST_IMG.3.base $size
218e99
-$QEMU_IMG rebase -u -b $TEST_IMG.2.base $TEST_IMG.1.base
218e99
+mv "$TEST_IMG" "$TEST_IMG.1.base"
218e99
+_make_test_img -b "$TEST_IMG.1.base" $size
218e99
+mv "$TEST_IMG" "$TEST_IMG.2.base"
218e99
+_make_test_img -b "$TEST_IMG.2.base" $size
218e99
+mv "$TEST_IMG" "$TEST_IMG.3.base"
218e99
+_make_test_img -b "$TEST_IMG.3.base" $size
218e99
+$QEMU_IMG rebase -u -b "$TEST_IMG.2.base" "$TEST_IMG.1.base"
218e99
 
218e99
 echo
218e99
 echo "== ancestor references another ancestor =="
218e99
 _img_info --backing-chain
218e99
 
218e99
 _make_test_img $size
218e99
-mv $TEST_IMG $TEST_IMG.1.base
218e99
-_make_test_img -b $TEST_IMG.1.base $size
218e99
-mv $TEST_IMG $TEST_IMG.2.base
218e99
-_make_test_img -b $TEST_IMG.2.base $size
218e99
+mv "$TEST_IMG" "$TEST_IMG.1.base"
218e99
+_make_test_img -b "$TEST_IMG.1.base" $size
218e99
+mv "$TEST_IMG" "$TEST_IMG.2.base"
218e99
+_make_test_img -b "$TEST_IMG.2.base" $size
218e99
 
218e99
 echo
218e99
 echo "== finite chain of length 3 (human) =="
218e99
diff --git a/tests/qemu-iotests/046 b/tests/qemu-iotests/046
218e99
index 987bfff..3f17ceb 100755
218e99
--- a/tests/qemu-iotests/046
218e99
+++ b/tests/qemu-iotests/046
218e99
@@ -66,11 +66,11 @@ function backing_io()
218e99
     done
218e99
 }
218e99
 
218e99
-backing_io 0 32 write | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
+backing_io 0 32 write | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
-mv $TEST_IMG $TEST_IMG.base
218e99
+mv "$TEST_IMG" "$TEST_IMG.base"
218e99
 
218e99
-_make_test_img -b $TEST_IMG.base 6G
218e99
+_make_test_img -b "$TEST_IMG.base" 6G
218e99
 
218e99
 echo
218e99
 echo "== Some concurrent requests touching the same cluster =="
218e99
@@ -185,7 +185,7 @@ aio_flush
218e99
 EOF
218e99
 }
218e99
 
218e99
-overlay_io | $QEMU_IO blkdebug::$TEST_IMG | _filter_qemu_io |\
218e99
+overlay_io | $QEMU_IO blkdebug::"$TEST_IMG" | _filter_qemu_io |\
218e99
 	sed -e 's/bytes at offset [0-9]*/bytes at offset XXX/g'
218e99
 
218e99
 echo
218e99
@@ -252,7 +252,7 @@ function verify_io()
218e99
     echo read -P 17  0x11c000 0x4000
218e99
 }
218e99
 
218e99
-verify_io | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
+verify_io | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 _check_test_img
218e99
 
218e99
diff --git a/tests/qemu-iotests/047 b/tests/qemu-iotests/047
218e99
index 0cf36b4..c35cd09 100755
218e99
--- a/tests/qemu-iotests/047
218e99
+++ b/tests/qemu-iotests/047
218e99
@@ -66,7 +66,7 @@ read -P 0x55 1M 128k
218e99
 EOF
218e99
 }
218e99
 
218e99
-qemu_io_cmds | $QEMU_IO $TEST_IMG | _filter_qemu_io
218e99
+qemu_io_cmds | $QEMU_IO "$TEST_IMG" | _filter_qemu_io
218e99
 _check_test_img
218e99
 
218e99
 # success, all done
218e99
diff --git a/tests/qemu-iotests/048 b/tests/qemu-iotests/048
218e99
index 7cce049..9b9d118 100755
218e99
--- a/tests/qemu-iotests/048
218e99
+++ b/tests/qemu-iotests/048
218e99
@@ -31,13 +31,13 @@ _cleanup()
218e99
 {
218e99
     echo "Cleanup"
218e99
     _cleanup_test_img
218e99
-    rm ${TEST_IMG2}
218e99
+    rm "${TEST_IMG2}"
218e99
 }
218e99
 trap "_cleanup; exit \$status" 0 1 2 3 15
218e99
 
218e99
 _compare()
218e99
 {
218e99
-    $QEMU_IMG compare "$@" $TEST_IMG ${TEST_IMG2}
218e99
+    $QEMU_IMG compare "$@" "$TEST_IMG" "${TEST_IMG2}"
218e99
     echo $?
218e99
 }
218e99
 
218e99
@@ -59,12 +59,12 @@ _make_test_img $size
218e99
 io_pattern write 524288 $CLUSTER_SIZE $CLUSTER_SIZE 4 45
218e99
 
218e99
 # Compare identical images
218e99
-cp $TEST_IMG ${TEST_IMG2}
218e99
+cp "$TEST_IMG" "${TEST_IMG2}"
218e99
 _compare
218e99
 _compare -q
218e99
 
218e99
 # Compare images with different size
218e99
-$QEMU_IMG resize $TEST_IMG +512M
218e99
+$QEMU_IMG resize "$TEST_IMG" +512M
218e99
 _compare
218e99
 _compare -s
218e99
 
218e99
diff --git a/tests/qemu-iotests/049 b/tests/qemu-iotests/049
218e99
index 6c6017e..93aa0ea 100755
218e99
--- a/tests/qemu-iotests/049
218e99
+++ b/tests/qemu-iotests/049
218e99
@@ -63,13 +63,13 @@ sizes+="1024.0 1024.0b 1.5k 1.5K 1.5M 1.5G 1.5T"
218e99
 echo "== 1. Traditional size parameter =="
218e99
 echo
218e99
 for s in $sizes; do
218e99
-    test_qemu_img create -f $IMGFMT $TEST_IMG $s
218e99
+    test_qemu_img create -f $IMGFMT "$TEST_IMG" $s
218e99
 done
218e99
 
218e99
 echo "== 2. Specifying size via -o =="
218e99
 echo
218e99
 for s in $sizes; do
218e99
-    test_qemu_img create -f $IMGFMT -o size=$s $TEST_IMG
218e99
+    test_qemu_img create -f $IMGFMT -o size=$s "$TEST_IMG"
218e99
 done
218e99
 
218e99
 echo "== 3. Invalid sizes =="
218e99
@@ -77,8 +77,8 @@ echo
218e99
 sizes="-1024 -1k 1kilobyte foobar"
218e99
 
218e99
 for s in $sizes; do
218e99
-    test_qemu_img create -f $IMGFMT $TEST_IMG -- $s
218e99
-    test_qemu_img create -f $IMGFMT -o size=$s $TEST_IMG
218e99
+    test_qemu_img create -f $IMGFMT "$TEST_IMG" -- $s
218e99
+    test_qemu_img create -f $IMGFMT -o size=$s "$TEST_IMG"
218e99
 done
218e99
 
218e99
 echo "== Check correct interpretation of suffixes for cluster size =="
218e99
@@ -87,35 +87,35 @@ sizes="1024 1024b 1k 1K 1M "
218e99
 sizes+="1024.0 1024.0b 0.5k 0.5K 0.5M"
218e99
 
218e99
 for s in $sizes; do
218e99
-    test_qemu_img create -f $IMGFMT -o cluster_size=$s $TEST_IMG 64M
218e99
+    test_qemu_img create -f $IMGFMT -o cluster_size=$s "$TEST_IMG" 64M
218e99
 done
218e99
 
218e99
 echo "== Check compat level option =="
218e99
 echo
218e99
-test_qemu_img create -f $IMGFMT -o compat=0.10 $TEST_IMG 64M
218e99
-test_qemu_img create -f $IMGFMT -o compat=1.1 $TEST_IMG 64M
218e99
+test_qemu_img create -f $IMGFMT -o compat=0.10 "$TEST_IMG" 64M
218e99
+test_qemu_img create -f $IMGFMT -o compat=1.1 "$TEST_IMG" 64M
218e99
 
218e99
-test_qemu_img create -f $IMGFMT -o compat=0.42 $TEST_IMG 64M
218e99
-test_qemu_img create -f $IMGFMT -o compat=foobar $TEST_IMG 64M
218e99
+test_qemu_img create -f $IMGFMT -o compat=0.42 "$TEST_IMG" 64M
218e99
+test_qemu_img create -f $IMGFMT -o compat=foobar "$TEST_IMG" 64M
218e99
 
218e99
 echo "== Check preallocation option =="
218e99
 echo
218e99
-test_qemu_img create -f $IMGFMT -o preallocation=off $TEST_IMG 64M
218e99
-test_qemu_img create -f $IMGFMT -o preallocation=metadata $TEST_IMG 64M
218e99
-test_qemu_img create -f $IMGFMT -o preallocation=1234 $TEST_IMG 64M
218e99
+test_qemu_img create -f $IMGFMT -o preallocation=off "$TEST_IMG" 64M
218e99
+test_qemu_img create -f $IMGFMT -o preallocation=metadata "$TEST_IMG" 64M
218e99
+test_qemu_img create -f $IMGFMT -o preallocation=1234 "$TEST_IMG" 64M
218e99
 
218e99
 echo "== Check encryption option =="
218e99
 echo
218e99
-test_qemu_img create -f $IMGFMT -o encryption=off $TEST_IMG 64M
218e99
-test_qemu_img create -f $IMGFMT -o encryption=on $TEST_IMG 64M
218e99
+test_qemu_img create -f $IMGFMT -o encryption=off "$TEST_IMG" 64M
218e99
+test_qemu_img create -f $IMGFMT -o encryption=on "$TEST_IMG" 64M
218e99
 
218e99
 echo "== Check lazy_refcounts option (only with v3) =="
218e99
 echo
218e99
-test_qemu_img create -f $IMGFMT -o compat=1.1,lazy_refcounts=off $TEST_IMG 64M
218e99
-test_qemu_img create -f $IMGFMT -o compat=1.1,lazy_refcounts=on $TEST_IMG 64M
218e99
+test_qemu_img create -f $IMGFMT -o compat=1.1,lazy_refcounts=off "$TEST_IMG" 64M
218e99
+test_qemu_img create -f $IMGFMT -o compat=1.1,lazy_refcounts=on "$TEST_IMG" 64M
218e99
 
218e99
-test_qemu_img create -f $IMGFMT -o compat=0.10,lazy_refcounts=off $TEST_IMG 64M
218e99
-test_qemu_img create -f $IMGFMT -o compat=0.10,lazy_refcounts=on $TEST_IMG 64M
218e99
+test_qemu_img create -f $IMGFMT -o compat=0.10,lazy_refcounts=off "$TEST_IMG" 64M
218e99
+test_qemu_img create -f $IMGFMT -o compat=0.10,lazy_refcounts=on "$TEST_IMG" 64M
218e99
 
218e99
 # success, all done
218e99
 echo "*** done"
218e99
diff --git a/tests/qemu-iotests/050 b/tests/qemu-iotests/050
218e99
index 05793e2..07802bc 100755
218e99
--- a/tests/qemu-iotests/050
218e99
+++ b/tests/qemu-iotests/050
218e99
@@ -31,8 +31,8 @@ status=1	# failure is the default!
218e99
 _cleanup()
218e99
 {
218e99
     _cleanup_test_img
218e99
-    rm -f $TEST_IMG.old
218e99
-    rm -f $TEST_IMG.new
218e99
+    rm -f "$TEST_IMG.old"
218e99
+    rm -f "$TEST_IMG.new"
218e99
 }
218e99
 trap "_cleanup; exit \$status" 0 1 2 3 15
218e99
 
218e99
@@ -53,21 +53,21 @@ echo "== Creating images =="
218e99
 
218e99
 size=10M
218e99
 _make_test_img $size
218e99
-$QEMU_IO -c "write -P 0x40 0 1048576" $TEST_IMG | _filter_qemu_io
218e99
-mv $TEST_IMG $TEST_IMG.old
218e99
+$QEMU_IO -c "write -P 0x40 0 1048576" "$TEST_IMG" | _filter_qemu_io
218e99
+mv "$TEST_IMG" "$TEST_IMG.old"
218e99
 
218e99
 _make_test_img $size
218e99
-$QEMU_IO -c "write -P 0x5a 0 1048576" $TEST_IMG | _filter_qemu_io
218e99
-mv $TEST_IMG $TEST_IMG.new
218e99
+$QEMU_IO -c "write -P 0x5a 0 1048576" "$TEST_IMG" | _filter_qemu_io
218e99
+mv "$TEST_IMG" "$TEST_IMG.new"
218e99
 
218e99
-_make_test_img -b $TEST_IMG.old $size
218e99
-$QEMU_IO -c "write -z 0 1048576" $TEST_IMG | _filter_qemu_io
218e99
+_make_test_img -b "$TEST_IMG.old" $size
218e99
+$QEMU_IO -c "write -z 0 1048576" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== Rebasing the image =="
218e99
 
218e99
-$QEMU_IMG rebase -b $TEST_IMG.new $TEST_IMG
218e99
-$QEMU_IO -c "read -P 0x00 0 1048576" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IMG rebase -b "$TEST_IMG.new" "$TEST_IMG"
218e99
+$QEMU_IO -c "read -P 0x00 0 1048576" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # success, all done
218e99
 echo "*** done"
218e99
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
218e99
index 93a2797..b8775b6 100755
218e99
--- a/tests/qemu-iotests/051
218e99
+++ b/tests/qemu-iotests/051
218e99
@@ -62,21 +62,21 @@ echo
218e99
 echo === Unknown option ===
218e99
 echo
218e99
 
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,unknown_opt=
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,unknown_opt=on
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,unknown_opt=1234
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,unknown_opt=foo
218e99
+run_qemu -drive file="$TEST_IMG",format=qcow2,unknown_opt=
218e99
+run_qemu -drive file="$TEST_IMG",format=qcow2,unknown_opt=on
218e99
+run_qemu -drive file="$TEST_IMG",format=qcow2,unknown_opt=1234
218e99
+run_qemu -drive file="$TEST_IMG",format=qcow2,unknown_opt=foo
218e99
 
218e99
 
218e99
 echo
218e99
 echo === Enable and disable lazy refcounting on the command line, plus some invalid values ===
218e99
 echo
218e99
 
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=on
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=off
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=42
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=foo
218e99
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=on
218e99
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=off
218e99
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=
218e99
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=42
218e99
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=foo
218e99
 
218e99
 
218e99
 echo
218e99
@@ -85,8 +85,8 @@ echo
218e99
 
218e99
 _make_test_img -ocompat=0.10 $size
218e99
 
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=on
218e99
-run_qemu -drive file=$TEST_IMG,format=qcow2,lazy-refcounts=off
218e99
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=on
218e99
+run_qemu -drive file="$TEST_IMG",format=qcow2,lazy-refcounts=off
218e99
 
218e99
 echo
218e99
 echo === No medium ===
218e99
@@ -112,21 +112,21 @@ echo
218e99
 echo === Read-only ===
218e99
 echo
218e99
 
218e99
-run_qemu -drive file=$TEST_IMG,if=floppy,readonly=on
218e99
-run_qemu -drive file=$TEST_IMG,if=ide,media=cdrom,readonly=on
218e99
-#run_qemu -drive file=$TEST_IMG,if=scsi,media=cdrom,readonly=on
218e99
+run_qemu -drive file="$TEST_IMG",if=floppy,readonly=on
218e99
+run_qemu -drive file="$TEST_IMG",if=ide,media=cdrom,readonly=on
218e99
+#run_qemu -drive file="$TEST_IMG",if=scsi,media=cdrom,readonly=on
218e99
 
218e99
-run_qemu -drive file=$TEST_IMG,if=ide,readonly=on
218e99
-run_qemu -drive file=$TEST_IMG,if=virtio,readonly=on
218e99
-#run_qemu -drive file=$TEST_IMG,if=scsi,readonly=on
218e99
+run_qemu -drive file="$TEST_IMG",if=ide,readonly=on
218e99
+run_qemu -drive file="$TEST_IMG",if=virtio,readonly=on
218e99
+#run_qemu -drive file="$TEST_IMG",if=scsi,readonly=on
218e99
 
218e99
-run_qemu -drive file=$TEST_IMG,if=none,id=disk,readonly=on -device ide-cd,drive=disk
218e99
-#run_qemu -drive file=$TEST_IMG,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
218e99
+run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-cd,drive=disk
218e99
+#run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk
218e99
 
218e99
-run_qemu -drive file=$TEST_IMG,if=none,id=disk,readonly=on -device ide-drive,drive=disk
218e99
-run_qemu -drive file=$TEST_IMG,if=none,id=disk,readonly=on -device ide-hd,drive=disk
218e99
-#run_qemu -drive file=$TEST_IMG,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
218e99
-#run_qemu -drive file=$TEST_IMG,if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
218e99
+run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-drive,drive=disk
218e99
+run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-hd,drive=disk
218e99
+#run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-disk,drive=disk
218e99
+#run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk
218e99
 
218e99
 echo
218e99
 echo === Cache modes ===
218e99
@@ -146,8 +146,8 @@ echo
218e99
 echo === Specifying the protocol layer ===
218e99
 echo
218e99
 
218e99
-run_qemu -drive file=$TEST_IMG,file.driver=file
218e99
-run_qemu -drive file=$TEST_IMG,file.driver=qcow2
218e99
+run_qemu -drive file="$TEST_IMG",file.driver=file
218e99
+run_qemu -drive file="$TEST_IMG",file.driver=qcow2
218e99
 
218e99
 echo
218e99
 echo === Parsing protocol from file name ===
218e99
diff --git a/tests/qemu-iotests/052 b/tests/qemu-iotests/052
218e99
index 14a5126..f955b69 100755
218e99
--- a/tests/qemu-iotests/052
218e99
+++ b/tests/qemu-iotests/052
218e99
@@ -48,12 +48,12 @@ _make_test_img $size
218e99
 
218e99
 echo
218e99
 echo "== reading whole image =="
218e99
-$QEMU_IO -s -c "read 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -s -c "read 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 echo
218e99
 echo "== writing whole image does not modify image =="
218e99
-$QEMU_IO -s -c "write -P 0xa 0 $size" $TEST_IMG | _filter_qemu_io
218e99
-$QEMU_IO -c "read -P 0 0 $size" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -s -c "write -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P 0 0 $size" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # success, all done
218e99
 echo "*** done"
218e99
diff --git a/tests/qemu-iotests/053 b/tests/qemu-iotests/053
218e99
index bc56992..e589e5f 100755
218e99
--- a/tests/qemu-iotests/053
218e99
+++ b/tests/qemu-iotests/053
218e99
@@ -30,7 +30,7 @@ status=1	# failure is the default!
218e99
 
218e99
 _cleanup()
218e99
 {
218e99
-	rm -f $TEST_IMG.orig
218e99
+	rm -f "$TEST_IMG.orig"
218e99
 	_cleanup_test_img
218e99
 }
218e99
 trap "_cleanup; exit \$status" 0 1 2 3 15
218e99
@@ -47,13 +47,13 @@ echo
218e99
 echo "== Creating single sector image =="
218e99
 
218e99
 _make_test_img 512
218e99
-$QEMU_IO -c "write -P0xa 0 512" $TEST_IMG | _filter_qemu_io
218e99
-mv $TEST_IMG $TEST_IMG.orig
218e99
+$QEMU_IO -c "write -P0xa 0 512" "$TEST_IMG" | _filter_qemu_io
218e99
+mv "$TEST_IMG" "$TEST_IMG.orig"
218e99
 
218e99
 echo
218e99
 echo "== Converting the image, compressed =="
218e99
 
218e99
-$QEMU_IMG convert -c -O $IMGFMT $TEST_IMG.orig $TEST_IMG
218e99
+$QEMU_IMG convert -c -O $IMGFMT "$TEST_IMG.orig" "$TEST_IMG"
218e99
 _check_test_img
218e99
 
218e99
 echo
218e99
@@ -64,7 +64,7 @@ _img_info | grep '^virtual size:'
218e99
 echo
218e99
 echo "== Verifying the compressed image =="
218e99
 
218e99
-$QEMU_IO -c "read -P0xa 0 512" $TEST_IMG | _filter_qemu_io
218e99
+$QEMU_IO -c "read -P0xa 0 512" "$TEST_IMG" | _filter_qemu_io
218e99
 
218e99
 # success, all done
218e99
 echo "*** done"
218e99
diff --git a/tests/qemu-iotests/054 b/tests/qemu-iotests/054
218e99
index b360429..5a0d1b1 100755
218e99
--- a/tests/qemu-iotests/054
218e99
+++ b/tests/qemu-iotests/054
218e99
@@ -49,7 +49,7 @@ _make_test_img $((1024*1024))T
218e99
 echo
218e99
 echo "creating too large image (1 EB) using qcow2.py"
218e99
 _make_test_img 4G
218e99
-./qcow2.py $TEST_IMG set-header size $((1024 ** 6))
218e99
+./qcow2.py "$TEST_IMG" set-header size $((1024 ** 6))
218e99
 _check_test_img
218e99
 
218e99
 # success, all done
218e99
diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059
218e99
index d2b3f9e..dd6addf 100755
218e99
--- a/tests/qemu-iotests/059
218e99
+++ b/tests/qemu-iotests/059
218e99
@@ -51,20 +51,20 @@ echo "=== Testing invalid granularity ==="
218e99
 echo
218e99
 _make_test_img 64M
218e99
 poke_file "$TEST_IMG" "$granularity_offset" "\xff\xff\xff\xff\xff\xff\xff\xff"
218e99
-{ $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
218e99
+{ $QEMU_IO -c "read 0 512" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
218e99
 
218e99
 echo "=== Testing too big L2 table size ==="
218e99
 echo
218e99
 _make_test_img 64M
218e99
 poke_file "$TEST_IMG" "$grain_table_size_offset" "\xff\xff\xff\xff"
218e99
-{ $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
218e99
+{ $QEMU_IO -c "read 0 512" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
218e99
 
218e99
 echo "=== Testing too big L1 table size ==="
218e99
 echo
218e99
 _make_test_img 64M
218e99
 poke_file "$TEST_IMG" "$capacity_offset" "\xff\xff\xff\xff"
218e99
 poke_file "$TEST_IMG" "$grain_table_size_offset" "\x01\x00\x00\x00"
218e99
-{ $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
218e99
+{ $QEMU_IO -c "read 0 512" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
218e99
 
218e99
 echo "=== Testing monolithicFlat creation and opening ==="
218e99
 echo
218e99
diff --git a/tests/qemu-iotests/063 b/tests/qemu-iotests/063
218e99
index de0cbbd..2ab8f20 100644
218e99
--- a/tests/qemu-iotests/063
218e99
+++ b/tests/qemu-iotests/063
218e99
@@ -32,7 +32,7 @@ status=1	# failure is the default!
218e99
 _cleanup()
218e99
 {
218e99
 	_cleanup_test_img
218e99
-	rm -f $TEST_IMG.orig $TEST_IMG.raw $TEST_IMG.raw2
218e99
+	rm -f "$TEST_IMG.orig" "$TEST_IMG.raw" "$TEST_IMG.raw2"
218e99
 }
218e99
 trap "_cleanup; exit \$status" 0 1 2 3 15
218e99
 
218e99
@@ -49,47 +49,47 @@ _make_test_img 4M
218e99
 
218e99
 echo "== Testing conversion with -n fails with no target file =="
218e99
 # check .orig file does not exist
218e99
-rm -f $TEST_IMG.orig
218e99
-if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n $TEST_IMG $TEST_IMG.orig >/dev/null 2>&1; then
218e99
+rm -f "$TEST_IMG.orig"
218e99
+if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG.orig" >/dev/null 2>&1; then
218e99
     exit 1
218e99
 fi
218e99
 
218e99
 echo "== Testing conversion with -n succeeds with a target file =="
218e99
-rm -f $TEST_IMG.orig
218e99
-cp $TEST_IMG $TEST_IMG.orig
218e99
-if ! $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n $TEST_IMG $TEST_IMG.orig ; then
218e99
+rm -f "$TEST_IMG.orig"
218e99
+cp "$TEST_IMG" "$TEST_IMG.orig"
218e99
+if ! $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG.orig" ; then
218e99
     exit 1
218e99
 fi
218e99
 
218e99
 echo "== Testing conversion to raw is the same after conversion with -n =="
218e99
 # compare the raw files
218e99
-if ! $QEMU_IMG convert -f $IMGFMT -O raw $TEST_IMG $TEST_IMG.raw1 ; then
218e99
+if ! $QEMU_IMG convert -f $IMGFMT -O raw "$TEST_IMG" "$TEST_IMG.raw1" ; then
218e99
     exit 1
218e99
 fi
218e99
 
218e99
-if ! $QEMU_IMG convert -f $IMGFMT -O raw $TEST_IMG.orig $TEST_IMG.raw2 ; then
218e99
+if ! $QEMU_IMG convert -f $IMGFMT -O raw "$TEST_IMG.orig" "$TEST_IMG.raw2" ; then
218e99
     exit 1
218e99
 fi
218e99
 
218e99
-if ! cmp $TEST_IMG.raw1 $TEST_IMG.raw2 ; then
218e99
+if ! cmp "$TEST_IMG.raw1" "$TEST_IMG.raw2" ; then
218e99
     exit 1
218e99
 fi
218e99
 
218e99
 echo "== Testing conversion back to original format =="
218e99
-if ! $QEMU_IMG convert -f raw -O $IMGFMT -n $TEST_IMG.raw2 $TEST_IMG ; then
218e99
+if ! $QEMU_IMG convert -f raw -O $IMGFMT -n "$TEST_IMG.raw2" "$TEST_IMG" ; then
218e99
     exit 1
218e99
 fi
218e99
 _check_test_img
218e99
 
218e99
 echo "== Testing conversion to a smaller file fails =="
218e99
-rm -f $TEST_IMG.orig
218e99
-mv $TEST_IMG $TEST_IMG.orig
218e99
+rm -f "$TEST_IMG.orig"
218e99
+mv "$TEST_IMG" "$TEST_IMG.orig"
218e99
 _make_test_img 2M
218e99
-if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n $TEST_IMG.orig $TEST_IMG >/dev/null 2>&1; then
218e99
+if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG.orig" "$TEST_IMG" >/dev/null 2>&1; then
218e99
     exit 1
218e99
 fi
218e99
 
218e99
-rm -f $TEST_IMG.orig $TEST_IMG.raw $TEST_IMG.raw2
218e99
+rm -f "$TEST_IMG.orig" "$TEST_IMG.raw" "$TEST_IMG.raw2"
218e99
 
218e99
 echo "*** done"
218e99
 rm -f $seq.full
218e99
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
218e99
index 6730955..1b22db0 100644
218e99
--- a/tests/qemu-iotests/common.rc
218e99
+++ b/tests/qemu-iotests/common.rc
218e99
@@ -164,12 +164,12 @@ _cleanup_test_img()
218e99
 
218e99
         nbd)
218e99
             kill $QEMU_NBD_PID
218e99
-            rm -f $TEST_IMG_FILE
218e99
+            rm -f "$TEST_IMG_FILE"
218e99
             ;;
218e99
         file)
218e99
-            rm -f $TEST_DIR/t.$IMGFMT
218e99
-            rm -f $TEST_DIR/t.$IMGFMT.orig
218e99
-            rm -f $TEST_DIR/t.$IMGFMT.base
218e99
+            rm -f "$TEST_DIR/t.$IMGFMT"
218e99
+            rm -f "$TEST_DIR/t.$IMGFMT.orig"
218e99
+            rm -f "$TEST_DIR/t.$IMGFMT.base"
218e99
             if [ -n "$SAMPLE_IMG_FILE" ]
218e99
             then
218e99
                 rm -f "$TEST_DIR/$SAMPLE_IMG_FILE"
218e99
@@ -177,11 +177,11 @@ _cleanup_test_img()
218e99
             ;;
218e99
 
218e99
         rbd)
218e99
-            rbd rm $TEST_DIR/t.$IMGFMT > /dev/null
218e99
+            rbd rm "$TEST_DIR/t.$IMGFMT" > /dev/null
218e99
             ;;
218e99
 
218e99
         sheepdog)
218e99
-            collie vdi delete $TEST_DIR/t.$IMGFMT
218e99
+            collie vdi delete "$TEST_DIR/t.$IMGFMT"
218e99
             ;;
218e99
 
218e99
     esac
218e99
@@ -189,7 +189,7 @@ _cleanup_test_img()
218e99
 
218e99
 _check_test_img()
218e99
 {
218e99
-    $QEMU_IMG check "$@" -f $IMGFMT $TEST_IMG 2>&1 | _filter_testdir | \
218e99
+    $QEMU_IMG check "$@" -f $IMGFMT "$TEST_IMG" 2>&1 | _filter_testdir | \
218e99
         sed -e '/allocated.*fragmented.*compressed clusters/d' \
218e99
             -e 's/qemu-img: This image format does not support checks/No errors were found on the image./' \
218e99
             -e '/Image end offset: [0-9]\+/d'
218e99
@@ -197,7 +197,7 @@ _check_test_img()
218e99
 
218e99
 _img_info()
218e99
 {
218e99
-    $QEMU_IMG info "$@" $TEST_IMG 2>&1 | \
218e99
+    $QEMU_IMG info "$@" "$TEST_IMG" 2>&1 | \
218e99
         sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
218e99
             -e "s#$TEST_DIR#TEST_DIR#g" \
218e99
             -e "s#$IMGFMT#IMGFMT#g" \
218e99
-- 
218e99
1.7.1
218e99