Commit 9af23989 authored by Markus Armbruster's avatar Markus Armbruster Committed by Eric Blake

Include less of the generated modular QAPI headers

In my "build everything" tree, a change to the types in
qapi-schema.json triggers a recompile of about 4800 out of 5100
objects.

The previous commit split up qmp-commands.h, qmp-event.h, qmp-visit.h,
qapi-types.h.  Each of these headers still includes all its shards.
Reduce compile time by including just the shards we actually need.

To illustrate the benefits: adding a type to qapi/migration.json now
recompiles some 2300 instead of 4800 objects.  The next commit will
improve it further.
Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
Message-Id: <20180211093607.27351-24-armbru@redhat.com>
Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
Reviewed-by: 's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
[eblake: rebase to master]
Signed-off-by: 's avatarEric Blake <eblake@redhat.com>
parent 252dc310
......@@ -26,7 +26,6 @@
#include "hw/boards.h"
#include "qapi/error.h"
#include "qapi/visitor.h"
#include "qapi-visit.h"
#include "qemu/config-file.h"
#include "qom/object_interfaces.h"
#include "hw/virtio/virtio-crypto.h"
......
......@@ -9,12 +9,13 @@
* 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 "sysemu/hostmem.h"
#include "hw/boards.h"
#include "qapi/error.h"
#include "qapi-builtin-visit.h"
#include "qapi/visitor.h"
#include "qapi-visit.h"
#include "qemu/config-file.h"
#include "qom/object_interfaces.h"
......
......@@ -41,7 +41,6 @@
#include "qemu/coroutine.h"
#include "block/qapi.h"
#include "qemu/timer.h"
#include "qapi-event.h"
#include "qemu/cutils.h"
#include "qemu/id.h"
......
......@@ -17,8 +17,8 @@
#include "block/throttle-groups.h"
#include "sysemu/blockdev.h"
#include "sysemu/sysemu.h"
#include "qapi-event.h"
#include "qapi/error.h"
#include "qapi/qapi-events-block.h"
#include "qemu/id.h"
#include "qemu/option.h"
#include "trace.h"
......
......@@ -24,9 +24,9 @@
#include "sysemu/block-backend.h"
#include "crypto/block.h"
#include "qapi/opts-visitor.h"
#include "qapi/qapi-visit-crypto.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qobject-input-visitor.h"
#include "qapi-visit.h"
#include "qapi/error.h"
#include "qemu/option.h"
#include "block/crypto.h"
......
......@@ -33,7 +33,7 @@
#include "block/block_int.h"
#include "qemu/module.h"
#include "qemu/option.h"
#include "qapi-visit.h"
#include "qapi/qapi-visit-sockets.h"
#include "qapi/qobject-input-visitor.h"
#include "qapi/qobject-output-visitor.h"
#include "qapi/qmp/qdict.h"
......
......@@ -35,9 +35,9 @@
#include "qemu/uri.h"
#include "qemu/cutils.h"
#include "sysemu/sysemu.h"
#include "qapi/qapi-visit-block-core.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
#include "qapi-visit.h"
#include "qapi/qobject-input-visitor.h"
#include "qapi/qobject-output-visitor.h"
#include <nfsc/libnfs.h>
......
......@@ -27,10 +27,10 @@
#include "block/block_int.h"
#include "block/throttle-groups.h"
#include "block/write-threshold.h"
#include "qmp-commands.h"
#include "qapi-visit.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-block-core.h"
#include "qapi/qobject-output-visitor.h"
#include "qapi/qapi-visit-block-core.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qlist.h"
......
......@@ -30,15 +30,14 @@
#include "block/qcow2.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
#include "qapi/qapi-events-block-core.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
#include "qapi-event.h"
#include "trace.h"
#include "qemu/option_int.h"
#include "qemu/cutils.h"
#include "qemu/bswap.h"
#include "qapi/opts-visitor.h"
#include "qapi-visit.h"
#include "block/crypto.h"
/*
......
......@@ -18,11 +18,11 @@
#include "qemu/option.h"
#include "block/block_int.h"
#include "qapi/error.h"
#include "qapi/qapi-events-block.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qstring.h"
#include "qapi-event.h"
#include "crypto/hash.h"
#define HASH_LENGTH 32
......
......@@ -13,8 +13,8 @@
*/
#include "qemu/osdep.h"
#include "qapi-visit.h"
#include "qapi/error.h"
#include "qapi/qapi-visit-sockets.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qobject-input-visitor.h"
#include "qemu/uri.h"
......
......@@ -34,7 +34,7 @@
#include "qemu/cutils.h"
#include "qemu/sockets.h"
#include "qemu/uri.h"
#include "qapi-visit.h"
#include "qapi/qapi-visit-sockets.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qstring.h"
#include "qapi/qobject-input-visitor.h"
......
......@@ -30,7 +30,7 @@
#include "qemu/thread.h"
#include "sysemu/qtest.h"
#include "qapi/error.h"
#include "qapi-visit.h"
#include "qapi/qapi-visit-block-core.h"
#include "qom/object.h"
#include "qom/object_interfaces.h"
......
......@@ -15,9 +15,9 @@
#include "qemu/coroutine.h"
#include "block/write-threshold.h"
#include "qemu/notify.h"
#include "qapi-event.h"
#include "qapi/error.h"
#include "qmp-commands.h"
#include "qapi/qapi-commands-block-core.h"
#include "qapi/qapi-events-block-core.h"
uint64_t bdrv_write_threshold_get(const BlockDriverState *bs)
{
......
......@@ -14,8 +14,8 @@
#include "sysemu/block-backend.h"
#include "hw/block/block.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-block.h"
#include "sysemu/sysemu.h"
#include "qmp-commands.h"
#include "block/nbd.h"
#include "io/channel-socket.h"
#include "io/net-listener.h"
......
......@@ -40,10 +40,12 @@
#include "qemu/error-report.h"
#include "qemu/option.h"
#include "qemu/config-file.h"
#include "qapi/qapi-commands-block.h"
#include "qapi/qapi-commands-transaction.h"
#include "qapi/qapi-visit-block-core.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qstring.h"
#include "qapi-visit.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qlist.h"
......@@ -51,7 +53,6 @@
#include "sysemu/sysemu.h"
#include "sysemu/iothread.h"
#include "block/block_int.h"
#include "qmp-commands.h"
#include "block/trace.h"
#include "sysemu/arch_init.h"
#include "sysemu/qtest.h"
......
......@@ -30,11 +30,11 @@
#include "block/block_int.h"
#include "sysemu/block-backend.h"
#include "qapi/error.h"
#include "qapi/qapi-events-block-core.h"
#include "qapi/qmp/qerror.h"
#include "qemu/coroutine.h"
#include "qemu/id.h"
#include "qemu/timer.h"
#include "qapi-event.h"
/* Right now, this mutex is only needed to synchronize accesses to job->busy
* and job->sleep_timer, such as concurrent calls to block_job_do_yield and
......
......@@ -25,7 +25,6 @@
#include "qemu/error-report.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi-visit.h"
#include "sysemu/replay.h"
#include "chardev/char-fe.h"
......
......@@ -24,8 +24,8 @@
#include "qemu/osdep.h"
#include "chardev/char.h"
#include "qmp-commands.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-char.h"
#include "qemu/base64.h"
#include "qemu/option.h"
......
......@@ -31,6 +31,7 @@
#include "qemu/option.h"
#include "qapi/error.h"
#include "qapi/clone-visitor.h"
#include "qapi/qapi-visit-sockets.h"
#include "chardev/char-io.h"
......
......@@ -29,9 +29,8 @@
#include "qemu/config-file.h"
#include "qemu/error-report.h"
#include "chardev/char.h"
#include "qmp-commands.h"
#include "qapi-visit.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-char.h"
#include "qapi/qmp/qerror.h"
#include "sysemu/replay.h"
#include "qemu/help_option.h"
......
......@@ -27,6 +27,7 @@
#include "cpu.h"
#include "monitor/monitor.h"
#include "qapi/error.h"
#include "qapi/qapi-events-run-state.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
#include "sysemu/sysemu.h"
......@@ -49,7 +50,6 @@
#include "qemu/bitmap.h"
#include "qemu/seqlock.h"
#include "tcg.h"
#include "qapi-event.h"
#include "hw/nmi.h"
#include "sysemu/replay.h"
#include "hw/boards.h"
......
......@@ -15,7 +15,7 @@
#ifndef QCRYPTO_CIPHERPRIV_H
#define QCRYPTO_CIPHERPRIV_H
#include "qapi-types.h"
#include "qapi/qapi-types-crypto.h"
typedef struct QCryptoCipherDriver QCryptoCipherDriver;
......
......@@ -29,11 +29,11 @@
#include "monitor/qdev.h"
#include "qapi/error.h"
#include "qapi/opts-visitor.h"
#include "qapi-builtin-visit.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qapi/string-input-visitor.h"
#include "qapi/string-output-visitor.h"
#include "qapi-visit.h"
#include "qom/object_interfaces.h"
#include "ui/console.h"
#include "block/nbd.h"
......
......@@ -27,8 +27,8 @@
#include "qemu/config-file.h"
#include "qapi/error.h"
#include "qapi/opts-visitor.h"
#include "qapi/qapi-events-run-state.h"
#include "qapi-visit.h"
#include "qapi-event.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
......
......@@ -12,6 +12,7 @@
#include "sysemu/block-backend.h"
#include "hw/block/block.h"
#include "qapi/error.h"
#include "qapi/qapi-types-block.h"
#include "qemu/error-report.h"
void blkconf_serial(BlockConf *conf, char **serial)
......
......@@ -32,6 +32,7 @@
#include "qemu/osdep.h"
#include "sysemu/block-backend.h"
#include "qapi/qapi-types-block.h"
#include "qemu/bswap.h"
#include "hw/block/block.h"
#include "trace.h"
......
......@@ -15,8 +15,8 @@
#include "qemu/error-report.h"
#include "trace.h"
#include "hw/virtio/virtio-serial.h"
#include "qapi-event.h"
#include "qapi/error.h"
#include "qapi/qapi-events-char.h"
#define TYPE_VIRTIO_CONSOLE_SERIAL_PORT "virtserialport"
#define VIRTIO_CONSOLE(obj) \
......
......@@ -13,7 +13,7 @@
#include "qemu/osdep.h"
#include "hw/boards.h"
#include "qapi/error.h"
#include "qapi-visit.h"
#include "qapi/qapi-visit-common.h"
#include "qapi/visitor.h"
#include "hw/sysbus.h"
#include "sysemu/sysemu.h"
......
......@@ -67,8 +67,8 @@
#include "acpi-build.h"
#include "hw/mem/pc-dimm.h"
#include "qapi/error.h"
#include "qapi/qapi-visit-common.h"
#include "qapi/visitor.h"
#include "qapi-visit.h"
#include "qom/cpu.h"
#include "hw/nmi.h"
#include "hw/i386/intel_iommu.h"
......
......@@ -25,7 +25,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qapi/visitor.h"
#include "qapi-visit.h"
#include "hw/mem/nvdimm.h"
static void nvdimm_get_label_size(Object *obj, Visitor *v, const char *name,
......
......@@ -17,8 +17,8 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qmp-commands.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-rocker.h"
#include "qapi/qmp/qerror.h"
RockerSwitch *qmp_query_rocker(const char *name, Error **errp)
......
......@@ -22,9 +22,9 @@
#include "net/net.h"
#include "net/eth.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-rocker.h"
#include "qemu/iov.h"
#include "qemu/bitops.h"
#include "qmp-commands.h"
#include "rocker.h"
#include "rocker_hw.h"
......
......@@ -16,7 +16,7 @@
#include "qemu/osdep.h"
#include "net/clients.h"
#include "qapi/qapi-types-rocker.h"
#include "rocker.h"
#include "rocker_hw.h"
#include "rocker_fp.h"
......
......@@ -17,9 +17,9 @@
#include "qemu/osdep.h"
#include "net/eth.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-rocker.h"
#include "qemu/iov.h"
#include "qemu/timer.h"
#include "qmp-commands.h"
#include "rocker.h"
#include "rocker_hw.h"
......
......@@ -23,7 +23,7 @@
#include "net/vhost_net.h"
#include "hw/virtio/virtio-bus.h"
#include "qapi/error.h"
#include "qapi-event.h"
#include "qapi/qapi-events-net.h"
#include "hw/virtio/virtio-access.h"
#include "migration/misc.h"
......
......@@ -38,7 +38,6 @@
#include "hw/ppc/spapr_vio.h"
#include "hw/ppc/spapr_rtas.h"
#include "hw/ppc/ppc.h"
#include "qapi-event.h"
#include "hw/boards.h"
#include <libfdt.h>
......
......@@ -38,6 +38,7 @@
#include "migration/blocker.h"
#include "qapi/error.h"
#include "qapi/clone-visitor.h"
#include "qapi/qapi-visit-tpm.h"
#include "chardev/char-fe.h"
#define DEBUG_TPM 0
......
......@@ -30,6 +30,7 @@
#include "tpm_int.h"
#include "hw/hw.h"
#include "qapi/clone-visitor.h"
#include "qapi/qapi-visit-tpm.h"
#include "tpm_util.h"
#define DEBUG_TPM 0
......
......@@ -24,9 +24,9 @@
#include "qemu/config-file.h"
#include "qemu/queue.h"
#include "qapi/error.h"
#include "qapi/qapi-events-run-state.h"
#include "sysemu/sysemu.h"
#include "sysemu/watchdog.h"
#include "qapi-event.h"
#include "hw/nmi.h"
#include "qemu/help_option.h"
#include "qmp-commands.h"
......
......@@ -2,7 +2,7 @@
#define BLOCK_H
#include "block/aio.h"
#include "qapi-types.h"
#include "qapi/qapi-types-block-core.h"
#include "qemu/iov.h"
#include "qemu/coroutine.h"
#include "block/accounting.h"
......
......@@ -2,7 +2,7 @@
#define BLOCK_DIRTY_BITMAP_H
#include "qemu-common.h"
#include "qapi-types.h"
#include "qapi/qapi-types-block-core.h"
#include "qemu/hbitmap.h"
BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs,
......
......@@ -20,7 +20,7 @@
#ifndef NBD_H
#define NBD_H
#include "qapi/qapi-types-block.h"
#include "io/channel-socket.h"
#include "crypto/tlscreds.h"
......
#ifndef QEMU_CHAR_H
#define QEMU_CHAR_H
#include "qapi/qapi-types-char.h"
#include "qemu/main-loop.h"
#include "qemu/bitmap.h"
#include "qom/object.h"
......
......@@ -21,7 +21,7 @@
#ifndef QCRYPTO_CIPHER_H
#define QCRYPTO_CIPHER_H
#include "qapi-types.h"
#include "qapi/qapi-types-crypto.h"
typedef struct QCryptoCipher QCryptoCipher;
......
......@@ -21,7 +21,7 @@
#ifndef QCRYPTO_HASH_H
#define QCRYPTO_HASH_H
#include "qapi-types.h"
#include "qapi/qapi-types-crypto.h"
/* See also "QCryptoHashAlgorithm" defined in qapi/crypto.json */
......
......@@ -12,7 +12,7 @@
#ifndef QCRYPTO_HMAC_H
#define QCRYPTO_HMAC_H
#include "qapi-types.h"
#include "qapi/qapi-types-crypto.h"
typedef struct QCryptoHmac QCryptoHmac;
struct QCryptoHmac {
......
......@@ -21,6 +21,7 @@
#ifndef QCRYPTO_SECRET_H
#define QCRYPTO_SECRET_H
#include "qapi/qapi-types-crypto.h"
#include "qom/object.h"
#define TYPE_QCRYPTO_SECRET "secret"
......
......@@ -21,6 +21,7 @@
#ifndef QCRYPTO_TLSCREDS_H
#define QCRYPTO_TLSCREDS_H
#include "qapi/qapi-types-crypto.h"
#include "qom/object.h"
#ifdef CONFIG_GNUTLS
......
......@@ -12,7 +12,7 @@
#define HW_BLOCK_H
#include "qemu-common.h"
#include "qapi-types.h"
#include "qapi/qapi-types-block-core.h"
/* Configuration */
......
......@@ -2,7 +2,7 @@
#define HW_FDC_H
#include "qemu-common.h"
#include "qapi-types.h"
#include "qapi/qapi-types-block.h"
/* fdc.c */
#define MAX_FD 2
......
......@@ -14,6 +14,7 @@
#define HW_SPAPR_DRC_H
#include <libfdt.h>
#include "qapi/qapi-types-run-state.h"
#include "qom/object.h"
#include "sysemu/sysemu.h"
#include "hw/qdev.h"
......
#ifndef QEMU_QDEV_PROPERTIES_H
#define QEMU_QDEV_PROPERTIES_H
#include "qapi-types.h"
#include "hw/qdev-core.h"
/*** qdev-properties.c ***/
......
......@@ -22,6 +22,7 @@
#define QIO_DNS_RESOLVER_H
#include "qemu-common.h"
#include "qapi/qapi-types-sockets.h"
#include "qom/object.h"
#include "io/task.h"
......
......@@ -14,7 +14,7 @@
#define QEMU_COLO_H
#include "qemu-common.h"
#include "qapi-types.h"
#include "qapi/qapi-types-migration.h"
void colo_info_init(void);
......
......@@ -14,7 +14,7 @@
#define QEMU_FAILOVER_H
#include "qemu-common.h"
#include "qapi-types.h"
#include "qapi/qapi-types-migration.h"
void failover_init_state(void);
FailoverStatus failover_set_state(FailoverStatus old_state,
......
......@@ -13,6 +13,7 @@
#ifndef QEMU_MIGRATION_GLOBAL_STATE_H
#define QEMU_MIGRATION_GLOBAL_STATE_H
#include "qapi/qapi-types-run-state.h"
#include "sysemu/sysemu.h"
void register_global_state(void);
......
......@@ -3,6 +3,7 @@
#include "qemu-common.h"
#include "block/block.h"
#include "qapi-types.h"
#include "qemu/readline.h"
extern Monitor *cur_mon;
......
......@@ -9,6 +9,7 @@
#ifndef QEMU_NET_FILTER_H
#define QEMU_NET_FILTER_H
#include "qapi/qapi-types-net.h"
#include "qom/object.h"
#include "qemu-common.h"
#include "net/queue.h"
......
......@@ -2,7 +2,7 @@
#define QEMU_NET_H
#include "qemu/queue.h"
#include "qapi-types.h"
#include "qapi/qapi-types-net.h"
#include "net/queue.h"
#include "migration/vmstate.h"
......
......@@ -12,7 +12,6 @@
#define QAPI_CLONE_VISITOR_H
#include "qapi/visitor.h"
#include "qapi-visit.h"
/*
* The clone visitor is for direct use only by the QAPI_CLONE() macro;
......
......@@ -115,7 +115,7 @@
#ifndef ERROR_H
#define ERROR_H
#include "qapi-types.h"
#include "qapi/qapi-types-common.h"
/*
* Overall category of an error.
......
......@@ -32,7 +32,7 @@
#ifndef QOBJECT_H
#define QOBJECT_H
#include "qapi-types.h"
#include "qapi-builtin-types.h"
struct QObject {
QType type;
......
......@@ -15,7 +15,7 @@
#ifndef QAPI_VISITOR_H
#define QAPI_VISITOR_H
#include "qapi-types.h"
#include "qapi-builtin-types.h"
/*
* The QAPI schema defines both a set of C data types, and a QMP wire
......
......@@ -9,7 +9,7 @@ int inet_aton(const char *cp, struct in_addr *ia);
#endif /* !_WIN32 */
#include "qapi-types.h"
#include "qapi/qapi-types-sockets.h"
/* misc helpers */
int qemu_socket(int domain, int type, int protocol);
......
......@@ -26,7 +26,7 @@
#define THROTTLE_H
#include "qemu-common.h"
#include "qapi-types.h"
#include "qapi/qapi-types-block-core.h"
#include "qemu/timer.h"
#define THROTTLE_VALUE_MAX 1000000000000000LL
......
......@@ -24,6 +24,7 @@
#include "disas/bfd.h"
#include "exec/hwaddr.h"
#include "exec/memattrs.h"
#include "qapi/qapi-types-run-state.h"
#include "qemu/bitmap.h"
#include "qemu/queue.h"
#include "qemu/thread.h"
......
......@@ -14,7 +14,7 @@
#ifndef QEMU_OBJECT_H
#define QEMU_OBJECT_H
#include "qapi-types.h"
#include "qapi-builtin-types.h"
#include "qemu/queue.h"
struct TypeImpl;
......
......@@ -14,6 +14,8 @@
#ifndef DUMP_H
#define DUMP_H
#include "qapi-types.h"
#define MAKEDUMPFILE_SIGNATURE "makedumpfile"
#define MAX_SIZE_MDF_HEADER (4096) /* max size of makedumpfile_header */
#define TYPE_FLAT_HEADER (1) /* type of flattened format */
......
......@@ -14,6 +14,7 @@
#define SYSEMU_HOSTMEM_H
#include "sysemu/sysemu.h" /* for MAX_NODES */
#include "qapi-types.h"
#include "qom/object.h"
#include "exec/memory.h"
#include "qemu/bitmap.h"
......
......@@ -13,6 +13,7 @@
*/
#include "sysemu.h"
#include "qapi-types.h"