All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
	John Snow <jsnow@redhat.com>, Eric Blake <eblake@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>
Subject: [Qemu-devel] [PATCH v2 0/7] qemu-img: Improve option help for amend
Date: Wed,  9 May 2018 23:00:16 +0200	[thread overview]
Message-ID: <20180509210023.20283-1-mreitz@redhat.com> (raw)

[Unchanged text from v1 ahead]

Currently, "qemu-img amend -f $format -o help" prints many things which
it claims to be supported, but most of the time it's wrong.  Usually
that starts with the format already: No format but qcow2 supports option
amendment, so we should never claim that a format supports any options
when it actually does not support amendment in the first place.

It goes on with the options themselves.  The qcow2 driver does not
support amendment of all creation options, so we should not claim it
does.  Actually knowing which formats are supported exactly would be a
bit difficult (this would probably involve adding a field to
QemuOptDesc, and I don't really want to do that), but what we can do
instead is to at least advise the user that the options we print are all
of the creation options and that we might not support amending all of
them.

There is a Bugzilla for this here:
https://bugzilla.redhat.com/show_bug.cgi?id=1537956

On the way to address these issues, there is more to be done, though.
bdrv_amend_options() does not have an Error parameter yet, and there is
no real excuse for that.

Also, "qemu-img create -o help" has its own little issue with formats
that do not support creation:

    $ qemu-img create -f bochs -o help
    Supported options:
    qemu-img: util/qemu-option.c:219:
    qemu_opts_print_help: Assertion `list' failed.
    [1]    24831 abort (core dumped)  qemu-img create -f bochs -o help

Let's fix that, too.


v2:
- Patch 2: [Eric]
  - Use error_setg_errno() where possible
  - Use assertions instead of error messages where that makes sense
  - Rephrase an error message since we're already touching it


git-backport-diff against v1:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/7:[----] [--] 'qemu-img: Amendment support implies create_opts'
002/7:[0042] [FC] 'block: Add Error parameter to bdrv_amend_options'
003/7:[----] [--] 'qemu-option: Pull out "Supported options" print'
004/7:[----] [--] 'qemu-img: Add print_amend_option_help()'
005/7:[----] [--] 'qemu-img: Recognize no creation support in -o help'
006/7:[----] [--] 'iotests: Test help option for unsupporting formats'
007/7:[----] [--] 'iotests: Rework 113'


Max Reitz (7):
  qemu-img: Amendment support implies create_opts
  block: Add Error parameter to bdrv_amend_options
  qemu-option: Pull out "Supported options" print
  qemu-img: Add print_amend_option_help()
  qemu-img: Recognize no creation support in -o help
  iotests: Test help option for unsupporting formats
  iotests: Rework 113

 include/block/block.h      |  3 +-
 include/block/block_int.h  |  3 +-
 block.c                    |  8 ++++--
 block/qcow2.c              | 72 ++++++++++++++++++++++++++--------------------
 qemu-img.c                 | 52 +++++++++++++++++++++++++++++----
 util/qemu-option.c         |  1 -
 tests/qemu-iotests/060.out |  4 +--
 tests/qemu-iotests/061.out |  7 -----
 tests/qemu-iotests/080.out |  4 +--
 tests/qemu-iotests/082     |  9 ++++++
 tests/qemu-iotests/082.out | 53 +++++++++++++++++++++++-----------
 tests/qemu-iotests/112.out |  3 --
 tests/qemu-iotests/113     | 19 ++++++------
 tests/qemu-iotests/113.out |  7 +++--
 14 files changed, 159 insertions(+), 86 deletions(-)

-- 
2.14.3

             reply	other threads:[~2018-05-09 21:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 21:00 Max Reitz [this message]
2018-05-09 21:00 ` [Qemu-devel] [PATCH v2 1/7] qemu-img: Amendment support implies create_opts Max Reitz
2018-05-09 21:00 ` [Qemu-devel] [PATCH v2 2/7] block: Add Error parameter to bdrv_amend_options Max Reitz
2018-05-09 21:20   ` Eric Blake
2018-05-09 22:57   ` John Snow
2018-05-09 21:00 ` [Qemu-devel] [PATCH v2 3/7] qemu-option: Pull out "Supported options" print Max Reitz
2018-05-09 21:00 ` [Qemu-devel] [PATCH v2 4/7] qemu-img: Add print_amend_option_help() Max Reitz
2018-05-09 21:00 ` [Qemu-devel] [PATCH v2 5/7] qemu-img: Recognize no creation support in -o help Max Reitz
2018-05-09 21:00 ` [Qemu-devel] [PATCH v2 6/7] iotests: Test help option for unsupporting formats Max Reitz
2018-05-09 21:00 ` [Qemu-devel] [PATCH v2 7/7] iotests: Rework 113 Max Reitz
2018-06-01 11:06 ` [Qemu-devel] [PATCH v2 0/7] qemu-img: Improve option help for amend Max Reitz

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=20180509210023.20283-1-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --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.