[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 02/28] qapi: Improve use of qmp/types.h
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH v4 02/28] qapi: Improve use of qmp/types.h |
Date: |
Wed, 18 May 2016 22:40:48 -0600 |
'qobject-json.h' is not a QObject subtype; include this file
directly in .c files that are using it, rather than abusing
qmp/types.h for that purpose.
Meanwhile, for files that include a list of individual QObject
subtypes, it's easier to just use qmp/types.h for that purpose.
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
---
v4: no change
v3: no change
v2: no change
---
include/qapi/qmp/types.h | 1 -
hw/pci/pcie_aer.c | 1 +
monitor.c | 6 +-----
qapi/qmp-dispatch.c | 1 +
qobject/json-parser.c | 7 +------
qobject/qobject-json.c | 6 +-----
qobject/qobject.c | 7 +------
tests/check-qobject-json.c | 7 +------
tests/test-qmp-input-strict.c | 1 +
tests/test-qmp-input-visitor.c | 1 +
tests/test-qmp-output-visitor.c | 1 +
tests/test-visitor-serialization.c | 1 +
12 files changed, 11 insertions(+), 29 deletions(-)
diff --git a/include/qapi/qmp/types.h b/include/qapi/qmp/types.h
index 9109eda..f21ecf4 100644
--- a/include/qapi/qmp/types.h
+++ b/include/qapi/qmp/types.h
@@ -20,6 +20,5 @@
#include "qapi/qmp/qstring.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qlist.h"
-#include "qapi/qmp/qobject-json.h"
#endif /* QEMU_OBJECTS_H */
diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
index e2d4e68..63163a6 100644
--- a/hw/pci/pcie_aer.c
+++ b/hw/pci/pcie_aer.c
@@ -21,6 +21,7 @@
#include "qemu/osdep.h"
#include "sysemu/sysemu.h"
#include "qapi/qmp/types.h"
+#include "qapi/qmp/qobject-json.h"
#include "monitor/monitor.h"
#include "hw/pci/pci_bridge.h"
#include "hw/pci/pcie.h"
diff --git a/monitor.c b/monitor.c
index c1bbc75..2f56488 100644
--- a/monitor.c
+++ b/monitor.c
@@ -52,12 +52,8 @@
#include "qemu/acl.h"
#include "sysemu/tpm.h"
#include "qapi/qmp/qerror.h"
-#include "qapi/qmp/qint.h"
-#include "qapi/qmp/qfloat.h"
-#include "qapi/qmp/qlist.h"
-#include "qapi/qmp/qbool.h"
-#include "qapi/qmp/qstring.h"
#include "qapi/qmp/qobject-json.h"
+#include "qapi/qmp/types.h"
#include "qapi/qmp/json-streamer.h"
#include "qapi/qmp/json-parser.h"
#include <qom/object_interfaces.h>
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index 08faf85..1d739cb 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -16,6 +16,7 @@
#include "qapi/qmp/types.h"
#include "qapi/qmp/dispatch.h"
#include "qapi/qmp/json-parser.h"
+#include "qapi/qmp/qobject-json.h"
#include "qapi-types.h"
#include "qapi/qmp/qerror.h"
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index 67ed727..c18e48a 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -14,12 +14,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
-#include "qapi/qmp/qstring.h"
-#include "qapi/qmp/qint.h"
-#include "qapi/qmp/qdict.h"
-#include "qapi/qmp/qlist.h"
-#include "qapi/qmp/qfloat.h"
-#include "qapi/qmp/qbool.h"
+#include "qapi/qmp/types.h"
#include "qapi/qmp/json-parser.h"
#include "qapi/qmp/json-lexer.h"
#include "qapi/qmp/json-streamer.h"
diff --git a/qobject/qobject-json.c b/qobject/qobject-json.c
index bcc3f6e..24e7d80 100644
--- a/qobject/qobject-json.c
+++ b/qobject/qobject-json.c
@@ -16,12 +16,8 @@
#include "qapi/qmp/json-parser.h"
#include "qapi/qmp/json-streamer.h"
#include "qapi/qmp/qobject-json.h"
-#include "qapi/qmp/qint.h"
-#include "qapi/qmp/qlist.h"
-#include "qapi/qmp/qbool.h"
-#include "qapi/qmp/qfloat.h"
-#include "qapi/qmp/qdict.h"
#include "qemu/unicode.h"
+#include "qapi/qmp/types.h"
typedef struct JSONParsingState
{
diff --git a/qobject/qobject.c b/qobject/qobject.c
index cd41fb9..fe4fa10 100644
--- a/qobject/qobject.c
+++ b/qobject/qobject.c
@@ -9,12 +9,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
-#include "qapi/qmp/qbool.h"
-#include "qapi/qmp/qdict.h"
-#include "qapi/qmp/qfloat.h"
-#include "qapi/qmp/qint.h"
-#include "qapi/qmp/qlist.h"
-#include "qapi/qmp/qstring.h"
+#include "qapi/qmp/types.h"
static void (*qdestroy[QTYPE__MAX])(QObject *) = {
[QTYPE_NONE] = NULL, /* No such object exists */
diff --git a/tests/check-qobject-json.c b/tests/check-qobject-json.c
index dc721a8..d889501 100644
--- a/tests/check-qobject-json.c
+++ b/tests/check-qobject-json.c
@@ -13,12 +13,7 @@
#include "qemu/osdep.h"
#include <glib.h>
-#include "qapi/qmp/qstring.h"
-#include "qapi/qmp/qint.h"
-#include "qapi/qmp/qdict.h"
-#include "qapi/qmp/qlist.h"
-#include "qapi/qmp/qfloat.h"
-#include "qapi/qmp/qbool.h"
+#include "qapi/qmp/types.h"
#include "qapi/qmp/qobject-json.h"
#include "qemu-common.h"
diff --git a/tests/test-qmp-input-strict.c b/tests/test-qmp-input-strict.c
index 4602529..edb4b31 100644
--- a/tests/test-qmp-input-strict.c
+++ b/tests/test-qmp-input-strict.c
@@ -20,6 +20,7 @@
#include "test-qapi-types.h"
#include "test-qapi-visit.h"
#include "qapi/qmp/types.h"
+#include "qapi/qmp/qobject-json.h"
#include "test-qmp-introspect.h"
#include "qmp-introspect.h"
#include "qapi-visit.h"
diff --git a/tests/test-qmp-input-visitor.c b/tests/test-qmp-input-visitor.c
index cee07ce..d02306c 100644
--- a/tests/test-qmp-input-visitor.c
+++ b/tests/test-qmp-input-visitor.c
@@ -19,6 +19,7 @@
#include "test-qapi-types.h"
#include "test-qapi-visit.h"
#include "qapi/qmp/types.h"
+#include "qapi/qmp/qobject-json.h"
typedef struct TestInputVisitorData {
QObject *obj;
diff --git a/tests/test-qmp-output-visitor.c b/tests/test-qmp-output-visitor.c
index 1f80e69..9103fef 100644
--- a/tests/test-qmp-output-visitor.c
+++ b/tests/test-qmp-output-visitor.c
@@ -19,6 +19,7 @@
#include "test-qapi-types.h"
#include "test-qapi-visit.h"
#include "qapi/qmp/types.h"
+#include "qapi/qmp/qobject-json.h"
typedef struct TestOutputVisitorData {
QmpOutputVisitor *qov;
diff --git a/tests/test-visitor-serialization.c
b/tests/test-visitor-serialization.c
index 7b14b5a..d102fa6 100644
--- a/tests/test-visitor-serialization.c
+++ b/tests/test-visitor-serialization.c
@@ -20,6 +20,7 @@
#include "test-qapi-visit.h"
#include "qapi/error.h"
#include "qapi/qmp/types.h"
+#include "qapi/qmp/qobject-json.h"
#include "qapi/qmp-input-visitor.h"
#include "qapi/qmp-output-visitor.h"
#include "qapi/string-input-visitor.h"
--
2.5.5
- [Qemu-devel] [PATCH v4 00/28] Add qapi-to-JSON and clone visitors, Eric Blake, 2016/05/19
- [Qemu-devel] [PATCH v4 05/28] qapi: Add new visit_free() function, Eric Blake, 2016/05/19
- [Qemu-devel] [PATCH v4 02/28] qapi: Improve use of qmp/types.h,
Eric Blake <=
- [Qemu-devel] [PATCH v4 03/28] qemu-img: Don't leak errors when outputting JSON, Eric Blake, 2016/05/19
- [Qemu-devel] [PATCH v4 06/28] opts-visitor: Favor new visit_free() function, Eric Blake, 2016/05/19
- [Qemu-devel] [PATCH v4 08/28] qmp-input-visitor: Favor new visit_free() function, Eric Blake, 2016/05/19
- [Qemu-devel] [PATCH v4 07/28] string-input-visitor: Favor new visit_free() function, Eric Blake, 2016/05/19
- [Qemu-devel] [PATCH v4 01/28] qapi: Rename (one) qjson.h to qobject-json.h, Eric Blake, 2016/05/19
- [Qemu-devel] [PATCH v4 09/28] string-output-visitor: Favor new visit_free() function, Eric Blake, 2016/05/19
- [Qemu-devel] [PATCH v4 04/28] qapi: Add parameter to visit_end_*, Eric Blake, 2016/05/19
- [Qemu-devel] [PATCH v4 15/28] replay: Use new QAPI cloning, Eric Blake, 2016/05/19
- [Qemu-devel] [PATCH v4 11/28] tests: Factor out common code in qapi output tests, Eric Blake, 2016/05/19
- [Qemu-devel] [PATCH v4 10/28] qmp-output-visitor: Favor new visit_free() function, Eric Blake, 2016/05/19