Skip to content

Commit

Permalink
Include qapi/qmp/qdict.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/qdict.h
drop from 4550 (out of 4743) to 368 in my "build everything" tree.
For qapi/qmp/qobject.h, the number drops from 4552 to 390.

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 47e6b29 commit 452fcdb
Show file tree
Hide file tree
Showing 95 changed files with 92 additions and 17 deletions.
1 change: 1 addition & 0 deletions block.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "module_block.h"
#include "qemu/module.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qjson.h"
Expand Down
1 change: 1 addition & 0 deletions block/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "sysemu/block-backend.h"
#include "crypto/block.h"
#include "qapi/opts-visitor.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qobject-input-visitor.h"
#include "qapi-visit.h"
#include "qapi/error.h"
Expand Down
2 changes: 2 additions & 0 deletions block/curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "qemu/error-report.h"
#include "block/block_int.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
#include "crypto/secret.h"
#include <curl/curl.h>
Expand Down
1 change: 1 addition & 0 deletions block/file-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "block/thread-pool.h"
#include "qemu/iov.h"
#include "block/raw-aio.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"

#include "scsi/pr-manager.h"
Expand Down
1 change: 1 addition & 0 deletions block/file-win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "trace.h"
#include "block/thread-pool.h"
#include "qemu/iov.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
#include <windows.h>
#include <winioctl.h>
Expand Down
1 change: 1 addition & 0 deletions block/gluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <glusterfs/api/glfs.h>
#include "block/block_int.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qemu/uri.h"
#include "qemu/error-report.h"
Expand Down
1 change: 1 addition & 0 deletions block/iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "qemu/uuid.h"
#include "qmp-commands.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
#include "crypto/secret.h"
#include "scsi/utils.h"
Expand Down
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/qdict.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qstring.h"
Expand Down
2 changes: 2 additions & 0 deletions block/qcow.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h"
Expand All @@ -30,6 +31,7 @@
#include "qemu/module.h"
#include "qemu/bswap.h"
#include <zlib.h>
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
#include "crypto/block.h"
#include "migration/blocker.h"
Expand Down
1 change: 1 addition & 0 deletions block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "crypto/secret.h"
#include "qemu/cutils.h"
#include "qapi/qmp/qstring.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qjson.h"
#include "qapi/qmp/qlist.h"

Expand Down
1 change: 1 addition & 0 deletions block/snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "block/snapshot.h"
#include "block/block_int.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qstring.h"

Expand Down
1 change: 1 addition & 0 deletions block/ssh.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "qemu/sockets.h"
#include "qemu/uri.h"
#include "qapi-visit.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
#include "qapi/qobject-input-visitor.h"
#include "qapi/qobject-output-visitor.h"
Expand Down
2 changes: 2 additions & 0 deletions block/vvfat.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include <dirent.h>
#include "qapi/error.h"
Expand All @@ -30,6 +31,7 @@
#include "qemu/bswap.h"
#include "migration/blocker.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
Expand Down
1 change: 1 addition & 0 deletions blockdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "qemu/error-report.h"
#include "qemu/option.h"
#include "qemu/config-file.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qstring.h"
#include "qapi-visit.h"
Expand Down
1 change: 1 addition & 0 deletions device-hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "hw/boards.h"
#include "sysemu/block-backend.h"
#include "sysemu/blockdev.h"
#include "qapi/qmp/qdict.h"
#include "qemu/config-file.h"
#include "sysemu/sysemu.h"
#include "monitor/monitor.h"
Expand Down
1 change: 1 addition & 0 deletions hmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "monitor/qdev.h"
#include "qapi/error.h"
#include "qapi/opts-visitor.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qapi/string-input-visitor.h"
#include "qapi/string-output-visitor.h"
Expand Down
1 change: 0 additions & 1 deletion hmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include "qemu-common.h"
#include "qemu/readline.h"
#include "qapi/qmp/qdict.h"

void hmp_info_name(Monitor *mon, const QDict *qdict);
void hmp_info_version(Monitor *mon, const QDict *qdict);
Expand Down
1 change: 1 addition & 0 deletions hw/pci/pcie_aer.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "qemu/osdep.h"
#include "sysemu/sysemu.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qjson.h"
#include "monitor/monitor.h"
#include "hw/pci/pci_bridge.h"
Expand Down
1 change: 1 addition & 0 deletions hw/s390x/s390-skeys.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "qmp-commands.h"
#include "hw/s390x/storage-keys.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "qemu/error-report.h"
#include "sysemu/kvm.h"
#include "migration/register.h"
Expand Down
1 change: 1 addition & 0 deletions hw/s390x/s390-stattrib.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "qemu/error-report.h"
#include "exec/ram_addr.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"

#define CMMA_BLOCK_SIZE (1 << 10)

Expand Down
1 change: 1 addition & 0 deletions hw/usb/xen-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "hw/xen/xen_backend.h"
#include "monitor/qdev.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"

#include "hw/xen/io/ring.h"
Expand Down
1 change: 1 addition & 0 deletions include/block/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define BLOCK_H

#include "block/aio.h"
#include "qapi-types.h"
#include "qemu/iov.h"
#include "qemu/option.h"
#include "qemu/coroutine.h"
Expand Down
1 change: 1 addition & 0 deletions include/block/dirty-bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define BLOCK_DIRTY_BITMAP_H

#include "qemu-common.h"
#include "qapi-types.h"
#include "qemu/hbitmap.h"

BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs,
Expand Down
1 change: 1 addition & 0 deletions include/hw/block/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define HW_BLOCK_H

#include "qemu-common.h"
#include "qapi-types.h"

/* Configuration */

Expand Down
1 change: 1 addition & 0 deletions include/hw/block/fdc.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define HW_FDC_H

