[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 6/6] qemu-iotests: Check qemu-img command lin
From: |
Eric Blake |
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 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 02/21/2014 08:24 AM, Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> +
> +# 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 <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v3 1/6] qemu-option: has_help_option() and is_valid_option_list(), (continued)
[Qemu-devel] [PATCH v3 2/6] qemu-img create: Support multiple -o options, Kevin Wolf, 2014/02/21
[Qemu-devel] [PATCH v3 3/6] qemu-img convert: Support multiple -o options, Kevin Wolf, 2014/02/21
[Qemu-devel] [PATCH v3 4/6] qemu-img amend: Support multiple -o options, Kevin Wolf, 2014/02/21
[Qemu-devel] [PATCH v3 5/6] qemu-img: Allow -o help with incomplete argument list, Kevin Wolf, 2014/02/21
[Qemu-devel] [PATCH v3 6/6] qemu-iotests: Check qemu-img command line parsing, Kevin Wolf, 2014/02/21
- Re: [Qemu-devel] [PATCH v3 6/6] qemu-iotests: Check qemu-img command line parsing,
Eric Blake <=
Re: [Qemu-devel] [PATCH v3 0/6] qemu-img: Support multiple -o options, Jeff Cody, 2014/02/21