From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vv0by-0003DR-3L for qemu-devel@nongnu.org; Mon, 23 Dec 2013 03:11:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vv0br-0001qX-DA for qemu-devel@nongnu.org; Mon, 23 Dec 2013 03:11:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vv0br-0001qS-5H for qemu-devel@nongnu.org; Mon, 23 Dec 2013 03:11:31 -0500 Date: Mon, 23 Dec 2013 16:11:25 +0800 From: Amos Kong Message-ID: <20131223081125.GB28470@amosk.info> References: <1373971062-28909-1-git-send-email-akong@redhat.com> <1373971062-28909-3-git-send-email-akong@redhat.com> <51E9B81C.2090105@redhat.com> <20131127023217.GA6629@amosk.info> <20131220110001.GC2890@amosk.info> <20131220115705.GD2890@amosk.info> <52B4868D.4010805@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52B4868D.4010805@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 2/2] full introspection support for QMP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: "kwolf@redhat.com" , mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, qiaonuohan@cn.fujitsu.com, xiawenc@linux.vnet.ibm.com 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.