All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/5]: QMP patches for 1.0
@ 2011-11-17 17:18 Luiz Capitulino
  2011-11-17 17:18 ` [Qemu-devel] [PATCH 1/5] qapi: Check for negative enum values Luiz Capitulino
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Luiz Capitulino @ 2011-11-17 17:18 UTC (permalink / raw)
  To: aliguori; +Cc: qemu-devel

Anthony,

This pull contains a fix for the enum type handling plus Michael's Makefile
fixes.

The changes (since 3f5bd4e1b874590d3d76e031530799a4610da6dc) are available
in the following repository:

    git://repo.or.cz/qemu/qmp-unstable.git queue/qmp-1.0

Luiz Capitulino (1):
      qapi: Check for negative enum values

Michael S. Tsirkin (4):
      Makefile: remove more generated files on clean
      Makefile: fix dependencies for generated .h, .c
      Makefile: dependency fix
      Makefile: fix qga dependencies

 Makefile                  |   47 +++++++++++++++++++++++---------------------
 qapi/qmp-output-visitor.c |    2 +-
 2 files changed, 26 insertions(+), 23 deletions(-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 1/5] qapi: Check for negative enum values
  2011-11-17 17:18 [Qemu-devel] [PULL 0/5]: QMP patches for 1.0 Luiz Capitulino
@ 2011-11-17 17:18 ` Luiz Capitulino
  2011-11-17 17:18 ` [Qemu-devel] [PATCH 2/5] Makefile: remove more generated files on clean Luiz Capitulino
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Luiz Capitulino @ 2011-11-17 17:18 UTC (permalink / raw)
  To: aliguori; +Cc: qemu-devel

We don't currently check for negative enum values in qmp_output_type_enum(),
this will very likely generate a segfault when triggered.

However, it _seems_ that no code in tree can trigger this today.

Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 qapi/qmp-output-visitor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qapi/qmp-output-visitor.c b/qapi/qmp-output-visitor.c
index d67724e..f76d015 100644
--- a/qapi/qmp-output-visitor.c
+++ b/qapi/qmp-output-visitor.c
@@ -190,7 +190,7 @@ static void qmp_output_type_enum(Visitor *v, int *obj, const char *strings[],
 
     assert(strings);
     while (strings[i++] != NULL);
-    if (value >= i - 1) {
+    if (value < 0 || value >= i - 1) {
         error_set(errp, QERR_INVALID_PARAMETER, name ? name : "null");
         return;
     }
-- 
1.7.8.rc2.3.g0911

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 2/5] Makefile: remove more generated files on clean
  2011-11-17 17:18 [Qemu-devel] [PULL 0/5]: QMP patches for 1.0 Luiz Capitulino
  2011-11-17 17:18 ` [Qemu-devel] [PATCH 1/5] qapi: Check for negative enum values Luiz Capitulino
@ 2011-11-17 17:18 ` Luiz Capitulino
  2011-11-17 17:18 ` [Qemu-devel] [PATCH 3/5] Makefile: fix dependencies for generated .h, .c Luiz Capitulino
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Luiz Capitulino @ 2011-11-17 17:18 UTC (permalink / raw)
  To: aliguori; +Cc: qemu-devel, Michael S. Tsirkin

From: "Michael S. Tsirkin" <mst@redhat.com>

make clean missed the source qmp files generated
by python. Fix that.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 168093c..b335f2a 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@ ifeq ($(TRACE_BACKEND),dtrace)
 GENERATED_HEADERS += trace-dtrace.h
 endif
 GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
+GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
 
 ifneq ($(wildcard config-host.mak),)
 # Put the all: rule here so that config-host.mak can contain dependencies.
@@ -227,6 +228,7 @@ clean:
 	rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
 	rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
 	rm -f trace-dtrace.h trace-dtrace.h-timestamp
+	rm -f $(GENERATED_SOURCES)
 	rm -rf $(qapi-dir)
 	$(MAKE) -C tests clean
 	for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \
-- 
1.7.8.rc2.3.g0911

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 3/5] Makefile: fix dependencies for generated .h, .c
  2011-11-17 17:18 [Qemu-devel] [PULL 0/5]: QMP patches for 1.0 Luiz Capitulino
  2011-11-17 17:18 ` [Qemu-devel] [PATCH 1/5] qapi: Check for negative enum values Luiz Capitulino
  2011-11-17 17:18 ` [Qemu-devel] [PATCH 2/5] Makefile: remove more generated files on clean Luiz Capitulino
@ 2011-11-17 17:18 ` Luiz Capitulino
  2011-11-17 17:18 ` [Qemu-devel] [PATCH 4/5] Makefile: dependency fix Luiz Capitulino
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Luiz Capitulino @ 2011-11-17 17:18 UTC (permalink / raw)
  To: aliguori; +Cc: qemu-devel, Michael S. Tsirkin

From: "Michael S. Tsirkin" <mst@redhat.com>

We have a single rule generating .c and .h files,
so .h doesn't depend on .c: both depend on the
source schema.

