From: Eric Blake <eblake@redhat.com>
To: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>,
"qemu-block@nongnu.org" <qemu-block@nongnu.org>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
Denis Lunev <den@virtuozzo.com>,
"armbru@redhat.com" <armbru@redhat.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"mreitz@redhat.com" <mreitz@redhat.com>
Subject: Re: [PATCH 2/2] qcow2: dump QCOW2 metadata
Date: Mon, 13 Jan 2020 10:16:14 -0600 [thread overview]
Message-ID: <cedf0e08-8994-a892-85dc-bf0dea221163@redhat.com> (raw)
In-Reply-To: <be0bf681-5551-c5ec-e7b3-3589fb230176@virtuozzo.com>
On 1/13/20 4:30 AM, Andrey Shinkevich wrote:
>>> - c = getopt_long(argc, argv, ":hf:r:T:qU",
>>> + c = getopt_long(argc, argv, ":hf:r:T:qU:M",
>>
>> We are already inconsistent, but I tend to add options in alphabetical
>> order, both here...
>>
>
> If I merely move 'M' forward like ':hf:M:r:T:qU', will it be OK?
>
If you don't mind writing a pre-requisite patch that sorts the existing
options, then the patch adding your option in sorted order is easy. But
that's asking you to do extra work, which I'm not going to insist on, so
I can also live with your patch being in any order as it is no worse
than existing code and anyone that wants to do a cleanup patch to sort
things has roughly the same level of effort whether or not your patch
without sorting lands in the meantime.
>>> + if ((fix & BDRV_DUMP_META) && output_format != OFORMAT_JSON) {
>>> + error_report("Metadata output in JSON format only");
>>> + return 1;
>>
>> Why this restriction?
>>
>
> This is to remind a user that '-M' can be effective with the option
> '--output=json' only. Do you think that a comment in the qemu-img.texi
> would be enough and the restriction should be omitted here?
Rather, why can't we come up with some sort of sane human output, so
that we don't have to limit the flag to just --output=json?
>>> +++ b/qemu-img.texi
>>> @@ -230,7 +230,7 @@ specified as well.
>>> For write tests, by default a buffer filled with zeros is written.
>>> This can be
>>> overridden with a pattern byte specified by @var{pattern}.
>>> -@item check [--object @var{objectdef}] [--image-opts] [-q] [-f
>>> @var{fmt}] [--output=@var{ofmt}] [-r [leaks | all]] [-T
>>> @var{src_cache}] [-U] @var{filename}
>>> +@item check [--object @var{objectdef}] [--image-opts] [-M] [-q] [-f
>>> @var{fmt}] [--output=@var{ofmt}] [-r [leaks | all]] [-T
>>> @var{src_cache}] [-U] @var{filename}
>>
>> This mentions that -M is valid, but has no further documentation on what
>> -M means. Without that, it's anyone's guess.
>>
>
> Thank you Eric, I really missed to supply a comment for the new option
> here and am going to put it below. Should I mention that option in
> qapi/block-core.json file also with this patch of the series?
Mentioning that the qapi type exists to facilitate a qemu-img option
might not hurt. But more important is that the qemu-img documentation
mentions what -M does; that documentation can point to the qapi docs for
how the output will be structured when --output=json is in effect.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2020-01-13 16:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-27 11:43 [PATCH 0/2] Dump QCOW2 metadata Andrey Shinkevich
2019-12-27 11:43 ` [PATCH 1/2] qcow2: introduce Qcow2Metadata structure Andrey Shinkevich
2020-01-07 22:07 ` Eric Blake
2020-01-13 9:49 ` Andrey Shinkevich
2019-12-27 11:43 ` [PATCH 2/2] qcow2: dump QCOW2 metadata Andrey Shinkevich
2020-01-07 22:11 ` Eric Blake
2020-01-13 10:30 ` Andrey Shinkevich
2020-01-13 16:16 ` Eric Blake [this message]
2020-01-13 17:02 ` Andrey Shinkevich
2020-01-13 17:27 ` Eric Blake
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=cedf0e08-8994-a892-85dc-bf0dea221163@redhat.com \
--to=eblake@redhat.com \
--cc=andrey.shinkevich@virtuozzo.com \
--cc=armbru@redhat.com \
--cc=den@virtuozzo.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).