On Thu, Jul 18, 2013 at 02:04:31PM -0600, Eric Blake wrote: > On 07/03/2013 08:34 AM, Paolo Bonzini wrote: > > This command dumps the metadata of an entire chain, in either tabular or > > JSON > > format. > > > > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > > --- > > qemu-img-cmds.hx | 6 ++ > > qemu-img.c | 186 > > +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > 2 files changed, 192 insertions(+) > > > > > + case OFORMAT_JSON: > > + printf("%s{ 'depth': %d, 'start': %lld, 'length': %lld, " > > + "'zero': %s, 'data': %s", > > + (e->start == 0 ? "[" : ",\n"), > > + e->depth, (long long) e->start, (long long) e->length, > > + (e->flags & BDRV_BLOCK_ZERO) ? "true" : "false", > > + (e->flags & BDRV_BLOCK_DATA) ? "true" : "false"); > > + if (e->flags & BDRV_BLOCK_OFFSET_VALID) { > > + printf(", 'offset': %lld", (long long) e->offset); > > + } > > + putchar('}'); > > Can we please get this format documented in qapi-schema.json, even if we > aren't using qapi to generate it yet?
Paolo: Please send a follow-up patch documenting the json schema, I've already merged this series. I was although thinking about qemu-iotests for qemu-img map, but it's tricky since the allocation is an internal detail of the image format. Perhaps a test case using raw? Stefan