diff mbox series

[v4,08/18] qapi: New module target.json

Message ID 20190214093053.1400-9-armbru@redhat.com
State New
Headers show
Series qapi: add #if pre-processor conditions to generated code (part 3) | expand

Commit Message

Markus Armbruster Feb. 14, 2019, 9:30 a.m. UTC
We can't add appropriate target-specific conditionals to misc.json,
because that would make all of misc.json unusable in
target-independent code.  To keep misc.json target-independent, we
need to split off target-dependent target.json.

This commit doesn't actually split off anything, it merely creates the
empty module.  The next few patches will move stuff from misc.json
there.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 Makefile.objs         |  3 +--
 qapi/Makefile.objs    | 28 +++++++++++++++++-----------
 qapi/qapi-schema.json |  1 +
 qapi/target.json      | 13 +++++++++++++
 4 files changed, 32 insertions(+), 13 deletions(-)
 create mode 100644 qapi/target.json

Comments

Marc-André Lureau Feb. 14, 2019, 11:07 a.m. UTC | #1
Hi

On Thu, Feb 14, 2019 at 10:50 AM Markus Armbruster <armbru@redhat.com> wrote:
>
> We can't add appropriate target-specific conditionals to misc.json,
> because that would make all of misc.json unusable in
> target-independent code.  To keep misc.json target-independent, we
> need to split off target-dependent target.json.
>
> This commit doesn't actually split off anything, it merely creates the
> empty module.  The next few patches will move stuff from misc.json
> there.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  Makefile.objs         |  3 +--
>  qapi/Makefile.objs    | 28 +++++++++++++++++-----------
>  qapi/qapi-schema.json |  1 +
>  qapi/target.json      | 13 +++++++++++++
>  4 files changed, 32 insertions(+), 13 deletions(-)
>  create mode 100644 qapi/target.json
>
> diff --git a/Makefile.objs b/Makefile.objs
> index 4a266357a2..95150d7173 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -79,8 +79,7 @@ common-obj-$(CONFIG_FDT) += device_tree.o
>  ######################################################################
>  # qapi
>
> -common-obj-y += qapi/qapi-commands.o
> -common-obj-y += $(QAPI_MODULES:%=qapi/qapi-commands-%.o)
> +common-obj-y += $(QAPI_COMMON_MODULES:%=qapi/qapi-commands-%.o)
>  common-obj-y += qmp.o hmp.o
>  endif
>
> diff --git a/qapi/Makefile.objs b/qapi/Makefile.objs
> index da0000cbae..654321de94 100644
> --- a/qapi/Makefile.objs
> +++ b/qapi/Makefile.objs
> @@ -5,21 +5,27 @@ util-obj-y += opts-visitor.o qapi-clone-visitor.o
>  util-obj-y += qmp-event.o
>  util-obj-y += qapi-util.o
>
> -QAPI_MODULES = block-core block char common crypto introspect job migration
> -QAPI_MODULES += misc net rdma rocker run-state sockets tpm trace transaction
> -QAPI_MODULES += ui
> +QAPI_COMMON_MODULES = block-core block char common crypto introspect
> +QAPI_COMMON_MODULES += job migration misc net rdma rocker run-state
> +QAPI_COMMON_MODULES += sockets tpm trace transaction ui
> +QAPI_TARGET_MODULES = target
> +QAPI_MODULES = $(QAPI_COMMON_MODULES) $(QAPI_TARGET_MODULES)
>
>  util-obj-y += qapi-builtin-types.o
> -util-obj-y += qapi-types.o
> -util-obj-y += $(QAPI_MODULES:%=qapi-types-%.o)
> +util-obj-y += $(QAPI_COMMON_MODULES:%=qapi-types-%.o)
>  util-obj-y += qapi-builtin-visit.o
> -util-obj-y += qapi-visit.o
> -util-obj-y += $(QAPI_MODULES:%=qapi-visit-%.o)
> +util-obj-y += $(QAPI_COMMON_MODULES:%=qapi-visit-%.o)
>  util-obj-y += qapi-emit-events.o
> -util-obj-y += qapi-events.o
> -util-obj-y += $(QAPI_MODULES:%=qapi-events-%.o)
> +util-obj-y += $(QAPI_COMMON_MODULES:%=qapi-events-%.o)
>
> -common-obj-y += qapi-commands.o
> -common-obj-y += $(QAPI_MODULES:%=qapi-commands-%.o)
> +common-obj-y += $(QAPI_COMMON_MODULES:%=qapi-commands-%.o)
>
> +obj-y += $(QAPI_TARGET_MODULES:%=qapi-types-%.o)
> +obj-y += qapi-types.o
> +obj-y += $(QAPI_TARGET_MODULES:%=qapi-visit-%.o)
> +obj-y += qapi-visit.o
> +obj-y += $(QAPI_TARGET_MODULES:%=qapi-events-%.o)
> +obj-y += qapi-events.o
> +obj-y += $(QAPI_TARGET_MODULES:%=qapi-commands-%.o)
> +obj-y += qapi-commands.o
>  obj-y += qapi-introspect.o
> diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
> index 1845aa78ff..db61bfd688 100644
> --- a/qapi/qapi-schema.json
> +++ b/qapi/qapi-schema.json
> @@ -97,3 +97,4 @@
>  { 'include': 'trace.json' }
>  { 'include': 'introspect.json' }
>  { 'include': 'misc.json' }
> +{ 'include': 'target.json' }
> diff --git a/qapi/target.json b/qapi/target.json
> new file mode 100644
> index 0000000000..8054926293
> --- /dev/null
> +++ b/qapi/target.json
> @@ -0,0 +1,13 @@
> +# -*- Mode: Python -*-
> +#
> +
> +##
> +# = Target-specific commands & events
> +##
> +
> +##
> +# @TARGET-TEMPORARY-DUMMY:
> +# Will go away in the next commit.  Needed in this one because empty
> +# modules don't generate anything, defeating this commit's purpose.
> +##
> +{ 'event': 'TARGET-TEMPORARY-DUMMY' }
> --
> 2.17.2
>
>
diff mbox series

