All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: QEMU <qemu-devel@nongnu.org>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 44/50] build-sys: add a target schema
Date: Thu, 11 Jan 2018 22:32:33 +0100	[thread overview]
Message-ID: <CAJ+F1CKhNF1b_2hD7yY9zVz=Z9XOOUWSp-48OCKPr_7BJ9k2vQ@mail.gmail.com> (raw)
In-Reply-To: <87ind9uv40.fsf@dusky.pond.sub.org>

Hi

On Thu, Dec 14, 2017 at 5:34 PM, Markus Armbruster <armbru@redhat.com> wrote:
> Marc-André Lureau <marcandre.lureau@redhat.com> writes:
>
>> This schema is going to contain target-specific commands/events &
>> types, that can be conditionnally guarded with poisoned defines. To
>> filter it out by default, set the unit name to 'target'.
>>
>> And new rules to compile this unit generated files per-target.
>>
>> Use the "-u all" options for the introspection schema, since it is
>> generated as a single file and must contain all definitions.
>>
>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> ---
>>  qapi-schema.json |  1 +
>>  qapi/target.json |  3 +++
>>  monitor.c        |  2 ++
>>  Makefile         | 29 ++++++++++++++++++++++++++++-
>>  Makefile.target  |  2 ++
>>  5 files changed, 36 insertions(+), 1 deletion(-)
>>  create mode 100644 qapi/target.json
>>
>> diff --git a/qapi-schema.json b/qapi-schema.json
>> index f3af2cb851..42b6aebddb 100644
>> --- a/qapi-schema.json
>> +++ b/qapi-schema.json
>> @@ -92,6 +92,7 @@
>>  { 'include': 'qapi/transaction.json' }
>>  { 'include': 'qapi/trace.json' }
>>  { 'include': 'qapi/introspect.json' }
>> +{ 'include': 'qapi/target.json' }
>>
>>  ##
>>  # = Miscellanea
>> diff --git a/qapi/target.json b/qapi/target.json
>> new file mode 100644
>> index 0000000000..e9644f52c2
>> --- /dev/null
>> +++ b/qapi/target.json
>> @@ -0,0 +1,3 @@
>> +# -*- Mode: Python -*-
>> +
>> +{ 'pragma': { 'unit': 'target' } }
>> diff --git a/monitor.c b/monitor.c
>> index bf8a7685bf..af4eaeca5e 100644
>> --- a/monitor.c
>> +++ b/monitor.c
>> @@ -68,6 +68,7 @@
>>  #include "exec/exec-all.h"
>>  #include "qemu/log.h"
>>  #include "qmp-commands.h"
>> +#include "target-qmp-commands.h"
>>  #include "hmp.h"
>>  #include "qemu/thread.h"
>>  #include "block/qapi.h"
>> @@ -1003,6 +1004,7 @@ void monitor_init_qmp_commands(void)
>>
>>      QTAILQ_INIT(&qmp_commands);
>>      qmp_init_marshal(&qmp_commands);
>> +    target_qmp_init_marshal(&qmp_commands);
>>
>>      qmp_register_command(&qmp_commands, "query-qmp-schema",
>>                           qmp_query_qmp_schema,
>> diff --git a/Makefile b/Makefile
>> index 337a1f6f9b..7356b4e7b7 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -54,6 +54,8 @@ include $(SRC_PATH)/rules.mak
>>  GENERATED_FILES = qemu-version.h config-host.h qemu-options.def
>>  GENERATED_FILES += qmp-commands.h qapi-types.h qapi-visit.h qapi-event.h
>>  GENERATED_FILES += qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c
>> +GENERATED_FILES += target-qmp-commands.h target-qapi-types.h target-qapi-visit.h target-qapi-event.h
>> +GENERATED_FILES += target-qmp-marshal.c target-qapi-types.c target-qapi-visit.c target-qapi-event.c
>>  GENERATED_FILES += qmp-introspect.h
>>  GENERATED_FILES += qmp-introspect.c
>>
>> @@ -418,6 +420,7 @@ qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
>>                 $(SRC_PATH)/qapi/rocker.json \
>>                 $(SRC_PATH)/qapi/run-state.json \
>>                 $(SRC_PATH)/qapi/sockets.json \
>> +               $(SRC_PATH)/qapi/target.json \
>>                 $(SRC_PATH)/qapi/tpm.json \
>>                 $(SRC_PATH)/qapi/trace.json \
>>                 $(SRC_PATH)/qapi/transaction.json \
>> @@ -443,10 +446,34 @@ $(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
>>       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
>>               $(gen-out-type) -o "." $<, \
>>               "GEN","$@")
>> +
>> +target-qapi-types.c target-qapi-types.h :\
>> +$(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
>> +     $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
>> +             -i qapi-types.h \
>> +             $(gen-out-type) -p target- -u target $<, \
>> +             "GEN","$@")
>> +target-qapi-visit.c target-qapi-visit.h :\
>> +$(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
>> +     $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
>> +             -i qapi-visit.h \
>> +             $(gen-out-type) -p target- -u target $<, \
>> +             "GEN","$@")
>> +target-qapi-event.c target-qapi-event.h :\
>> +$(qapi-modules) $(SRC_PATH)/scripts/qapi-event.py $(qapi-py)
>> +     $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-event.py \
>> +             $(gen-out-type) -p target- -u target  $<, \
>> +             "GEN","$@")
>> +target-qmp-commands.h target-qmp-marshal.c :\
>> +$(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
>> +     $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
>> +             $(gen-out-type) -p target- -u target $<, \
>> +             "GEN","$@")
>> +
>>  qmp-introspect.h qmp-introspect.c :\
>>  $(qapi-modules) $(SRC_PATH)/scripts/qapi-introspect.py $(qapi-py)
>>       $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-introspect.py \
>> -             $(gen-out-type) -o "." $<, \
>> +             $(gen-out-type) -o "." -u all $<, \
>>               "GEN","$@")
>>
>
> Let's see whether I understand how this works.  Without -u (not fully
> visible in the diff), we get everything but the target-specific stuff.
> With -u target, we get just the target-specific stuff.  With -u all, we
> get everything.  Correct?
>

