From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTcS7-00084y-8u for qemu-devel@nongnu.org; Thu, 24 Nov 2011 11:47:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTcS5-0001uG-Cn for qemu-devel@nongnu.org; Thu, 24 Nov 2011 11:47:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTcS4-0001u6-Ti for qemu-devel@nongnu.org; Thu, 24 Nov 2011 11:47:09 -0500 Date: Thu, 24 Nov 2011 16:47:04 +0000 From: "Richard W.M. Jones" Message-ID: <20111124164704.GW25839@amd.home.annexia.org> References: <201111151924.41357.bazulay@redhat.com> <4EC459F2.5010701@linux.vnet.ibm.com> <201111171834.48040.bazulay@redhat.com> <4EC5674B.30807@linux.vnet.ibm.com> <4ECE3B27.3020708@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ECE3B27.3020708@redhat.com> Subject: Re: [Qemu-devel] wiki summary List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dor Laor Cc: Barak Azulay , qemu-devel@nongnu.org, Gal Hammer , vdsm-devel@lists.fedorahosted.org, Michael Roth , arch@ovirt.org On Thu, Nov 24, 2011 at 02:40:07PM +0200, Dor Laor wrote: > Using QMP is an advantage, I agree. > However it can be used by another option - move the QMP schema out > of qemu.git so all projects like libvirt, agents, vdsm, etc will be > able to consume it directly. > > This way, adding a new (agent) command will immediately propagate to > all of the stack instead of each component to implement it > differently (while it would still be possible). > That's what libguestfs scheme do today. I think Dor CC'd me on this because we use aggressive code generation in libguestfs to simplify creating new APIs. For an example see: http://fedorapeople.org/gitweb?p=rjones/public_git/libguestfs.git;a=commitdiff;h=cbd1c45d95c530c8d94103dcc2c521bf5501ef59 The patch is in three parts: (1) C code to implement the new API. Constructing the command line, parsing the output. (2) Metadata in the generator to describe the new API (parameters, return, documentation, etc.) ==> From this part *everything* is generated <== - C header file - bindings in 8+ programming languages - documentation - RPC used over internal virtio-serial connection (3) A test. Intelligently generating code like this has been an enormous win. Here are two slightly more complicated examples demonstrating the same thing: http://fedorapeople.org/gitweb?p=rjones/public_git/libguestfs.git;a=commitdiff;h=c4bd6bba8d88ecf1ebf4a9c2c80a407d9971aaf7 http://fedorapeople.org/gitweb?p=rjones/public_git/libguestfs.git;a=commitdiff;h=c11a92751e003b3d4bc3584b598afc9bd9d9e703 Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora