[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 05/37] block: qemu-iotests, fix _make_test_img() t
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL v2 05/37] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames |
Date: |
Fri, 8 Nov 2013 11:11:59 +0100 |
From: Jeff Cody <address@hidden>
_make_test_img() currently works with spaced pathnames only when not
specifying a backing file. This fixes it so that the backing file
argument is properly quoted.
Signed-off-by: Jeff Cody <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
tests/qemu-iotests/common.rc | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 4e82604..d24de2c 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -111,6 +111,8 @@ _make_test_img()
local image_size=$*
local optstr=""
local img_name=""
+ local use_backing=0
+ local backing_file=""
if [ -n "$TEST_IMG_FILE" ]; then
img_name=$TEST_IMG_FILE
@@ -123,7 +125,8 @@ _make_test_img()
fi
if [ "$1" = "-b" ]; then
- extra_img_options="$1 $2"
+ use_backing=1
+ backing_file=$2
image_size=$3
fi
if [ \( "$IMGFMT" = "qcow2" -o "$IMGFMT" = "qed" \) -a -n "$CLUSTER_SIZE"
]; then
@@ -135,7 +138,13 @@ _make_test_img()
fi
# XXX(hch): have global image options?
- $QEMU_IMG create -f $IMGFMT $extra_img_options $img_name $image_size 2>&1
| \
+ (
+ if [ $use_backing = 1 ]; then
+ $QEMU_IMG create -f $IMGFMT $extra_img_options -b "$backing_file"
"$img_name" $image_size 2>&1
+ else
+ $QEMU_IMG create -f $IMGFMT $extra_img_options "$img_name" $image_size
2>&1
+ fi
+ ) | \
sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" \
-e "s#$TEST_DIR#TEST_DIR#g" \
-e "s#$IMGFMT#IMGFMT#g" \
--
1.8.3.1
- [Qemu-devel] [PULL v2 00/37] Block patches, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 01/37] qapi: Fix comment for create-type to match code., Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 04/37] block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 05/37] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL v2 06/37] block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 09/37] block: qemu-iotests, add quotes to $TEST_IMG usage for 051, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 12/37] libqtest: rename qmp() to qmp_discard_response(), Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 13/37] libqtest: add qmp(fmt, ...) -> QDict* function, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 16/37] block: Save errno before error_setg_errno, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 14/37] blockdev-test: add test case for drive_add duplicate IDs, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 17/37] block/vpc: fix virtual size for images created with disk2vhd, Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 18/37] block: vhdx - minor comments and typo correction., Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 20/37] block: vhdx code movement - VHDXMetadataEntries and BDRVVHDXState to header., Stefan Hajnoczi, 2013/11/08
- [Qemu-devel] [PULL v2 24/37] block: vhdx code movement - move vhdx_close() above vhdx_open(), Stefan Hajnoczi, 2013/11/08