[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] qemu-img: refactor dump_map_entry JSON format output
From: |
Eyal Moscovici |
Subject: |
Re: [PATCH 1/2] qemu-img: refactor dump_map_entry JSON format output |
Date: |
Wed, 06 May 2020 12:55:04 +0300 |
User-agent: |
Microsoft-MacOutlook/10.1e.0.191013 |
On 29/04/2020, 17:58, "Eric Blake" <address@hidden> wrote:
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 <address@hidden>
> Signed-off-by: Eyal Moscovici <address@hidden>
> ---
> 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.
Thanks, will fix.
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH 1/2] qemu-img: refactor dump_map_entry JSON format output,
Eyal Moscovici <=