From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=59344 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PyBVM-00084n-Fg for qemu-devel@nongnu.org; Fri, 11 Mar 2011 18:12:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PyBV9-0007rz-Pl for qemu-devel@nongnu.org; Fri, 11 Mar 2011 18:12:09 -0500 Received: from e1.ny.us.ibm.com ([32.97.182.141]:49662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PyBV9-0007rm-NB for qemu-devel@nongnu.org; Fri, 11 Mar 2011 18:12:07 -0500 Received: from d01dlp02.pok.ibm.com (d01dlp02.pok.ibm.com [9.56.224.85]) by e1.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p2BN2CGE024093 for ; Fri, 11 Mar 2011 18:02:12 -0500 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 456976E8036 for ; Fri, 11 Mar 2011 18:12:06 -0500 (EST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p2BNC6ZD338708 for ; Fri, 11 Mar 2011 18:12:06 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p2BNC5D1023424 for ; Fri, 11 Mar 2011 18:12:05 -0500 Message-ID: <4D7AAC43.8010409@us.ibm.com> Date: Fri, 11 Mar 2011 17:12:03 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1299884745-521-1-git-send-email-aliguori@us.ibm.com> <1299884745-521-2-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1299884745-521-2-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 01/15] qapi: add code generator for qmp-types (v2) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Markus Armbruster , Luiz Capitulino , agl@linux.vnet.ibm.com, qemu-devel@nongnu.org, Avi Kivity On 03/11/2011 05:05 PM, Anthony Liguori wrote: > Only generate qmp-types.[ch]. These files contain the type definitions for > QMP along with the alloc/free functions for these types. Functions to convert > enum values to integers and vice versa are also included. > > qmp-types is used both within QEMU and within libqmp > > Special alloc/free functions are provided to ensure that all structures are > padded when allocated. This makes sure that libqmp can provide a forward > compatible interface since all additions to a structure will have a boolean > enable flag. > > The free function is convenient since individual structures may have pointers > that also require freeing. > > Signed-off-by: Anthony Liguori > --- > v1 -> v2 > - modify code generator to use multiline strings instead of prints > - support proxy commands > - support async commands As a friendly hint for reviewers, qmp-gen.py reads a lot better with syntax highlighting as the Python code stands out from the C code. I've pushed these patches to: http://repo.or.cz/w/qemu/aliguori.git qapi/round.1-v2 If you'd prefer to clone that and look at the code in a git tree. This new series generates the same code as the last series (minus a little whitespace differences) so you can refer to the previous series to see the code output.+def qmp_event_func_to_c(name): Regards, Anthony Liguori