[PATCH v4 00/27] refresh qemu-img options handling

Michael Tokarev posted 27 patches 5 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250531171609.197078-1-mjt@tls.msk.ru
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
docs/tools/qemu-img.rst    |   18 +-
qemu-img-cmds.hx           |    4 +-
qemu-img.c                 | 1782 +++++++++++++++++++++---------------
tests/qemu-iotests/049.out |    9 +-
4 files changed, 1082 insertions(+), 731 deletions(-)
[PATCH v4 00/27] refresh qemu-img options handling
Posted by Michael Tokarev 5 months, 2 weeks ago
This is another iteration of this patch series, which tries
to add missing command-line options, --help output, make it
all more or less consistent, etc.

I addressed (hopefully) all comments so far, mostly by Kevin.
I ended up (so far) with a bit different wording somewhere.

The manpage (and the separate documentation) hasn't changed
much, but I intend to use the same wording there as in --help
output.   An example of the separate documentation change is
provided with "create" subcommand only, as a PoC.

I tried to rename a few existing options to make them more
consistent.  This is an RFC, so to say, - I'd love to make
more changes but it isn't really possible because the names
I want to use are already used for different purpose.  All
such changes (3 in total) are marked with "(short option change)"
suffix in the patch subject.  In particular, I tried to use
-b for backing-file, and -B for backing-format, in all places.
Maybe it's too late to change that though.

All subcommands now have --object option.  I wonder why we
haven't done it in common place, before a subcommand.  Maybe
it's a good idea (and I think it is) to add it to the common
(before-subcomman) place, document it there, and remove the
--object mentions from individual commands --help output.

Thanks,

/mjt

Michael Tokarev (27):
  qemu-img: measure: convert img_size to signed, simplify handling
  qemu-img: create: convert img_size to signed, simplify handling
  qemu-img: global option processing and error printing
  qemu-img: pass current cmd info into command handlers
  qemu-img: create: refresh options/--help (short option change)
  qemu-img: factor out parse_output_format() and use it in the code
  qemu-img: check: refresh options/--help
  qemu-img: simplify --repair error message
  qemu-img: commit: refresh options/--help
  qemu-img: compare: use helper function for --object
  qemu-img: compare: refresh options/--help
  qemu-img: convert: refresh options/--help (short option change)
  qemu-img: info: refresh options/--help
  qemu-img: map: refresh options/--help
  qemu-img: snapshot: allow specifying -f fmt
  qemu-img: snapshot: make -l (list) the default, simplify option handling
  qemu-img: snapshot: refresh options/--help
  qemu-img: rebase: refresh options/--help (short option change)
  qemu-img: resize: do not always eat last argument
  qemu-img: resize: refresh options/--help
  qemu-img: amend: refresh options/--help
  qemu-img: bench: refresh options/--help
  qemu-img: bitmap: refresh options/--help
  qemu-img: dd: refresh options/--help
  qemu-img: measure: refresh options/--help
  qemu-img: implement short --help, remove global help() function
  qemu-img: extend cvtnum() and use it in more places

 docs/tools/qemu-img.rst    |   18 +-
 qemu-img-cmds.hx           |    4 +-
 qemu-img.c                 | 1782 +++++++++++++++++++++---------------
 tests/qemu-iotests/049.out |    9 +-
 4 files changed, 1082 insertions(+), 731 deletions(-)

-- 
2.39.5
Re: [PATCH v4 00/27] refresh qemu-img options handling
Posted by Michael Tokarev 4 months, 3 weeks ago
Ping once again?

Please let's move with this one.  Either it should be accepted,
maybe with some tweaks, or dropped entirely.  There's enough
silence already - it's been there for over 2 years.

Thanks,

/mjt

