diff mbox

qapi: Add includes from qapi/ as dependencies

Message ID 1402168324-28931-1-git-send-email-mreitz@redhat.com
State New
Headers show

Commit Message

Max Reitz June 7, 2014, 7:12 p.m. UTC
qapi-schema.json has been split into three smaller JSON files in qapi/.
Add them as dependencies for the code generation in the Makefile, so
changes to them will result in a rebuilt of all QAPI-dependent code.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 Makefile | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Benoît Canet June 7, 2014, 7:20 p.m. UTC | #1
The Saturday 07 Jun 2014 à 21:12:04 (+0200), Max Reitz wrote :
> qapi-schema.json has been split into three smaller JSON files in qapi/.
> Add them as dependencies for the code generation in the Makefile, so
> changes to them will result in a rebuilt of all QAPI-dependent code.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  Makefile | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index d830483..7837865 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -246,18 +246,21 @@ $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
>  		$(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
>  		"  GEN   $@")
>  
> +qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
> +               $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json
> +
>  qapi-types.c qapi-types.h :\
> -$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
> +$(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
>  	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
>  		$(gen-out-type) -o "." -b -i $<, \
>  		"  GEN   $@")
>  qapi-visit.c qapi-visit.h :\
> -$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
> +$(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
>  	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
>  		$(gen-out-type) -o "." -b -i $<, \
>  		"  GEN   $@")
>  qmp-commands.h qmp-marshal.c :\
> -$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
> +$(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
>  	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
>  		$(gen-out-type) -o "." -m -i $<, \
>  		"  GEN   $@")
> -- 
> 2.0.0
> 

Seems correct.
Thanks for fixing this.

Reviewed-by: Benoit Canet <benoit@irqsave.net>
Fam Zheng June 12, 2014, 2:53 a.m. UTC | #2
On Sat, 06/07 21:12, Max Reitz wrote:
> qapi-schema.json has been split into three smaller JSON files in qapi/.
> Add them as dependencies for the code generation in the Makefile, so
> changes to them will result in a rebuilt of all QAPI-dependent code.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  Makefile | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index d830483..7837865 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -246,18 +246,21 @@ $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
>  		$(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
>  		"  GEN   $@")
>  
> +qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
> +               $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json
> +
>  qapi-types.c qapi-types.h :\
> -$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
> +$(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
>  	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
>  		$(gen-out-type) -o "." -b -i $<, \
>  		"  GEN   $@")
>  qapi-visit.c qapi-visit.h :\
> -$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
> +$(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
>  	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
>  		$(gen-out-type) -o "." -b -i $<, \
>  		"  GEN   $@")
>  qmp-commands.h qmp-marshal.c :\
> -$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
> +$(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
>  	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
>  		$(gen-out-type) -o "." -m -i $<, \
>  		"  GEN   $@")
> -- 
> 2.0.0
> 

Reviewed-by: Fam Zheng <famz@redhat.com>
Eric Blake June 13, 2014, 7:31 p.m. UTC | #3
On 06/07/2014 01:12 PM, Max Reitz wrote:
> qapi-schema.json has been split into three smaller JSON files in qapi/.
> Add them as dependencies for the code generation in the Makefile, so
> changes to them will result in a rebuilt of all QAPI-dependent code.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  Makefile | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

While looking at this, I realized the MAINTAINERS file may be a bit out
of date.  We currently have:

QAPI
M: Luiz Capitulino <lcapitulino@redhat.com>
M: Michael Roth <mdroth@linux.vnet.ibm.com>
S: Maintained
F: qapi/
T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp

QAPI Schema
M: Eric Blake <eblake@redhat.com>
M: Luiz Capitulino <lcapitulino@redhat.com>
M: Markus Armbruster <armbru@redhat.com>
S: Supported
F: qapi-schema.json
T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp

which means the recent move of contents out of qapi-schema.json into
sub-files under qapi/ inadvertently changed who is the listed maintainer
for that content.
diff mbox

Patch

diff --git a/Makefile b/Makefile
index d830483..7837865 100644
--- a/Makefile
+++ b/Makefile
@@ -246,18 +246,21 @@  $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
 		$(gen-out-type) -o qga/qapi-generated -p "qga-" -i $<, \
 		"  GEN   $@")
 
+qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \
+               $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json
+
 qapi-types.c qapi-types.h :\
-$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
+$(qapi-modules) $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py \
 		$(gen-out-type) -o "." -b -i $<, \
 		"  GEN   $@")
 qapi-visit.c qapi-visit.h :\
-$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
+$(qapi-modules) $(SRC_PATH)/scripts/qapi-visit.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py \
 		$(gen-out-type) -o "." -b -i $<, \
 		"  GEN   $@")
 qmp-commands.h qmp-marshal.c :\
-$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
+$(qapi-modules) $(SRC_PATH)/scripts/qapi-commands.py $(qapi-py)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py \
 		$(gen-out-type) -o "." -m -i $<, \
 		"  GEN   $@")