Fix Makefile to reflect that - without this,
if .c is there and .h is missing, Makefile does
not know how to remake .h and assumes it's
a dummy target, triggering endless rebuilds.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 Makefile |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index b335f2a..a3c4bb4 100644
--- a/Makefile
+++ b/Makefile
@@ -172,34 +172,34 @@ qapi-dir := qapi-generated
 test-visitor.o test-qmp-commands.o qemu-ga$(EXESUF): QEMU_CFLAGS += -I $(qapi-dir)
 qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
 
-$(qapi-dir)/test-qapi-types.c: $(qapi-dir)/test-qapi-types.h
-$(qapi-dir)/test-qapi-types.h: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
+$(qapi-dir)/test-qapi-types.c $(qapi-dir)/test-qapi-types.h :\
+$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
-$(qapi-dir)/test-qapi-visit.c: $(qapi-dir)/test-qapi-visit.h
-$(qapi-dir)/test-qapi-visit.h: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
+$(qapi-dir)/test-qapi-visit.c $(qapi-dir)/test-qapi-visit.h :\
+$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
-$(qapi-dir)/test-qmp-commands.h: $(qapi-dir)/test-qmp-marshal.c
-$(qapi-dir)/test-qmp-marshal.c: $(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
+$(qapi-dir)/test-qmp-commands.h $(qapi-dir)/test-qmp-marshal.c :\
+$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
 	    $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
 
-$(qapi-dir)/qga-qapi-types.c: $(qapi-dir)/qga-qapi-types.h
-$(qapi-dir)/qga-qapi-types.h: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-types.py
+$(qapi-dir)/qga-qapi-types.c $(qapi-dir)/qga-qapi-types.h :\
+$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-types.py
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
-$(qapi-dir)/qga-qapi-visit.c: $(qapi-dir)/qga-qapi-visit.h
-$(qapi-dir)/qga-qapi-visit.h: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-visit.py
+$(qapi-dir)/qga-qapi-visit.c $(qapi-dir)/qga-qapi-visit.h :\
+$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-visit.py
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
-$(qapi-dir)/qga-qmp-commands.h: $(qapi-dir)/qga-qmp-marshal.c
-$(qapi-dir)/qga-qmp-marshal.c: $(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-commands.py
+$(qapi-dir)/qga-qmp-commands.h $(qapi-dir)/qga-qmp-marshal.c :\
+$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-commands.py
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
 
-qapi-types.c: qapi-types.h
-qapi-types.h: $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py
+qapi-types.c qapi-types.h :\
+$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py -o "." < $<, "  GEN   $@")
-qapi-visit.c: qapi-visit.h
-qapi-visit.h: $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py
+qapi-visit.c qapi-visit.h :\
+$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py -o "."  < $<, "  GEN   $@")
-qmp-commands.h: qmp-marshal.c
-qmp-marshal.c: $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py
+qmp-commands.h qmp-marshal.c :\
+$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py -m -o "." < $<, "  GEN   $@")
 
 test-visitor.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h) $(qapi-obj-y)
-- 
1.7.8.rc2.3.g0911

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 4/5] Makefile: dependency fix
  2011-11-17 17:18 [Qemu-devel] [PULL 0/5]: QMP patches for 1.0 Luiz Capitulino
                   ` (2 preceding siblings ...)
  2011-11-17 17:18 ` [Qemu-devel] [PATCH 3/5] Makefile: fix dependencies for generated .h, .c Luiz Capitulino
