From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePWSq-0007Zx-Df for qemu-devel@nongnu.org; Thu, 14 Dec 2017 11:34:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePWSn-0007Av-6j for qemu-devel@nongnu.org; Thu, 14 Dec 2017 11:34:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60514) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ePWSm-00079y-Tl for qemu-devel@nongnu.org; Thu, 14 Dec 2017 11:34:25 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0825761488 for ; Thu, 14 Dec 2017 16:34:24 +0000 (UTC) From: Markus Armbruster References: <20170911110623.24981-1-marcandre.lureau@redhat.com> <20170911110623.24981-45-marcandre.lureau@redhat.com> Date: Thu, 14 Dec 2017 17:34:07 +0100 In-Reply-To: <20170911110623.24981-45-marcandre.lureau@redhat.com> (=?utf-8?Q?=22Marc-Andr=C3=A9?= Lureau"'s message of "Mon, 11 Sep 2017 13:06:17 +0200") Message-ID: <87ind9uv40.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 44/50] build-sys: add a target schema List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Cc: qemu-devel@nongnu.org, "Dr. David Alan Gilbert" Marc-Andr=C3=A9 Lureau 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=C3=A9 Lureau > --- > 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' } >=20=20 > ## > # =3D 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) >=20=20 > QTAILQ_INIT(&qmp_commands); > qmp_init_marshal(&qmp_commands); > + target_qmp_init_marshal(&qmp_commands); >=20=20 > 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 =3D qemu-version.h config-host.h qemu-options.def > GENERATED_FILES +=3D qmp-commands.h qapi-types.h qapi-visit.h qapi-event= .h > GENERATED_FILES +=3D qmp-marshal.c qapi-types.c qapi-visit.c qapi-event.c > +GENERATED_FILES +=3D target-qmp-commands.h target-qapi-types.h target-qa= pi-visit.h target-qapi-event.h > +GENERATED_FILES +=3D target-qmp-marshal.c target-qapi-types.c target-qap= i-visit.c target-qapi-event.c > GENERATED_FILES +=3D qmp-introspect.h > GENERATED_FILES +=3D qmp-introspect.c >=20=20 > @@ -418,6 +420,7 @@ qapi-modules =3D $(SRC_PATH)/qapi-schema.json $(SRC_P= ATH)/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.p= y $(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","$@") >=20=20 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? > QGALIB_GEN=3D$(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 >=20=20 > GENERATED_FILES +=3D hmp-commands.h hmp-commands-info.h >=20=20 > +obj-y +=3D target-qapi-types.o target-qapi-visit.o > +obj-y +=3D target-qapi-event.o target-qmp-marshal.o > obj-y +=3D qmp-introspect.o >=20=20 > endif # CONFIG_SOFTMMU