On 29/04/2020, 17:58, "Eric Blake" <[email protected]> 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 <[email protected]> > Signed-off-by: Eyal Moscovici <[email protected]> > --- > 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 <[email protected]> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
- [PATCH 0/2] Additional parameters for qemu_img map Eyal Moscovici
- [PATCH 2/2] qemu-img: Add --start-offset and --max-len... Eyal Moscovici
- Re: [PATCH 2/2] qemu-img: Add --start-offset and -... Eric Blake
- Re: [PATCH 2/2] qemu-img: Add --start-offset a... Eyal Moscovici
- [PATCH 1/2] qemu-img: refactor dump_map_entry JSON for... Eyal Moscovici
- Re: [PATCH 1/2] qemu-img: refactor dump_map_entry ... Eric Blake
- Re: [PATCH 1/2] qemu-img: refactor dump_map_en... Eyal Moscovici
- Re: [PATCH 0/2] Additional parameters for qemu_img map John Snow
- [PATCH v2 0/5] Additional parameters for qemu_img ... Eyal Moscovici
- [PATCH v2 1/5] qemu-img: remove check that cvt... Eyal Moscovici
- Re: [PATCH v2 1/5] qemu-img: remove check ... Eric Blake
- Re: [PATCH v2 1/5] qemu-img: remove c... Eyal Moscovici
- Re: [PATCH v2 1/5] qemu-img: remo... Eric Blake
- [PATCH v2 2/5] qemu_img: add error report to c... Eyal Moscovici
- Re: [PATCH v2 2/5] qemu_img: add error rep... Eric Blake
- Re: [PATCH v2 2/5] qemu_img: add erro... Eyal Moscovici
- [PATCH v2 3/5] qemu-img: validate image length... Eyal Moscovici
