From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38999 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwPhg-0006jH-3E for qemu-devel@nongnu.org; Sun, 06 Mar 2011 20:57:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwPhf-0005fU-0P for qemu-devel@nongnu.org; Sun, 06 Mar 2011 20:57:44 -0500 Received: from mail-qw0-f45.google.com ([209.85.216.45]:52597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwPhe-0005fN-QG for qemu-devel@nongnu.org; Sun, 06 Mar 2011 20:57:42 -0500 Received: by qwj8 with SMTP id 8so3437048qwj.4 for ; Sun, 06 Mar 2011 17:57:42 -0800 (PST) Message-ID: <4D743B92.80402@codemonkey.ws> Date: Sun, 06 Mar 2011 19:57:38 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 08/22] qapi: add code generator for qmp-types References: <1299460984-15849-1-git-send-email-aliguori@us.ibm.com> <1299460984-15849-9-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1299460984-15849-9-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Markus Armbruster , Luiz Capitulino , qemu-devel@nongnu.org, Adam Litke On 03/06/2011 07:22 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 > > diff --git a/Makefile b/Makefile > index 6b1d716..6b9fd69 100644 > --- a/Makefile > +++ b/Makefile > @@ -4,6 +4,7 @@ GENERATED_HEADERS = config-host.h trace.h qemu-options.def > ifeq ($(TRACE_BACKEND),dtrace) > GENERATED_HEADERS += trace-dtrace.h > endif > +GENERATED_HEADERS += qmp-types.h > > ifneq ($(wildcard config-host.mak),) > # Put the all: rule here so that config-host.mak can contain dependencies. > @@ -146,6 +147,14 @@ trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS) > > simpletrace.o: simpletrace.c $(GENERATED_HEADERS) > > +qmp-types.c: $(SRC_PATH)/qmp-schema.json $(SRC_PATH)/qmp-gen.py > + $(call quiet-command,python $(SRC_PATH)/qmp-gen.py --types-body< $< > $@, " GEN $@") > + > +qmp-types.h: $(SRC_PATH)/qmp-schema.json $(SRC_PATH)/qmp-gen.py > + $(call quiet-command,python $(SRC_PATH)/qmp-gen.py --types-header< $< > $@, " GEN $@") > + > +qmp-types.o: qmp-types.c qmp-types.h > + > version.o: $(SRC_PATH)/version.rc config-host.mak > $(call quiet-command,$(WINDRES) -I. -o $@ $<," RC $(TARGET_DIR)$@") > > diff --git a/Makefile.objs b/Makefile.objs > index 69f0383..710d99f 100644 > --- a/Makefile.objs > +++ b/Makefile.objs > @@ -15,7 +15,7 @@ oslib-obj-$(CONFIG_POSIX) += oslib-posix.o > > block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o > block-obj-y += nbd.o block.o aio.o aes.o qemu-config.o > -block-obj-y += error.o > +block-obj-y += error.o qmp-types.o > block-obj-$(CONFIG_POSIX) += posix-aio-compat.o > block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o > > diff --git a/ordereddict.py b/ordereddict.py > new file mode 100644 > index 0000000..e17269f > --- /dev/null > +++ b/ordereddict.py > Python 2.7 introduces a standard OrderedDict and this is a compatibility wrapper for older versions of Python. I should have mentioned this in the commit message. Regards, Anthony Liguori