From: John Snow <jsnow@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] qemu-img convert: Deprecate using -n and -o together
Date: Thu, 15 Aug 2019 11:47:14 -0400 [thread overview]
Message-ID: <e7962845-e16b-437b-e418-2eb7df603a2f@redhat.com> (raw)
In-Reply-To: <20190815110623.13646-1-kwolf@redhat.com>
On 8/15/19 7:06 AM, Kevin Wolf wrote:
> bdrv_create options specified with -o have no effect when skipping image
> creation with -n, so this doesn't make sense. Warn against the misuse
> and deprecate the combination so we can make it a hard error later.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>
> - Hopefully removed the "finger-wagging" that John saw, without stating
> that the combination doesn't have a well-defined behaviour (because
> skipping image creation and therefore ignoring -o is well-defined
> behaviour).
>
I'm sorry if that critique was in itself a finger-wag :( I'm not always
the best with tone in written language myself.
Arguably this is supposed to be my primary language, too.
> qemu-img.c | 5 +++++
> qemu-deprecated.texi | 7 +++++++
> 2 files changed, 12 insertions(+)
>
> diff --git a/qemu-img.c b/qemu-img.c
> index 79983772de..d9321f6418 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -2231,6 +2231,11 @@ static int img_convert(int argc, char **argv)
> goto fail_getopt;
> }
>
> + if (skip_create && options) {
> + warn_report("-o has no effect when skipping image creation");
> + warn_report("This will become an error in future QEMU versions.");
> + }
> +
> s.src_num = argc - optind - 1;
> out_filename = s.src_num >= 1 ? argv[argc - 1] : NULL;
>
> diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
> index fff07bb2a3..f7680c08e1 100644
> --- a/qemu-deprecated.texi
> +++ b/qemu-deprecated.texi
> @@ -305,6 +305,13 @@ to just export the entire image and then mount only /dev/nbd0p1 than
> it is to reinvoke @command{qemu-nbd -c /dev/nbd0} limited to just a
> subset of the image.
>
> +@subsection qemu-img convert -n -o (since 4.2.0)
> +
> +All options specified in @option{-o} are image creation options, so
> +they have no effect when used with @option{-n} to skip image creation.
> +Silently ignored options can be confusing, so this combination of
> +options will be made an error in future versions.
> +
> @section Build system
>
> @subsection Python 2 support (since 4.1.0)
>
I do think this reads more pleasantly, though, so thank you very much
for that!
Reviewed-by: John Snow <jsnow@redhat.com>
prev parent reply other threads:[~2019-08-15 15:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-15 11:06 [Qemu-devel] [PATCH v2] qemu-img convert: Deprecate using -n and -o together Kevin Wolf
2019-08-15 12:31 ` Max Reitz
2019-08-15 14:55 ` Eric Blake
2019-08-15 15:47 ` John Snow [this message]
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=e7962845-e16b-437b-e418-2eb7df603a2f@redhat.com \
--to=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@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.