All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Cody <jcody@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com,
	benoit@irqsave.net
Subject: Re: [Qemu-devel] [PATCH v2 4/5] block: qemu-iotests - fix image cleanup when using spaced pathnames
Date: Thu, 10 Apr 2014 08:53:56 -0400	[thread overview]
Message-ID: <20140410125356.GD4859@localhost.localdomain> (raw)
In-Reply-To: <20140410075357.GF22890@T430.nay.redhat.com>

On Thu, Apr 10, 2014 at 03:53:57PM +0800, Fam Zheng wrote:
> On Wed, 04/09 22:41, Jeff Cody wrote:
> > The _rm_test_img() function in common.rc did not quote the image
> > file, which left droppings in the scratch directory (and performed
> > a potentially unsafe rm -f).
> > 
> > This adds the necessary quotes.
> > 
> > Signed-off-by: Jeff Cody <jcody@redhat.com>
> > ---
> >  tests/qemu-iotests/common.rc | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
> > index 7f00883..195c564 100644
> > --- a/tests/qemu-iotests/common.rc
> > +++ b/tests/qemu-iotests/common.rc
> > @@ -178,10 +178,10 @@ _rm_test_img()
> >      local img=$1
> 
> Since we are quoting $img, should we quote $1 as well?
>

I believe not, because variable assignment won't undergo all the shell
expansions.  Notably, in variable assignment word splitting is not
performed on the parameter expansion on the argument immediately to the
right of the '='.  Quote removal, however, will still be performed.  So
img=$1 and img="$1" are identical once processed.

> 
> >      if [ "$IMGFMT" = "vmdk" ]; then
> >          # Remove all the extents for vmdk
> > -        $QEMU_IMG info $img 2>/dev/null | grep 'filename:' | cut -f 2 -d: \
> > +        "$QEMU_IMG" info "$img" 2>/dev/null | grep 'filename:' | cut -f 2 -d: \
> >              | xargs -I {} rm -f "{}"
> >      fi
> > -    rm -f $img
> > +    rm -f "$img"
> >  }
> >  
> >  _cleanup_test_img()
> > -- 
> > 1.8.3.1
> > 
> > 

  reply	other threads:[~2014-04-10 12:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10  2:41 [Qemu-devel] [PATCH v2 0/5] Add common QEMU control functionality to qemu-iotests Jeff Cody
2014-04-10  2:41 ` [Qemu-devel] [PATCH v2 1/5] block: qemu-iotests - add common.qemu, for bash-controlled qemu tests Jeff Cody
2014-04-10  5:27   ` Fam Zheng
2014-04-10 19:07     ` Jeff Cody
2014-04-10  2:41 ` [Qemu-devel] [PATCH v2 2/5] block: qemu-iotests - update 085 to use common.qemu Jeff Cody
2014-04-10  6:10   ` Fam Zheng
2014-04-10 19:28     ` Jeff Cody
2014-04-10  2:41 ` [Qemu-devel] [PATCH v2 3/5] block: qemu-iotests - test for live migration Jeff Cody
2014-04-10  6:16   ` Fam Zheng
2014-04-10 11:10     ` Jeff Cody
2014-04-10  2:41 ` [Qemu-devel] [PATCH v2 4/5] block: qemu-iotests - fix image cleanup when using spaced pathnames Jeff Cody
2014-04-10  7:53   ` Fam Zheng
2014-04-10 12:53     ` Jeff Cody [this message]
2014-04-10 14:43       ` Eric Blake
2014-04-10 14:48         ` Eric Blake
2014-04-10 18:09           ` Jeff Cody
2014-04-11  0:59             ` Fam Zheng
2014-04-10  2:41 ` [Qemu-devel] [PATCH v2 5/5] block: qemu-iotests: make test 019 and 086 work with " Jeff Cody
2014-04-10  7:51   ` Fam Zheng

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=20140410125356.GD4859@localhost.localdomain \
    --to=jcody@redhat.com \
    --cc=benoit@irqsave.net \
    --cc=famz@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.