All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Cc: jcody@redhat.com, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 6/6] qemu-iotests: Check qemu-img command line parsing
Date: Fri, 21 Feb 2014 13:38:37 -0700	[thread overview]
Message-ID: <5307B94D.9090509@redhat.com> (raw)
In-Reply-To: <1392996248-26781-7-git-send-email-kwolf@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]

On 02/21/2014 08:24 AM, Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---

> +
> +# Try to trick qemu-img into creating escaped commas
> +run_qemu_img amend -f $IMGFMT -o backing_file="$TEST_IMG", -o help "$TEST_IMG"
> +run_qemu_img amend -f $IMGFMT -o backing_file="$TEST_IMG" -o ,help "$TEST_IMG"
> +run_qemu_img amend -f $IMGFMT -o backing_file="$TEST_IMG" -o ,, -o help "$TEST_IMG"

Interesting.  The first two are definitely invalid, but the third is a
case where if -o had an implicit first key name, then ',' would be the
value of that key for the second -o.

Maybe the trick in your patch 1 is to add a bool parameter to
is_valid_option_list() that states whether the option accepts an
implicit first key name: no key name starts with a comma, and leading
comma is valid only if you can have an implicit key name.  In this case,
-o does not have an implicit first key name, so your test proves that
you were right to reject the comma for our current usage.

But again, until we actually have a client of is_valid_option_list that
also cares about implicit first key name, this patch is fine as-is.

Series: Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
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: 604 bytes --]

  reply	other threads:[~2014-02-21 20:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21 15:24 [Qemu-devel] [PATCH v3 0/6] qemu-img: Support multiple -o options Kevin Wolf
2014-02-21 15:24 ` [Qemu-devel] [PATCH v3 1/6] qemu-option: has_help_option() and is_valid_option_list() Kevin Wolf
2014-02-21 20:22   ` Eric Blake
2014-02-21 20:57     ` Kevin Wolf
2014-02-24  8:42       ` Markus Armbruster
2014-02-24  9:42         ` Kevin Wolf
2014-02-21 15:24 ` [Qemu-devel] [PATCH v3 2/6] qemu-img create: Support multiple -o options Kevin Wolf
2014-02-21 15:24 ` [Qemu-devel] [PATCH v3 3/6] qemu-img convert: " Kevin Wolf
2014-03-03 11:43   ` Peter Lieven
2014-03-03 13:08     ` Kevin Wolf
2014-02-21 15:24 ` [Qemu-devel] [PATCH v3 4/6] qemu-img amend: " Kevin Wolf
2014-02-21 15:24 ` [Qemu-devel] [PATCH v3 5/6] qemu-img: Allow -o help with incomplete argument list Kevin Wolf
2014-02-21 15:24 ` [Qemu-devel] [PATCH v3 6/6] qemu-iotests: Check qemu-img command line parsing Kevin Wolf
2014-02-21 20:38   ` Eric Blake [this message]
2014-02-21 19:59 ` [Qemu-devel] [PATCH v3 0/6] qemu-img: Support multiple -o options Jeff Cody

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=5307B94D.9090509@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.