[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/7] block: qemu-iotests, fix _make_test_img() t
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 2/7] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames |
Date: |
Thu, 31 Oct 2013 10:23:10 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 |
On 10/31/2013 09:57 AM, Jeff Cody wrote:
> _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>
> ---
> tests/qemu-iotests/common.rc | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
Reviewed-by: Eric Blake <address@hidden>
As a slight optimization, you could avoid a subshell:
> # 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
> + ) | \
$QEMU_IMG create -f $IMGFMT $extra_img_options \
${backing_file:+-b "$backing_file"} "$img_name" $image_size 2>&1 |
But as not everyone is a shell guru to recognize the ${var+:expansion}
trick, I'm fine with the version you proposed.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes, Jeff Cody, 2013/10/31
- [Qemu-devel] [PATCH 1/7] block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests, Jeff Cody, 2013/10/31
- [Qemu-devel] [PATCH 2/7] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames, Jeff Cody, 2013/10/31
- Re: [Qemu-devel] [PATCH 2/7] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames,
Eric Blake <=
- [Qemu-devel] [PATCH 3/7] block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017, Jeff Cody, 2013/10/31
- [Qemu-devel] [PATCH 4/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 019, Jeff Cody, 2013/10/31
- [Qemu-devel] [PATCH 5/7] block: qemu-iotests, removes duplicate double quotes in 039, Jeff Cody, 2013/10/31
- [Qemu-devel] [PATCH 6/7] block: qemu-iotests, add quotes to $TEST_IMG usage for 051, Jeff Cody, 2013/10/31
- [Qemu-devel] [PATCH 7/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 061, Jeff Cody, 2013/10/31