Skip to content

Commit

Permalink
Include qapi/qmp/qlist.h exactly where needed
Browse files Browse the repository at this point in the history
This cleanup makes the number of objects depending on qapi/qmp/qlist.h
drop from 4551 (out of 4743) to 16 in my "build everything" tree.

While there, separate #include from file comment with a blank line.

Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
Markus Armbruster committed Feb 9, 2018
1 parent 5ee9d2f commit 47e6b29
Show file tree
Hide file tree
Showing 27 changed files with 27 additions and 6 deletions.
1 change: 1 addition & 0 deletions block/qapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "qapi/error.h"
#include "qapi/qobject-output-visitor.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qstring.h"
#include "sysemu/block-backend.h"
Expand Down
1 change: 1 addition & 0 deletions block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "qemu/cutils.h"
#include "qapi/qmp/qstring.h"
#include "qapi/qmp/qjson.h"
#include "qapi/qmp/qlist.h"

/*
* When specifying the image filename use:
Expand Down
1 change: 1 addition & 0 deletions blockdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "qapi-visit.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qobject-output-visitor.h"
#include "sysemu/sysemu.h"
#include "sysemu/iothread.h"
Expand Down
1 change: 0 additions & 1 deletion include/qapi/qmp/json-parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#define QEMU_JSON_PARSER_H

#include "qemu-common.h"
#include "qapi/qmp/qlist.h"

QObject *json_parser_parse(GQueue *tokens, va_list *ap);
QObject *json_parser_parse_err(GQueue *tokens, va_list *ap, Error **errp);
Expand Down
1 change: 0 additions & 1 deletion include/qapi/qmp/qdict.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define QDICT_H

#include "qapi/qmp/qobject.h"
#include "qapi/qmp/qlist.h"
#include "qemu/queue.h"

#define QDICT_BUCKET_MAX 512
Expand Down
1 change: 1 addition & 0 deletions qapi/qobject-input-visitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "qapi/qmp/qjson.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnull.h"
#include "qapi/qmp/qnum.h"
#include "qemu/cutils.h"
Expand Down
1 change: 1 addition & 0 deletions qapi/qobject-output-visitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "qemu/queue.h"
#include "qemu-common.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnull.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qstring.h"
Expand Down
1 change: 1 addition & 0 deletions qobject/json-parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "qapi/error.h"
#include "qemu-common.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnull.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qstring.h"
Expand Down
1 change: 1 addition & 0 deletions qobject/qdict.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnull.h"
#include "qapi/qmp/qstring.h"
#include "qapi/error.h"
Expand Down
1 change: 1 addition & 0 deletions qobject/qjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "qapi/qmp/json-streamer.h"
#include "qapi/qmp/qjson.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnum.h"
#include "qemu/unicode.h"

Expand Down
1 change: 1 addition & 0 deletions qobject/qlit.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "qapi/qmp/qlit.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
Expand Down
1 change: 1 addition & 0 deletions qobject/qobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "qapi/qmp/qnull.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qstring.h"

static void (*qdestroy[QTYPE__MAX])(QObject *) = {
Expand Down
3 changes: 2 additions & 1 deletion tests/check-qdict.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
* See the COPYING.LIB file in the top-level directory.
*/
#include "qemu/osdep.h"

#include "qemu/osdep.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qstring.h"
#include "qapi/error.h"
Expand Down
1 change: 1 addition & 0 deletions tests/check-qlit.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qlit.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qstring.h"
Expand Down
3 changes: 2 additions & 1 deletion tests/check-qobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
* See the COPYING.LIB file in the top-level directory.
*/
#include "qemu/osdep.h"

#include "qemu/osdep.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnull.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qstring.h"
Expand Down
1 change: 1 addition & 0 deletions tests/device-introspect-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "qapi/qmp/qstring.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qlist.h"
#include "libqtest.h"

const char common_args[] = "-nodefaults -machine none";
Expand Down
3 changes: 2 additions & 1 deletion tests/libqtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*
*/

#include "qemu/osdep.h"
#include "libqtest.h"

Expand All @@ -25,6 +25,7 @@
#include "qapi/qmp/json-parser.h"
#include "qapi/qmp/json-streamer.h"
#include "qapi/qmp/qjson.h"
#include "qapi/qmp/qlist.h"

#define MAX_IRQ 256
#define SOCKET_TIMEOUT 50
Expand Down
1 change: 1 addition & 0 deletions tests/numa-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "qemu/osdep.h"
#include "libqtest.h"
#include "qapi/qmp/qlist.h"

static char *make_cli(const char *generic_cli, const char *test_cli)
{
Expand Down
1 change: 1 addition & 0 deletions tests/qmp-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "libqtest.h"
#include "qapi-visit.h"
#include "qapi/error.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qobject-input-visitor.h"
#include "qapi/util.h"
#include "qapi/visitor.h"
Expand Down
1 change: 1 addition & 0 deletions tests/qom-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "qemu/osdep.h"

#include "qemu-common.h"
#include "qapi/qmp/qlist.h"
#include "qemu/cutils.h"
#include "libqtest.h"

Expand Down
1 change: 1 addition & 0 deletions tests/test-keyval.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qstring.h"
#include "qapi/qobject-input-visitor.h"
#include "test-qapi-visit.h"
Expand Down
1 change: 1 addition & 0 deletions tests/test-qga.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <sys/un.h>

#include "libqtest.h"
#include "qapi/qmp/qlist.h"

typedef struct {
char *test_dir;
Expand Down
1 change: 1 addition & 0 deletions tests/test-qobject-output-visitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "qapi/qobject-output-visitor.h"
#include "test-qapi-visit.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnull.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qjson.h"
Expand Down
1 change: 1 addition & 0 deletions tests/test-x86-cpuid-compat.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qbool.h"
#include "libqtest.h"
Expand Down
1 change: 0 additions & 1 deletion ui/vnc-palette.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#ifndef VNC_PALETTE_H
#define VNC_PALETTE_H

#include "qapi/qmp/qlist.h"
#include "qemu/queue.h"

#define VNC_PALETTE_HASH_SIZE 256
Expand Down
1 change: 1 addition & 0 deletions util/keyval.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qstring.h"
#include "qemu/cutils.h"
#include "qemu/option.h"
Expand Down
1 change: 1 addition & 0 deletions util/qemu-config.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qapi/qmp/qlist.h"
#include "qemu-common.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
Expand Down

0 comments on commit 47e6b29

Please sign in to comment.