#include "qemu-common.h"
#include "qapi-types.h"

/* fdc.c */
#define MAX_FD 2
Expand Down
1 change: 0 additions & 1 deletion include/hw/loader.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#ifndef LOADER_H
#define LOADER_H
#include "qapi/qmp/qdict.h"
#include "hw/nvram/fw_cfg.h"

/* loader.c */
Expand Down
1 change: 1 addition & 0 deletions include/migration/colo.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define QEMU_COLO_H

#include "qemu-common.h"
#include "qapi-types.h"

void colo_info_init(void);

Expand Down
1 change: 1 addition & 0 deletions include/migration/failover.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define QEMU_FAILOVER_H

#include "qemu-common.h"
#include "qapi-types.h"

void failover_init_state(void);
FailoverStatus failover_set_state(FailoverStatus old_state,
Expand Down
1 change: 0 additions & 1 deletion include/monitor/monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define MONITOR_H

#include "qemu-common.h"
#include "qapi/qmp/qdict.h"
#include "block/block.h"
#include "qemu/readline.h"

Expand Down
2 changes: 1 addition & 1 deletion include/net/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "qemu/queue.h"
#include "qemu-common.h"
#include "qapi/qmp/qdict.h"
#include "qapi-types.h"
#include "qemu/option.h"
#include "net/queue.h"
#include "migration/vmstate.h"
Expand Down
1 change: 0 additions & 1 deletion include/net/slirp.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#define QEMU_NET_SLIRP_H

#include "qemu-common.h"
#include "qapi/qmp/qdict.h"
#include "qemu/option.h"

#ifdef CONFIG_SLIRP
Expand Down
1 change: 0 additions & 1 deletion include/qapi/qmp-event.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#ifndef QMP_EVENT_H
#define QMP_EVENT_H

#include "qapi/qmp/qdict.h"

typedef void (*QMPEventFuncEmit)(unsigned event, QDict *dict, Error **errp);

Expand Down
2 changes: 1 addition & 1 deletion include/qapi/qmp/dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#ifndef QAPI_QMP_DISPATCH_H
#define QAPI_QMP_DISPATCH_H

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

typedef void (QmpCommandFunc)(QDict *, QObject **, Error **);

Expand Down
1 change: 0 additions & 1 deletion include/qemu/config-file.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define QEMU_CONFIG_FILE_H

#include "qemu/option.h"
#include "qapi/qmp/qdict.h"

QemuOptsList *qemu_find_opts(const char *group);
QemuOptsList *qemu_find_opts_err(const char *group, Error **errp);
Expand Down
1 change: 0 additions & 1 deletion include/qemu/option.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#define QEMU_OPTION_H

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

const char *get_opt_name(char *buf, int buf_size, const char *p, char delim);
const char *get_opt_value(char *buf, int buf_size, const char *p);
Expand Down
1 change: 1 addition & 0 deletions include/qemu/throttle.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define THROTTLE_H

#include "qemu-common.h"
#include "qapi-types.h"
#include "qemu/timer.h"

#define THROTTLE_VALUE_MAX 1000000000000000LL
Expand Down
1 change: 0 additions & 1 deletion include/qom/object_interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define OBJECT_INTERFACES_H

#include "qom/object.h"
#include "qapi/qmp/qdict.h"
#include "qapi/visitor.h"

#define TYPE_USER_CREATABLE "user-creatable"
Expand Down
1 change: 0 additions & 1 deletion include/scsi/pr-manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define PR_MANAGER_H

#include "qom/object.h"
#include "qapi/qmp/qdict.h"
#include "qapi/visitor.h"
#include "qom/object_interfaces.h"
#include "block/aio.h"
Expand Down
1 change: 1 addition & 0 deletions include/sysemu/arch_init.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef QEMU_ARCH_INIT_H
#define QEMU_ARCH_INIT_H

#include "qapi-types.h"
#include "qemu/option.h"

enum {
Expand Down
1 change: 0 additions & 1 deletion include/ui/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "ui/qemu-pixman.h"
#include "qom/object.h"
#include "qapi/qmp/qdict.h"
#include "qemu/notify.h"
#include "qemu/error-report.h"

Expand Down
1 change: 1 addition & 0 deletions migration/ram.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define QEMU_MIGRATION_RAM_H

#include "qemu-common.h"
#include "qapi-types.h"
#include "exec/cpu-common.h"

extern MigrationStats ram_counters;
Expand Down
1 change: 1 addition & 0 deletions monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include "sysemu/hw_accel.h"
#include "qemu/acl.h"
#include "sysemu/tpm.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qnum.h"
Expand Down
1 change: 1 addition & 0 deletions net/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "monitor/monitor.h"
#include "qemu-common.h"
#include "qemu/help_option.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
#include "qemu/sockets.h"
Expand Down
2 changes: 2 additions & 0 deletions net/slirp.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include "qemu/osdep.h"
#include "net/slirp.h"

Expand All @@ -41,6 +42,7 @@
#include "sysemu/sysemu.h"
#include "qemu/cutils.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"

static int get_str_sep(char *buf, int buf_size, const char **pp, int sep)
{
Expand Down
1 change: 1 addition & 0 deletions net/tap_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define NET_TAP_INT_H

#include "qemu-common.h"
#include "qapi-types.h"

int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
int vnet_hdr_required, int mq_required, Error **errp);
Expand Down
1 change: 1 addition & 0 deletions qapi/qmp-dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "qapi/error.h"
#include "qapi/qmp/dispatch.h"
#include "qapi/qmp/json-parser.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qjson.h"

static QDict *qmp_dispatch_check_obj(const QObject *request, Error **errp)
Expand Down
Loading

0 comments on commit 452fcdb

Please sign in to comment.