On 31.05.2025 20:15, Michael Tokarev wrote:
> This is another iteration of this patch series, which tries
> to add missing command-line options, --help output, make it
> all more or less consistent, etc.
> 
> I addressed (hopefully) all comments so far, mostly by Kevin.
> I ended up (so far) with a bit different wording somewhere.
> 
> The manpage (and the separate documentation) hasn't changed
> much, but I intend to use the same wording there as in --help
> output.   An example of the separate documentation change is
> provided with "create" subcommand only, as a PoC.
> 
> I tried to rename a few existing options to make them more
> consistent.  This is an RFC, so to say, - I'd love to make
> more changes but it isn't really possible because the names
> I want to use are already used for different purpose.  All
> such changes (3 in total) are marked with "(short option change)"
> suffix in the patch subject.  In particular, I tried to use
> -b for backing-file, and -B for backing-format, in all places.
> Maybe it's too late to change that though.
> 
> All subcommands now have --object option.  I wonder why we
> haven't done it in common place, before a subcommand.  Maybe
> it's a good idea (and I think it is) to add it to the common
> (before-subcomman) place, document it there, and remove the
> --object mentions from individual commands --help output.
> 
> Thanks,
> 
> /mjt
> 
> Michael Tokarev (27):
>    qemu-img: measure: convert img_size to signed, simplify handling
>    qemu-img: create: convert img_size to signed, simplify handling
>    qemu-img: global option processing and error printing
>    qemu-img: pass current cmd info into command handlers
>    qemu-img: create: refresh options/--help (short option change)
>    qemu-img: factor out parse_output_format() and use it in the code
>    qemu-img: check: refresh options/--help
>    qemu-img: simplify --repair error message
>    qemu-img: commit: refresh options/--help
>    qemu-img: compare: use helper function for --object
>    qemu-img: compare: refresh options/--help
>    qemu-img: convert: refresh options/--help (short option change)
>    qemu-img: info: refresh options/--help
>    qemu-img: map: refresh options/--help
>    qemu-img: snapshot: allow specifying -f fmt
>    qemu-img: snapshot: make -l (list) the default, simplify option handling
>    qemu-img: snapshot: refresh options/--help
>    qemu-img: rebase: refresh options/--help (short option change)
>    qemu-img: resize: do not always eat last argument
>    qemu-img: resize: refresh options/--help
>    qemu-img: amend: refresh options/--help
>    qemu-img: bench: refresh options/--help
>    qemu-img: bitmap: refresh options/--help
>    qemu-img: dd: refresh options/--help
>    qemu-img: measure: refresh options/--help
>    qemu-img: implement short --help, remove global help() function
>    qemu-img: extend cvtnum() and use it in more places
> 
>   docs/tools/qemu-img.rst    |   18 +-
>   qemu-img-cmds.hx           |    4 +-
>   qemu-img.c                 | 1782 +++++++++++++++++++++---------------
>   tests/qemu-iotests/049.out |    9 +-
>   4 files changed, 1082 insertions(+), 731 deletions(-)
>
Re: [PATCH v4 00/27] refresh qemu-img options handling
Posted by Kevin Wolf 4 months ago
Am 31.05.2025 um 19:15 hat Michael Tokarev geschrieben:
> This is another iteration of this patch series, which tries
> to add missing command-line options, --help output, make it
> all more or less consistent, etc.
> 
> I addressed (hopefully) all comments so far, mostly by Kevin.
> I ended up (so far) with a bit different wording somewhere.

Thanks, I tweaked the wording and style a little bit here and there,
fixed some qemu-iotests and applied it to the block branch.

Kevin
Re: [PATCH v4 00/27] refresh qemu-img options handling
Posted by Michael Tokarev 4 months ago
On 15.07.2025 21:42, Kevin Wolf wrote:
> Am 31.05.2025 um 19:15 hat Michael Tokarev geschrieben:
>> This is another iteration of this patch series, which tries
>> to add missing command-line options, --help output, make it
>> all more or less consistent, etc.
>>
>> I addressed (hopefully) all comments so far, mostly by Kevin.
>> I ended up (so far) with a bit different wording somewhere.
> 
> Thanks, I tweaked the wording and style a little bit here and there,
> fixed some qemu-iotests and applied it to the block branch.

Thank you very much Kevin.  It was.. long :)

I'm not sure I follow - which iotests did you have to tweak?
It shouldn't affect iotests, maybe only if we have some stuff
testing for --help or invalid options?

Thanks,

/mjt
Re: [PATCH v4 00/27] refresh qemu-img options handling
Posted by Kevin Wolf 4 months ago
Am 17.07.2025 um 10:27 hat Michael Tokarev geschrieben:
> On 15.07.2025 21:42, Kevin Wolf wrote:
> > Am 31.05.2025 um 19:15 hat Michael Tokarev geschrieben:
> > > This is another iteration of this patch series, which tries
> > > to add missing command-line options, --help output, make it
> > > all more or less consistent, etc.
> > > 
> > > I addressed (hopefully) all comments so far, mostly by Kevin.
> > > I ended up (so far) with a bit different wording somewhere.
> > 
> > Thanks, I tweaked the wording and style a little bit here and there,
> > fixed some qemu-iotests and applied it to the block branch.
> 
> Thank you very much Kevin.  It was.. long :)
> 
> I'm not sure I follow - which iotests did you have to tweak?
> It shouldn't affect iotests, maybe only if we have some stuff
> testing for --help or invalid options?

Yes, there were some changed error messages for invalid options that
appeared in reference output.

Kevin