qemu-devel
[Top][All Lists]
Advanced

[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



Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]