qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 01/18] migration: dump vmstate info as a json fi


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 01/18] migration: dump vmstate info as a json file for static analysis
Date: Wed, 21 May 2014 05:45:25 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/12/2014 10:12 PM, Amit Shah wrote:
> Hi,
> 
> On (Mon) 12 May 2014 [06:51:54], Eric Blake wrote:
>> On 05/12/2014 05:16 AM, Amit Shah wrote:
>>> This commit adds a new command, '-dump-vmstate', that takes a filename
>>> as a parameter.  When executed, QEMU will dump the vmstate information
>>> for the machine type it's invoked with to the file, and quit.
>>>
>>> The JSON-format output can then be used to compare the vmstate info for
>>> different QEMU versions, specifically to test whether live migration
>>> would break due to changes in the vmstate data.
>>
>> Are we going to document that JSON format anywhere?
> 
> I suppose we should, I thought I should wait for comments here on any
> extra fields that people want.
> 
> I suppose documenting would just be coming up with a schema, though? ...
> 
>>  Is it worth making
>> it part of qapi-schema.json,
> 
> but documenting the entire schema is difficult, as each device will
> have its own schema text (due to the differing fields).  At least
> that's how I understand it; please correct me if I'm wrong.

If field names form JSON keys, then yes, documenting each device will be
its own schema.  But if you write things generic enough, you can have a
single schema that covers all devices, by ensuring that device-specific
field names are supplied only as values, not keys.

That is,
 'device': { 'name': 'foo',
   'fields': { 'field1': 'int32', 'field2': 'int64' }
 }

requires a schema for each device, while
 'device': { 'name': 'foo',
   'fields': [
     { 'name': 'field1', 'type': 'int32' },
     { 'name': 'field2', 'type': 'int64' }
   ]
 }

is generic.  It is more verbose and requires more structure, but by
isolating device details into values rather than keys, you get rid of
the need for per-device schemas.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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