From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V02cU-0003YW-Kj for qemu-devel@nongnu.org; Fri, 19 Jul 2013 00:48:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V02cT-00077U-Lo for qemu-devel@nongnu.org; Fri, 19 Jul 2013 00:48:42 -0400 Received: from mail-wi0-x231.google.com ([2a00:1450:400c:c05::231]:57047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V02cT-00077B-Ge for qemu-devel@nongnu.org; Fri, 19 Jul 2013 00:48:41 -0400 Received: by mail-wi0-f177.google.com with SMTP id ey16so3945836wid.4 for ; Thu, 18 Jul 2013 21:48:40 -0700 (PDT) Date: Fri, 19 Jul 2013 12:48:31 +0800 From: Stefan Hajnoczi Message-ID: <20130719044831.GB14330@stefanha-thinkpad.redhat.com> References: <1372862071-28225-1-git-send-email-pbonzini@redhat.com> <1372862071-28225-13-git-send-email-pbonzini@redhat.com> <51E84A4F.9030900@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51E84A4F.9030900@redhat.com> Subject: Re: [Qemu-devel] [PATCH 12/17] qemu-img: add a "map" subcommand List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, Paolo Bonzini , pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com 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 > > --- > > 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