From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuG05-0000Vz-O4 for qemu-devel@nongnu.org; Wed, 03 Jul 2013 01:53:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuG04-0001Ue-SW for qemu-devel@nongnu.org; Wed, 03 Jul 2013 01:53:09 -0400 Received: from mail-bk0-x234.google.com ([2a00:1450:4008:c01::234]:50506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuG04-0001UY-LJ for qemu-devel@nongnu.org; Wed, 03 Jul 2013 01:53:08 -0400 Received: by mail-bk0-f52.google.com with SMTP id d7so2700305bkh.25 for ; Tue, 02 Jul 2013 22:53:07 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51D3BC3A.4030803@redhat.com> Date: Wed, 03 Jul 2013 07:52:58 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1371644677-11041-1-git-send-email-akong@redhat.com> <878v1pqak4.fsf@codemonkey.ws> <51D2F1B3.1080903@redhat.com> <20130702153945.GZ2524@redhat.com> <51D3035A.1060605@redhat.com> <877gh8j012.fsf@codemonkey.ws> <51D3314F.1070609@redhat.com> <87zju4wufh.fsf@codemonkey.ws> In-Reply-To: <87zju4wufh.fsf@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] full introspection support for QMP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: armbru@redhat.com, qiaonuohan@cn.fujitsu.com, Amos Kong , qemu-devel@nongnu.org, lcapitulino@redhat.com Il 02/07/2013 22:58, Anthony Liguori ha scritto: > > > We consume the schema in QEMU. No reason for us to consume it in a > > > different format than libvirt. > > > > One reason could be that qapi-schema.json, as written, lacks a schema > > that can be expressed itself using QAPI. > > Yup, but how much does that matter in practice? It matters little because we do not provide a library of QAPI parsers/visitors, so clients have to invent their own anyway. But if we did, clients would be completely oblivious of the fact that QMP is based on JSON. Sending qapi-schema.json down the wire as a JSON string would break the abstraction that we provide to the clients. > At any rate, if we wanted to solve this problem--a self-describing > schema--we should do it in qapi-schema.json too. I disagree. I also disagree that qapi-schema.json, as written, is a format designed for machine consumption. So, qapi-schema.json has to be readable/writable _mostly_ by humans. That it is valid JSON is little more than a curious accident, because overall the syntax greatly favors humans rather than computers. A format designed for computers would have a schema such that no parsing tasks (however small---I'm thinking of the "list of" and "optional" syntaxes) would be left after parsing the JSON. The example that Eric sent is not something that I would find easy to read/write. qapi-schema.json instead is more than acceptable. Paolo