qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 2/2] full introspection support for QMP


From: Amos Kong
Subject: Re: [Qemu-devel] [PATCH v2 2/2] full introspection support for QMP
Date: Mon, 23 Dec 2013 16:11:25 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Dec 20, 2013 at 07:03:57PM +0100, Paolo Bonzini wrote:
> Il 20/12/2013 12:57, Amos Kong ha scritto:
> > { 'type': 'DataObjectBase',
> >   'data': { '*name': 'str', 'type': 'str' } }
> > { 'union': 'DataObjectMemberType',
> >   'discriminator': {},
> >   'data': { 'reference': 'str',
> >             'undefined': 'DataObject',
> >             'extend': 'DataObject' } }
> 
> What is the purpose of "undefined"?  I don't see any occurrence of any
> of "undefined" or "extend" in the sample.


| { 'type': 'VersionInfo',
|   'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
|           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

| {
|   "name": "VersionInfo", 
|   "type": "type", 
|   "data": [
|~      {
|~          "name": "qemu", 
|~          "optional": false, 
|~          "type": {
|~              "type": "undefined-struct", 
|~              "data": [
|~                  {
|~                      "name": "micro", 
|~                      "optional": false, 
|~                      "recursive": false, 
|~                      "type": "int"
|~                  }, 
|~                  {
|~                      "name": "minor", 
|~                      "optional": false, 
|~                      "recursive": false, 
|~                      "type": "int"
|~                  }, 
|~                  {
|~                      "name": "major", 
|~                      "optional": false, 
|~                      "recursive": false, 
|~                      "type": "int"
|~                  }
|~              ]
|~          }
|~      }, 

> > { 'type': 'DataObjectMember',
> >   'data': { 'type': 'DataObjectMemberType', '*name': 'str',
> >             '*optional': 'bool', '*recursive': 'bool' } }
> > { 'type': 'DataObjectCommand',
> >   'data': { '*data': [ 'DataObjectMember' ],
> >             '*returns': 'DataObject',
> >             '*gen': 'bool' } }
> > { 'type': 'DataObjectEnumeration',
> >   'data': { 'data': [ 'str' ] } }
> > { 'type': 'DataObjectType',
> >   'data': { 'data': [ 'DataObjectMember' ] } }
> > { 'type': 'DataObjectUndefinedStruct',
> 
> Perhaps Unnamed or Anonymous?
 
Anonymous is good.

> >   'data': { 'data': [ 'DataObjectMember' ] } }
> > { 'type': 'DataObjectUnion',
> >   'data': { 'data': [ 'DataObjectMember' ], '*base': 'str',
> >             '*discriminator': 'str' } }
> > { 'union': 'DataObject',
> >   'base': 'DataObjectBase',
> >   'discriminator': 'type',
> >   'data': {
> >     'command': 'DataObjectCommand',
> >     'enumeration': 'DataObjectEnumeration',
> >     'type': 'DataObjectType',
> >     'undefined-struct': 'DataObjectUndefinedStruct',
> >     'reference-type': 'String',
> >     'unionobj': 'DataObjectUnion' } }
> > { 'command': 'query-qmp-schema', 'returns': ['DataObject'] }
> 
> I think forcing expansion of everything that isn't unnamed/anonymous
> makes the schema much larger and unwieldy.  Otherwise looks great!

We want to provide more useful metadata, and used some enum/unions to
indicate the dynamic type.

In the output, some simple data is processed too unwieldy. In another
side, some complex data is described clearly. It's also caused by some
limitation of QAPI infrastructure.
 
> Paolo

-- 
                        Amos.



reply via email to

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