@ 2011-11-17 17:18 ` Luiz Capitulino
  2011-11-17 17:18 ` [Qemu-devel] [PATCH 5/5] Makefile: fix qga dependencies Luiz Capitulino
  2011-11-22  0:20 ` [Qemu-devel] [PULL 0/5]: QMP patches for 1.0 Anthony Liguori
  5 siblings, 0 replies; 7+ messages in thread
From: Luiz Capitulino @ 2011-11-17 17:18 UTC (permalink / raw)
  To: aliguori; +Cc: qemu-devel, Michael S. Tsirkin

From: "Michael S. Tsirkin" <mst@redhat.com>

qga/guest-agent-commands.c includes qga-qmp-commands.h,
but it was missing in its dependencies. Add it in QGALIB_GEN.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index a3c4bb4..c7f2cbd 100644
--- a/Makefile
+++ b/Makefile
@@ -208,7 +208,7 @@ test-visitor: test-visitor.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qap
 test-qmp-commands.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h test-qmp-marshal.c test-qmp-commands.h) $(qapi-obj-y)
 test-qmp-commands: test-qmp-commands.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o $(qapi-dir)/test-qmp-marshal.o module.o
 
-QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.c qga-qapi-types.h qga-qapi-visit.c qga-qmp-marshal.c)
+QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.c qga-qapi-types.h qga-qapi-visit.c qga-qmp-marshal.c qga-qmp-commands.h)
 $(QGALIB_GEN): $(GENERATED_HEADERS)
 $(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
 
-- 
1.7.8.rc2.3.g0911

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH 5/5] Makefile: fix qga dependencies
  2011-11-17 17:18 [Qemu-devel] [PULL 0/5]: QMP patches for 1.0 Luiz Capitulino
                   ` (3 preceding siblings ...)
  2011-11-17 17:18 ` [Qemu-devel] [PATCH 4/5] Makefile: dependency fix Luiz Capitulino
@ 2011-11-17 17:18 ` Luiz Capitulino
  2011-11-22  0:20 ` [Qemu-devel] [PULL 0/5]: QMP patches for 1.0 Anthony Liguori
  5 siblings, 0 replies; 7+ messages in thread
From: Luiz Capitulino @ 2011-11-17 17:18 UTC (permalink / raw)
  To: aliguori; +Cc: qemu-devel, Michael S. Tsirkin

From: "Michael S. Tsirkin" <mst@redhat.com>

.c files include .h files, so .o depends on .h,
and the linked result depends on .o.
We got it wrong for qga rules, fix it up.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 Makefile |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index c7f2cbd..7c93739 100644
--- a/Makefile
+++ b/Makefile
@@ -208,11 +208,12 @@ test-visitor: test-visitor.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qap
 test-qmp-commands.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h test-qmp-marshal.c test-qmp-commands.h) $(qapi-obj-y)
 test-qmp-commands: test-qmp-commands.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o $(qapi-dir)/test-qmp-marshal.o module.o
 
-QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.c qga-qapi-types.h qga-qapi-visit.c qga-qmp-marshal.c qga-qmp-commands.h)
-$(QGALIB_GEN): $(GENERATED_HEADERS)
-$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
+QGALIB_OBJ=$(addprefix $(qapi-dir)/, qga-qapi-types.o qga-qapi-visit.o qga-qmp-marshal.o)
+QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
+$(QGALIB_OBJ): $(QGALIB_GEN) $(GENERATED_HEADERS)
+$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) $(GENERATED_HEADERS)
 
-qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qobject-obj-y) $(version-obj-y) $(addprefix $(qapi-dir)/, qga-qapi-visit.o qga-qapi-types.o qga-qmp-marshal.o)
+qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qobject-obj-y) $(version-obj-y) $(QGALIB_OBJ)
 
 QEMULIBS=libhw32 libhw64 libuser libdis libdis-user
 
-- 
1.7.8.rc2.3.g0911

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PULL 0/5]: QMP patches for 1.0
  2011-11-17 17:18 [Qemu-devel] [PULL 0/5]: QMP patches for 1.0 Luiz Capitulino
                   ` (4 preceding siblings ...)
  2011-11-17 17:18 ` [Qemu-devel] [PATCH 5/5] Makefile: fix qga dependencies Luiz Capitulino
@ 2011-11-22  0:20 ` Anthony Liguori
  5 siblings, 0 replies; 7+ messages in thread
From: Anthony Liguori @ 2011-11-22  0:20 UTC (permalink / raw)
  To: Luiz Capitulino; +Cc: qemu-devel

On 11/17/2011 11:18 AM, Luiz Capitulino wrote:
> Anthony,
>
> This pull contains a fix for the enum type handling plus Michael's Makefile
> fixes.

Pulled.  Thanks.

Regards,

Anthony Liguori

>
> The changes (since 3f5bd4e1b874590d3d76e031530799a4610da6dc) are available
> in the following repository:
>
>      git://repo.or.cz/qemu/qmp-unstable.git queue/qmp-1.0
>
> Luiz Capitulino (1):
>        qapi: Check for negative enum values
>
> Michael S. Tsirkin (4):
>        Makefile: remove more generated files on clean
>        Makefile: fix dependencies for generated .h, .c
>        Makefile: dependency fix
>        Makefile: fix qga dependencies
>
>   Makefile                  |   47 +++++++++++++++++++++++---------------------
>   qapi/qmp-output-visitor.c |    2 +-
>   2 files changed, 26 insertions(+), 23 deletions(-)
>
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-11-22  0:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17 17:18 [Qemu-devel] [PULL 0/5]: QMP patches for 1.0 Luiz Capitulino
2011-11-17 17:18 ` [Qemu-devel] [PATCH 1/5] qapi: Check for negative enum values Luiz Capitulino
2011-11-17 17:18 ` [Qemu-devel] [PATCH 2/5] Makefile: remove more generated files on clean Luiz Capitulino
2011-11-17 17:18 ` [Qemu-devel] [PATCH 3/5] Makefile: fix dependencies for generated .h, .c Luiz Capitulino
2011-11-17 17:18 ` [Qemu-devel] [PATCH 4/5] Makefile: dependency fix Luiz Capitulino
2011-11-17 17:18 ` [Qemu-devel] [PATCH 5/5] Makefile: fix qga dependencies Luiz Capitulino
2011-11-22  0:20 ` [Qemu-devel] [PULL 0/5]: QMP patches for 1.0 Anthony Liguori

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.