On 02/21/2014 08:24 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf <kw...@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 <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature