[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: |
Eric Blake |
Subject: |
Re: [PATCH 1/2] qemu-img: refactor dump_map_entry JSON format output |
Date: |
Wed, 29 Apr 2020 09:58:17 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
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.
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,
Eric Blake <=