qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Eyal Moscovici <eyal.moscovici@oracle.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	liran.alon@oracle.com, qemu-block@nongnu.org,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH 1/2] qemu-img: refactor dump_map_entry JSON format output
Date: Wed, 29 Apr 2020 09:58:17 -0500	[thread overview]
Message-ID: <487b9270-4e39-9a0d-ca7e-c261ee2f02c2@redhat.com> (raw)
In-Reply-To: <20200322091117.79443-2-eyal.moscovici@oracle.com>

On 3/22/20 4:11 AM, Eyal Moscovici wrote:
> Previously dump_map_entry identified whether we need to start a new JSON
> array based on whether start address == 0. In this refactor we remove
> this assumption as in following patches we will allow map to start from
> an arbitrary position.
> 
> Acked-by: Mark Kanda <mark.kanda@oracle.com>
> Signed-off-by: Eyal Moscovici <eyal.moscovici@oracle.com>
> ---
>   qemu-img.c | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
> 

> @@ -2871,8 +2870,8 @@ static int dump_map_entry(OutputFormat output_format, MapEntry *e,
>           }
>           putchar('}');
>   
> -        if (!next) {
> -            printf("]\n");
> +        if (next) {
> +            printf(",\n");

As long as you're touching this, puts(",") is slightly more efficient 
than printf().  But what you have is not wrong.

Reviewed-by: Eric Blake <eblake@redhat.com>

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



  reply	other threads:[~2020-04-29 14:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-22  9:11 [PATCH 0/2] Additional parameters for qemu_img map Eyal Moscovici
2020-03-22  9:11 ` [PATCH 1/2] qemu-img: refactor dump_map_entry JSON format output Eyal Moscovici
2020-04-29 14:58   ` Eric Blake [this message]
2020-05-06  9:55     ` Eyal Moscovici
2020-03-22  9:11 ` [PATCH 2/2] qemu-img: Add --start-offset and --max-length to map Eyal Moscovici
2020-04-29 15:04   ` Eric Blake
2020-05-06  9:52     ` Eyal Moscovici
2020-04-29 13:39 ` [PATCH 0/2] Additional parameters for qemu_img map John Snow
2020-05-06 21:34   ` [PATCH v2 0/5] " Eyal Moscovici
2020-05-06 21:34     ` [PATCH v2 1/5] qemu-img: remove check that cvtnum value > MAX_INT Eyal Moscovici
2020-05-06 21:49       ` Eric Blake
2020-05-12  9:39         ` Eyal Moscovici
2020-05-12 14:14           ` Eric Blake
2020-05-06 21:34     ` [PATCH v2 2/5] qemu_img: add error report to cvtnum Eyal Moscovici
2020-05-06 21:59       ` Eric Blake
2020-05-12  9:44         ` Eyal Moscovici
2020-05-06 21:34     ` [PATCH v2 3/5] qemu-img: validate image length in img_map Eyal Moscovici
2020-05-06 22:01       ` Eric Blake
2020-05-06 21:34     ` [PATCH v2 4/5] qemu-img: refactor dump_map_entry JSON format output Eyal Moscovici
2020-05-06 21:34     ` [PATCH v2 5/5] qemu-img: Add --start-offset and --max-length to map Eyal Moscovici
2020-05-06 22:04       ` Eric Blake
2020-05-12  9:48         ` Eyal Moscovici
2020-05-06 21:45     ` [PATCH v2 0/5] Additional parameters for qemu_img map 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=487b9270-4e39-9a0d-ca7e-c261ee2f02c2@redhat.com \
    --to=eblake@redhat.com \
    --cc=eyal.moscovici@oracle.com \
    --cc=kwolf@redhat.com \
    --cc=liran.alon@oracle.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 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).