All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: kwolf@redhat.com, qemu-block@nongnu.org,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, nsoffer@redhat.com, mreitz@redhat.com
Subject: Re: [PATCH v3 2/2] qemu-img: Make unallocated part of backing chain obvious in map
Date: Wed, 7 Jul 2021 10:10:57 -0500	[thread overview]
Message-ID: <20210707151057.n3vpooy4nb3diint@redhat.com> (raw)
In-Reply-To: <481dc6cf-a353-b4a0-732c-b758f8750ff6@virtuozzo.com>

On Sat, Jul 03, 2021 at 10:25:28AM +0300, Vladimir Sementsov-Ogievskiy wrote:
...
> > An obvious solution is to make 'qemu-img map --output=json' add an
> > additional "present":false designation to any cluster lacking an
> > allocation anywhere in the chain, without any change to the "depth"
> > parameter to avoid breaking existing clients.  The iotests have
> > several examples where this distinction demonstrates the additional
> > accuracy.
> > 
> > Signed-off-by: Eric Blake <eblake@redhat.com>

> > +++ b/docs/tools/qemu-img.rst
> > @@ -597,6 +597,9 @@ Command description:
> >       if false, the sectors are either unallocated or stored as optimized
> >       all-zero clusters);
> >     - whether the data is known to read as zero (boolean field ``zero``);
> > +  - whether the data is actually present (boolean field ``present``);
> > +    if false, rebasing the backing chain onto a deeper file would pick
> > +    up data from the deeper file;
> 
> Preexisting, but rather strange style of documentation, when described option doesn't go first in the paragraph..

Yeah.  I'll send a followup email with a rewording of those paragraphs
for consideration.

> > +++ b/qemu-img.c
> > @@ -2980,8 +2980,9 @@ static int dump_map_entry(OutputFormat output_format, MapEntry *e,
> >           break;
> >       case OFORMAT_JSON:
> >           printf("{ \"start\": %"PRId64", \"length\": %"PRId64","
> > -               " \"depth\": %"PRId64", \"zero\": %s, \"data\": %s",
> > -               e->start, e->length, e->depth,
> > +               " \"depth\": %"PRId64", \"present\": %s, \"zero\": %s,"
> > +               "\"data\": %s", e->start, e->length, e->depth,
> > +               e->present ? "true" : "false",
> 
> Didn't you want to put present at the end? Still, this shouldn't be significant. And it make sense to keep present, zero and data together.

I wanted it before anything optional, which "offset" is, so it already
can't be at the end.  If I understood Nir correctly, it was more
important to always be present (it's easy to write a parser that
searches for terms in the same position, and tolerates a missing term
from an older verseion, but harder to parse a term that might or might
not be present).

> 
> You missied a whitespace after '"zero": %s,', which is obvious from further test diff hunks.
> 
> With it fixed:
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

Thanks for catching that.  I've updated that, and will queue through
my NBD tree.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



  reply	other threads:[~2021-07-07 15:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 19:06 [PATCH v3 0/2] qemu-img: Make unallocated part of backing chain obvious in map Eric Blake
2021-07-01 19:06 ` [PATCH v3 1/2] iotests: Improve and rename test 309 to nbd-qemu-allocation Eric Blake
2021-07-01 19:06 ` [PATCH v3 2/2] qemu-img: Make unallocated part of backing chain obvious in map Eric Blake
2021-07-03  7:25   ` Vladimir Sementsov-Ogievskiy
2021-07-07 15:10     ` Eric Blake [this message]
2021-07-07 18:41 ` [PATCH v3 3/2] qemu-img: Reword 'qemu-img map --output=json' docs Eric Blake
2021-07-07 20:39   ` Nir Soffer
2021-07-08  8:00   ` Vladimir Sementsov-Ogievskiy

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=20210707151057.n3vpooy4nb3diint@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=nsoffer@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 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.