Patch

diff --git a/Makefile.objs b/Makefile.objs
index 4a266357a2..95150d7173 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -79,8 +79,7 @@  common-obj-$(CONFIG_FDT) += device_tree.o
 ######################################################################
 # qapi
 
-common-obj-y += qapi/qapi-commands.o
-common-obj-y += $(QAPI_MODULES:%=qapi/qapi-commands-%.o)
+common-obj-y += $(QAPI_COMMON_MODULES:%=qapi/qapi-commands-%.o)
 common-obj-y += qmp.o hmp.o
 endif
 
diff --git a/qapi/Makefile.objs b/qapi/Makefile.objs
index da0000cbae..654321de94 100644
--- a/qapi/Makefile.objs
+++ b/qapi/Makefile.objs
@@ -5,21 +5,27 @@  util-obj-y += opts-visitor.o qapi-clone-visitor.o
 util-obj-y += qmp-event.o
 util-obj-y += qapi-util.o
 
-QAPI_MODULES = block-core block char common crypto introspect job migration
-QAPI_MODULES += misc net rdma rocker run-state sockets tpm trace transaction
-QAPI_MODULES += ui
+QAPI_COMMON_MODULES = block-core block char common crypto introspect
+QAPI_COMMON_MODULES += job migration misc net rdma rocker run-state
+QAPI_COMMON_MODULES += sockets tpm trace transaction ui
+QAPI_TARGET_MODULES = target
+QAPI_MODULES = $(QAPI_COMMON_MODULES) $(QAPI_TARGET_MODULES)
 
 util-obj-y += qapi-builtin-types.o
-util-obj-y += qapi-types.o
-util-obj-y += $(QAPI_MODULES:%=qapi-types-%.o)
+util-obj-y += $(QAPI_COMMON_MODULES:%=qapi-types-%.o)
 util-obj-y += qapi-builtin-visit.o
-util-obj-y += qapi-visit.o
-util-obj-y += $(QAPI_MODULES:%=qapi-visit-%.o)
+util-obj-y += $(QAPI_COMMON_MODULES:%=qapi-visit-%.o)
 util-obj-y += qapi-emit-events.o
-util-obj-y += qapi-events.o
-util-obj-y += $(QAPI_MODULES:%=qapi-events-%.o)
+util-obj-y += $(QAPI_COMMON_MODULES:%=qapi-events-%.o)
 
-common-obj-y += qapi-commands.o
-common-obj-y += $(QAPI_MODULES:%=qapi-commands-%.o)
+common-obj-y += $(QAPI_COMMON_MODULES:%=qapi-commands-%.o)
 
+obj-y += $(QAPI_TARGET_MODULES:%=qapi-types-%.o)
+obj-y += qapi-types.o
+obj-y += $(QAPI_TARGET_MODULES:%=qapi-visit-%.o)
+obj-y += qapi-visit.o
+obj-y += $(QAPI_TARGET_MODULES:%=qapi-events-%.o)
+obj-y += qapi-events.o
+obj-y += $(QAPI_TARGET_MODULES:%=qapi-commands-%.o)
+obj-y += qapi-commands.o
 obj-y += qapi-introspect.o
diff --git a/qapi/qapi-schema.json b/qapi/qapi-schema.json
index 1845aa78ff..db61bfd688 100644
--- a/qapi/qapi-schema.json
+++ b/qapi/qapi-schema.json
@@ -97,3 +97,4 @@ 
 { 'include': 'trace.json' }
 { 'include': 'introspect.json' }
 { 'include': 'misc.json' }
+{ 'include': 'target.json' }
diff --git a/qapi/target.json b/qapi/target.json
new file mode 100644
index 0000000000..8054926293
--- /dev/null
+++ b/qapi/target.json
@@ -0,0 +1,13 @@ 
+# -*- Mode: Python -*-
+#
+
+##
+# = Target-specific commands & events
+##
+
+##
+# @TARGET-TEMPORARY-DUMMY:
+# Will go away in the next commit.  Needed in this one because empty
+# modules don't generate anything, defeating this commit's purpose.
+##
+{ 'event': 'TARGET-TEMPORARY-DUMMY' }