Right, but I changed the logic as discussed in "qapi: add a -u/--unit
option to specify which unit to visit " (this changes a bit the way
inclusion is being done, now target.json is the top-level for the
documentation)

So only -u target will be needed to generate the target specific code
now (while still parsing and checking with the rest of the schemas)

All documentation is generated from target.json. The rest is
unaffected by this new schema (which is a good thing imho).

>>  QGALIB_GEN=$(addprefix qga/qapi-generated/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
>> diff --git a/Makefile.target b/Makefile.target
>> index 0d28ed1df0..e44a3847d3 100644
>> --- a/Makefile.target
>> +++ b/Makefile.target
>> @@ -157,6 +157,8 @@ endif
>>
>>  GENERATED_FILES += hmp-commands.h hmp-commands-info.h
>>
>> +obj-y += target-qapi-types.o target-qapi-visit.o
>> +obj-y += target-qapi-event.o target-qmp-marshal.o
>>  obj-y += qmp-introspect.o
>>
>>  endif # CONFIG_SOFTMMU
>


thanks

-- 
Marc-André Lureau

  reply	other threads:[~2018-01-11 21:32 UTC|newest]

Thread overview: 118+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 11:05 [Qemu-devel] [PATCH v3 00/50] Hi, Marc-André Lureau
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 01/50] qlit: add qobject_from_qlit() Marc-André Lureau
2017-09-13 13:51   ` Eric Blake
2017-09-13 14:08     ` Marc-André Lureau
2017-12-06 14:37       ` Markus Armbruster
2017-12-06 14:37   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 02/50] qapi: generate a literal qobject for introspection Marc-André Lureau
2017-12-06 15:17   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 03/50] qapi2texi: minor python code simplification Marc-André Lureau
2017-12-06 15:19   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 04/50] qapi: add 'if' to top-level expressions Marc-André Lureau
2017-12-06 15:46   ` Markus Armbruster
2017-12-06 16:23   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 05/50] qapi: add tests for invalid 'if' Marc-André Lureau
2017-12-06 16:34   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 06/50] qapi: pass 'if' condition into QAPISchemaEntity objects Marc-André Lureau
2017-12-06 17:13   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 07/50] qapi: add 'ifcond' to visitor methods Marc-André Lureau
2017-12-06 17:23   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 08/50] qapi: mcgen() shouldn't indent # lines Marc-André Lureau
2017-12-06 17:41   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 09/50] qapi: add #if/#endif helpers Marc-André Lureau
2017-12-07 14:10   ` Markus Armbruster
2018-01-11 21:21     ` Marc-André Lureau
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 10/50] qapi-introspect: modify to_qlit() to append ', ' on level > 0 Marc-André Lureau
2017-12-07 14:47   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 11/50] qapi-introspect: modify to_qlit() to generate #if code Marc-André Lureau
2017-12-07 14:50   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 12/50] qapi-introspect: add preprocessor conditions to generated QLit Marc-André Lureau
2017-12-07 15:41   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 13/50] qapi-commands: add #if conditions to commands Marc-André Lureau
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 14/50] qapi-event: add #if conditions to events Marc-André Lureau
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 15/50] qapi-types: refactor variants handling Marc-André Lureau
2017-12-07 15:57   ` Markus Armbruster
2018-01-11 21:22     ` Marc-André Lureau
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 16/50] qapi-types: add #if conditions to types & visitors Marc-André Lureau
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 17/50] qapi: do not define enumeration value explicitely Marc-André Lureau
2017-12-07 16:23   ` Markus Armbruster
2017-12-07 17:01     ` Marc-André Lureau
2017-12-08  7:50       ` Markus Armbruster
2018-01-11 21:24         ` Marc-André Lureau
2018-02-02 14:43           ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 18/50] qapi: change enum visitor to take QAPISchemaMember Marc-André Lureau
2017-12-07 17:34   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 19/50] qapi: add 'if' to enum members Marc-André Lureau
2017-12-08  8:38   ` Markus Armbruster
2018-01-11 21:24     ` Marc-André Lureau
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 20/50] qapi-event: add 'if' condition to generated enum Marc-André Lureau
2017-12-08 13:58   ` Markus Armbruster
2017-12-08 14:07     ` Markus Armbruster
2018-01-11 21:31       ` Marc-André Lureau
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 21/50] qapi: add #if conditions on generated enum members Marc-André Lureau
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 22/50] tests: add some enum members tests Marc-André Lureau
2017-12-08 17:58   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 23/50] qapi: add 'if' to struct members and implicit objects members Marc-André Lureau
2017-12-09  8:18   ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 24/50] qapi: add some struct member tests Marc-André Lureau
2017-12-09  9:07   ` Markus Armbruster
2018-01-11 21:31     ` Marc-André Lureau
2018-02-02 14:51       ` Markus Armbruster
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 25/50] qapi: add #if conditions to generated struct members Marc-André Lureau
2017-09-11 11:05 ` [Qemu-devel] [PATCH v3 26/50] qapi: add 'if' on union variants Marc-André Lureau
2017-12-11 10:36   ` Markus Armbruster
2018-01-11 21:32     ` Marc-André Lureau
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 27/50] qapi: add #if conditions to generated variants Marc-André Lureau
2017-12-13 12:37   ` Markus Armbruster
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 28/50] qapi: add 'if' to alternate variant Marc-André Lureau
2017-12-12 14:51   ` Markus Armbruster
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 29/50] qapi: add tests for invalid alternate Marc-André Lureau
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 30/50] qapi: add #if conditions to generated alternate variants Marc-André Lureau
2017-12-12 19:25   ` Markus Armbruster
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 31/50] docs: document schema configuration Marc-André Lureau
2017-12-13 10:41   ` Markus Armbruster
2017-12-13 19:49     ` Eric Blake
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 32/50] qapi2texi: add 'If:' section to generated documentation Marc-André Lureau
2017-12-13 12:35   ` Markus Armbruster
2017-12-13 19:54     ` Eric Blake
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 33/50] qapi2texi: add 'If:' condition to enum values Marc-André Lureau
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 34/50] qapi2texi: add 'If:' condition to struct members Marc-André Lureau
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 35/50] qapi2texi: add condition to variants Marc-André Lureau
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 36/50] qapi: add conditions to VNC type/commands/events on the schema Marc-André Lureau
2017-12-13 14:12   ` Markus Armbruster
2017-12-13 14:20     ` Daniel P. Berrange
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 37/50] qapi: add conditions to SPICE " Marc-André Lureau
2017-12-13 14:17   ` Markus Armbruster
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 38/50] qapi: add conditions to REPLICATION type/commands " Marc-André Lureau
2017-12-13 14:19   ` Markus Armbruster
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 39/50] qapi-commands: don't initialize command list in qmp_init_marshall() Marc-André Lureau
2017-12-13 16:23   ` Markus Armbruster
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 40/50] qapi: add -i/--include filename.h Marc-André Lureau
2017-12-14 13:50   ` Markus Armbruster
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 41/50] qapi: add a 'unit' pragma Marc-André Lureau
2017-12-14 13:54   ` Markus Armbruster
2017-12-14 14:00     ` Marc-André Lureau
2017-12-14 14:33       ` Markus Armbruster
2017-12-14 16:08   ` Markus Armbruster
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 42/50] qapi: add a -u/--unit option to specify which unit to visit Marc-André Lureau
2017-12-14 16:16   ` Markus Armbruster
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 43/50] build-sys: move qmp-introspect per target Marc-André Lureau
2017-12-14 16:30   ` Markus Armbruster
2018-01-11 21:32     ` Marc-André Lureau
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 44/50] build-sys: add a target schema Marc-André Lureau
2017-12-14 16:34   ` Markus Armbruster
2018-01-11 21:32     ` Marc-André Lureau [this message]
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 45/50] qapi: make rtc-reset-reinjection depend on TARGET_I386 Marc-André Lureau
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 46/50] qapi: make s390 commands depend on TARGET_S390X Marc-André Lureau
2017-09-13  7:45   ` Cornelia Huck
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 47/50] target.json: add a note about query-cpu* not being s390x-specific Marc-André Lureau
2017-09-13  7:46   ` Cornelia Huck
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 48/50] qapi: make query-gic-capabilities depend on TARGET_ARM Marc-André Lureau
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 49/50] qapi: make query-cpu-model-expansion depend on s390 or x86 Marc-André Lureau
2017-09-12 17:40   ` Eduardo Habkost
2017-09-13  7:47   ` Cornelia Huck
2017-09-11 11:06 ` [Qemu-devel] [PATCH v3 50/50] qapi: make query-cpu-definitions depend on specific targets Marc-André Lureau
2017-09-12 17:45   ` Eduardo Habkost
2017-09-13  7:48   ` Cornelia Huck
2017-09-11 11:54 ` [Qemu-devel] [PATCH v3 00/50] Hi, no-reply
2017-12-18 13:14 ` Markus Armbruster

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='CAJ+F1CKhNF1b_2hD7yY9zVz=Z9XOOUWSp-48OCKPr_7BJ9k2vQ@mail.gmail.com' \
    --to=marcandre.lureau@gmail.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@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.