All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>,
	Avi Kivity <avi@redhat.com>, Adam Litke <agl@us.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 01/15] qapi: add code generator for qmp-types (v2)
Date: Sat, 12 Mar 2011 09:00:53 -0600	[thread overview]
Message-ID: <4D7B8AA5.6080806@codemonkey.ws> (raw)
In-Reply-To: <AANLkTinFRo1sU34ssGB5hYL_2dPMxeLeO=x8UZ3e_pcS@mail.gmail.com>

On 03/12/2011 05:29 AM, Blue Swirl wrote:
> On Sat, Mar 12, 2011 at 1:05 AM, Anthony Liguori<aliguori@us.ibm.com>  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<aliguori@us.ibm.com>
>> ---
>> v1 ->  v2
>>   - modify code generator to use multiline strings instead of prints
>>   - support proxy commands
>>   - support async commands
>>
>> 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
> Please put this into scripts/.

Sure.

>> +
>> +#include<stdint.h>
>> +#include<stdbool.h>
>> +#include "error.h"
>> +
>> +typedef struct QmpSignal QmpSignal;
>> +typedef struct QmpCommandState QmpCommandState;
>> +typedef struct QmpState QmpState;
>> +
>> +#define BUILD_ASSERT(cond) do {     \
>> +    (void)sizeof(int[-1+!!(cond)]); \
> Spaces around '+'.
>
> This could be useful elsewhere, how about putting it to some generic header?

Sure.

Regards,

Anthony Liguori

>> +} while (0)
>> +
>> +#define BUILD_BUG() BUILD_ASSERT(0)
>> +
>> +#endif
>> --
>> 1.7.0.4
>>
>>
>>

  reply	other threads:[~2011-03-12 15:00 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11 23:05 [Qemu-devel] [PATCH 00/15] QAPI Round 1 (core code generator) (v2) Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 01/15] qapi: add code generator for qmp-types (v2) Anthony Liguori
2011-03-11 23:12   ` [Qemu-devel] " Anthony Liguori
2011-03-12 11:29   ` [Qemu-devel] " Blue Swirl
2011-03-12 15:00     ` Anthony Liguori [this message]
2011-03-18 14:18       ` Luiz Capitulino
2011-03-18 14:14   ` [Qemu-devel] " Luiz Capitulino
2011-03-11 23:05 ` [Qemu-devel] [PATCH 02/15] qapi: add code generator for type marshallers Anthony Liguori
2011-03-18 15:13   ` [Qemu-devel] " Luiz Capitulino
2011-03-11 23:05 ` [Qemu-devel] [PATCH 03/15] qapi: add core QMP server support (v2) Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 04/15] qapi: add signal support to core QMP server Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 05/15] qapi: add QAPI module type Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 06/15] qapi: add code generators for QMP command marshaling Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 07/15] qapi: add query-version QMP command Anthony Liguori
2011-03-12 11:19   ` Blue Swirl
2011-03-12 15:06     ` Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 08/15] qapi: add new QMP server that uses CharDriverState (v2) Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 09/15] vl: add a new -qmp2 option to expose experimental QMP server Anthony Liguori
2011-03-11 23:14   ` [Qemu-devel] " Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 10/15] qapi: add QMP quit command Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 11/15] qapi: add QMP qmp_capabilities command Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 12/15] qapi: add QMP put-event command Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 13/15] qapi: add code generator for libqmp (v2) Anthony Liguori
2011-03-12 11:10   ` Blue Swirl
2011-03-12 14:53     ` Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 14/15] qapi: add test-libqmp Anthony Liguori
2011-03-12 11:23   ` Blue Swirl
2011-03-12 14:59     ` Anthony Liguori
2011-03-11 23:05 ` [Qemu-devel] [PATCH 15/15] qapi: generate HTML report for test-libqmp Anthony Liguori
2011-03-16 14:34 ` [Qemu-devel] Re: [PATCH 00/15] QAPI Round 1 (core code generator) (v2) Luiz Capitulino
2011-03-16 14:49   ` Paolo Bonzini
2011-03-16 15:00     ` Luiz Capitulino
2011-03-16 16:06       ` Anthony Liguori
2011-03-16 16:03     ` Anthony Liguori
2011-03-16 16:31       ` Paolo Bonzini
2011-03-16 18:06         ` Anthony Liguori
2011-03-16 15:59   ` Anthony Liguori
2011-03-16 18:09     ` Luiz Capitulino
2011-03-16 18:32       ` Anthony Liguori
2011-03-16 19:27         ` Luiz Capitulino
2011-03-16 20:00           ` Anthony Liguori
2011-03-18 14:10             ` Luiz Capitulino
2011-03-18 14:22               ` Anthony Liguori
2011-03-17 12:21     ` Kevin Wolf
2011-03-17 12:46       ` Anthony Liguori
2011-03-17 13:15         ` Kevin Wolf
2011-03-17 13:28           ` Anthony Liguori
2011-03-17 14:04             ` Kevin Wolf
2011-03-17 15:49               ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D7B8AA5.6080806@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=agl@us.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=avi@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.