Re: [Qemu-devel] [PATCH 0/7] qemu-img: Fix handling of multiply specified options

2014-02-20 Thread Kevin Wolf
Am 20.02.2014 um 08:18 hat Markus Armbruster geschrieben:
 Kevin Wolf kw...@redhat.com writes:
 
  If you specify the same option more than once (e.g. -o cluster_size=4k
  -o lazy_refcounts=on), qemu-img silently ignores all but the last one. This
 
 Sounds like perfectly common behavior to me.

I guess it depends on the kind of option. For -o it's no less surprising
than 'gcc -Wall -Werror' giving you only -Werror without -Wall.

  series fixes it to either consider all options or to give an error message.
 
 Doesn't this break usage like Compiled-in default is no good for me,
 create wrapper script setting my defaults followed by $@, then
 override them on command line?

It does. Would you be happy with a series that accumulates -o options
(like this one does) and leaves the other options alone?

Kevin



Re: [Qemu-devel] [PATCH 0/7] qemu-img: Fix handling of multiply specified options

2014-02-20 Thread Markus Armbruster
Kevin Wolf kw...@redhat.com writes:

 Am 20.02.2014 um 08:18 hat Markus Armbruster geschrieben:
 Kevin Wolf kw...@redhat.com writes:
 
  If you specify the same option more than once (e.g. -o cluster_size=4k
  -o lazy_refcounts=on), qemu-img silently ignores all but the last one. This
 
 Sounds like perfectly common behavior to me.

 I guess it depends on the kind of option. For -o it's no less surprising
 than 'gcc -Wall -Werror' giving you only -Werror without -Wall.

I agree that multiple -OPT KEY=VALUE,... accumulating is nicer than the
last one wiping out its predecessors.

  series fixes it to either consider all options or to give an error message.
 
 Doesn't this break usage like Compiled-in default is no good for me,
 create wrapper script setting my defaults followed by $@, then
 override them on command line?

 It does. Would you be happy with a series that accumulates -o options
 (like this one does) and leaves the other options alone?

No objections.



[Qemu-devel] [PATCH 0/7] qemu-img: Fix handling of multiply specified options

2014-02-19 Thread Kevin Wolf
If you specify the same option more than once (e.g. -o cluster_size=4k
-o lazy_refcounts=on), qemu-img silently ignores all but the last one. This
series fixes it to either consider all options or to give an error message.

Boolean option can still be given more than once as they aren't problematic
in this respect (ten times -q is still quiet).

Kevin Wolf (7):
  qemu-img create: Detect options specified more than once
  qemu-img convert: Detect options specified more than once
  qemu-img amend: Detect options specified more than once
  qemu-img: Detect options specified more than once
  qemu-img create: Support multiple -o options
  qemu-img convert: Support multiple -o options
  qemu-img amend: Support multiple -o options

 qemu-img.c | 198 ++---
 1 file changed, 177 insertions(+), 21 deletions(-)

-- 
1.8.1.4




Re: [Qemu-devel] [PATCH 0/7] qemu-img: Fix handling of multiply specified options

2014-02-19 Thread Markus Armbruster
Kevin Wolf kw...@redhat.com writes:

 If you specify the same option more than once (e.g. -o cluster_size=4k
 -o lazy_refcounts=on), qemu-img silently ignores all but the last one. This

Sounds like perfectly common behavior to me.

 series fixes it to either consider all options or to give an error message.

Doesn't this break usage like Compiled-in default is no good for me,
create wrapper script setting my defaults followed by $@, then
override them on command line?

 Boolean option can still be given more than once as they aren't problematic
 in this respect (ten times -q is still quiet).

Unless it's a toggle, but I sure hope we don't have those.