From: Eric Blake <eblake@redhat.com>
To: Jeff Cody <jcody@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, stefanha@redhat.com
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 [thread overview]
Message-ID: <527283EE.8030909@redhat.com> (raw)
In-Reply-To: <bcac145ff9aadc8fc239d610fc5ff363b547cd8a.1383231037.git.jcody@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]
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 <jcody@redhat.com>
> ---
> tests/qemu-iotests/common.rc | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
next prev parent reply other threads:[~2013-10-31 16:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-31 15:57 [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Jeff Cody
2013-10-31 15:57 ` [Qemu-devel] [PATCH 1/7] block: qemu-iotests, add quotes to $TEST_IMG usage io pattern tests Jeff Cody
2013-10-31 16:23 ` Eric Blake
2013-10-31 15:57 ` [Qemu-devel] [PATCH 2/7] block: qemu-iotests, fix _make_test_img() to work with spaced pathnames Jeff Cody
2013-10-31 16:23 ` Eric Blake [this message]
2013-10-31 15:57 ` [Qemu-devel] [PATCH 3/7] block: qemu-iotests, add quotes to $TEST_IMG.base usage in 017 Jeff Cody
2013-10-31 16:25 ` Eric Blake
2013-10-31 15:57 ` [Qemu-devel] [PATCH 4/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 019 Jeff Cody
2013-10-31 17:00 ` Eric Blake
2013-10-31 15:57 ` [Qemu-devel] [PATCH 5/7] block: qemu-iotests, removes duplicate double quotes in 039 Jeff Cody
2013-10-31 16:27 ` Eric Blake
2013-10-31 15:57 ` [Qemu-devel] [PATCH 6/7] block: qemu-iotests, add quotes to $TEST_IMG usage for 051 Jeff Cody
2013-10-31 17:03 ` Eric Blake
2013-10-31 15:57 ` [Qemu-devel] [PATCH 7/7] block: qemu-iotests, add quotes to $TEST_IMG usage in 061 Jeff Cody
2013-10-31 16:29 ` Eric Blake
2013-11-05 14:48 ` [Qemu-devel] [PATCH 0/7] block: qemu-iotests, more quoting fixes Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=527283EE.8030909@redhat.com \
--to=eblake@redhat.com \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.