qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 12/17] qemu-img: add a "map" subcommand


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 12/17] qemu-img: add a "map" subcommand
Date: Fri, 19 Jul 2013 07:54:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

Il 19/07/2013 06:48, Stefan Hajnoczi ha scritto:
> 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 <address@hidden>
>>> ---
>>>  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?

If you have interesting cases with sparse images, even raw depends on
how the underlying file system splits extents.

I can do a simple test that ignores the 'offset' field.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]