Skip to content

Commit

Permalink
qapi: Improve use of qmp/types.h
Browse files Browse the repository at this point in the history
'qjson.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 <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
  • Loading branch information
ebblake authored and Markus Armbruster committed Jul 6, 2016
1 parent 791b7d2 commit c7eb39c
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 30 deletions.
1 change: 1 addition & 0 deletions hw/pci/pcie_aer.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "qemu/osdep.h"
#include "sysemu/sysemu.h"
#include "qapi/qmp/types.h"
#include "qapi/qmp/qjson.h"
#include "monitor/monitor.h"
#include "hw/pci/pci_bridge.h"
#include "hw/pci/pcie.h"
Expand Down
1 change: 0 additions & 1 deletion include/qapi/qmp/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@
#include "qapi/qmp/qstring.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qjson.h"

#endif /* QEMU_OBJECTS_H */
6 changes: 1 addition & 5 deletions monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@
#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/types.h"
#include "qapi/qmp/qjson.h"
#include "qapi/qmp/json-streamer.h"
#include "qapi/qmp/json-parser.h"
Expand Down
1 change: 1 addition & 0 deletions qapi/qmp-dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "qapi/qmp/types.h"
#include "qapi/qmp/dispatch.h"
#include "qapi/qmp/json-parser.h"
#include "qapi/qmp/qjson.h"
#include "qapi-types.h"
#include "qapi/qmp/qerror.h"

Expand Down
7 changes: 1 addition & 6 deletions qobject/json-parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 1 addition & 5 deletions qobject/qjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
#include "qapi/qmp/json-parser.h"
#include "qapi/qmp/json-streamer.h"
#include "qapi/qmp/qjson.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 "qapi/qmp/types.h"
#include "qemu/unicode.h"

typedef struct JSONParsingState
Expand Down
7 changes: 1 addition & 6 deletions qobject/qobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
8 changes: 1 addition & 7 deletions tests/check-qjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@
*/
#include "qemu/osdep.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/qjson.h"

#include "qemu-common.h"

static void escaped_string(void)
Expand Down
1 change: 1 addition & 0 deletions tests/test-qmp-input-strict.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "test-qapi-types.h"
#include "test-qapi-visit.h"
#include "qapi/qmp/types.h"
#include "qapi/qmp/qjson.h"
#include "test-qmp-introspect.h"
#include "qmp-introspect.h"
#include "qapi-visit.h"
Expand Down
1 change: 1 addition & 0 deletions tests/test-qmp-input-visitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "test-qapi-types.h"
#include "test-qapi-visit.h"
#include "qapi/qmp/types.h"
#include "qapi/qmp/qjson.h"

typedef struct TestInputVisitorData {
QObject *obj;
Expand Down
1 change: 1 addition & 0 deletions tests/test-qmp-output-visitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "test-qapi-types.h"
#include "test-qapi-visit.h"
#include "qapi/qmp/types.h"
#include "qapi/qmp/qjson.h"

typedef struct TestOutputVisitorData {
QmpOutputVisitor *qov;
Expand Down
1 change: 1 addition & 0 deletions tests/test-visitor-serialization.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "test-qapi-visit.h"
#include "qapi/error.h"
#include "qapi/qmp/types.h"
#include "qapi/qmp/qjson.h"
#include "qapi/qmp-input-visitor.h"
#include "qapi/qmp-output-visitor.h"
#include "qapi/string-input-visitor.h"
Expand Down

0 comments on commit c7eb39c

Please sign in to comment.