From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [RFC/INCOMPLETE PATCH 0/8] Attempt to make qemu-img options consistent and --help working
Date: Wed, 7 Feb 2024 18:09:19 +0000 [thread overview]
Message-ID: <ZcPHQIt8cz2ZxIvT@redhat.com> (raw)
In-Reply-To: <cover.1707328606.git.mjt@tls.msk.ru>
On Wed, Feb 07, 2024 at 08:58:09PM +0300, Michael Tokarev wrote:
> - create more or less consistent set of options between different
> subcommands
> - provide long options which can be used without figuring out which
> -T/-t, -f|-F|-O etc to use for which of the two images given
> - have qemu-img --help provide just a list of subcommands
> - have qemu-img COMMAND --help to describe just this subcommand
> - get rid of qemu-img-opts.hx, instead finish documentation in
> qemu-img.rst based on the actual options implemented in
> qemu-img.c.
Yes, yes, yes, yes & more yes :-)
I cry every time I have to read the qemu-img --help output,
and I'm not much of a fan of the man page either to be fair,
as I don't like the global list of options at the top which
is divorced from which commands actually use them.
These days I see many programs with subcommands switching to
a separate man page per sub-command. Still, I'm not asking
you todo that too, its just an idea for the gallery.
> I started converting subcommands one by one, providing long options
> and --help output. And immediately faced some questions which needs
> wider discussion.
>
> o We have --image-opts and --target-image-opts. Do we really need both?
> In my view, --image-opts should be sort of global, turning *all*
> filenames on this command line into complete image specifications,
> there's no need to have separate image-opts and --target-image-opts.
> Don't know what to do wrt compatibility though. It shouldn't be made
> this way from the beginning. As a possible solution, introduce a new
> option and deprecate current set.
This is basically a crutch for incomplete conversion of the block
layer APIs, which meant we had a situation where we wanted to use
image opts syntax for the source, but were unable todo so for
the target:
commit 305b4c60f200ee8e6267ac75f3f5b5d09fda1079
Author: Daniel P. Berrangé <berrange@redhat.com>
Date: Mon May 15 17:47:11 2017 +0100
qemu-img: introduce --target-image-opts for 'convert' command
The '--image-opts' flag indicates whether the source filename
includes options. The target filename has to remain in the
plain filename format though, since it needs to be passed to
bdrv_create(). When using --skip-create though, it would be
possible to use image-opts syntax. This adds --target-image-opts
to indicate that the target filename includes options. Currently
this mandates use of the --skip-create flag too.
we do have internal support for creating block devices using
the full QAPI schema, via BlockdevCreateOptions.
I'm not sure if bdrv_create can be made to create using the
image-opts syntax. If it can, there is still the additional
problem that after creation it then needs to re-open the
file, and the image-opts for open is defined by BlockdevOptions
not BlockdevCreateOptions. So we would need a way to convert
from the latter to the former.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2024-02-07 18:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-07 17:58 [RFC/INCOMPLETE PATCH 0/8] Attempt to make qemu-img options consistent and --help working Michael Tokarev
2024-02-07 17:58 ` [PATCH 1/8] qemu-img: pass current cmdname into command handlers Michael Tokarev
2024-02-07 17:58 ` [PATCH 2/8] qemu-img: refresh options/--help for "create" subcommand Michael Tokarev
2024-02-07 17:58 ` [PATCH 3/8] qemu-img: factor out parse_output_format() and use it in the code Michael Tokarev
2024-02-07 17:58 ` [PATCH 4/8] qemu-img: refresh options/--help for "check" command Michael Tokarev
2024-02-07 17:58 ` [PATCH 5/8] qemu-img: simplify --repair error message Michael Tokarev
2024-02-07 17:58 ` [PATCH 6/8] qemu-img: refresh options/--help for "commit" command Michael Tokarev
2024-02-07 17:58 ` [PATCH 7/8] qemu-img: refresh options/--help for "compare" command Michael Tokarev
2024-02-07 17:58 ` [PATCH 8/8] qemu-img: refresh options/--help for "convert" command Michael Tokarev
2024-02-07 18:09 ` Daniel P. Berrangé [this message]
2024-02-07 19:01 ` [RFC/INCOMPLETE PATCH 0/8] Attempt to make qemu-img options consistent and --help working Manos Pitsidianakis
2024-02-07 20:28 ` Michael Tokarev
2024-02-09 10:56 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZcPHQIt8cz2ZxIvT@redhat.com \
--to=berrange@redhat.com \
--cc=mjt@tls.msk.ru \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.