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: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180211093607.27351-24-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[eblake: rebase to master]
Signed-off-by: Eric Blake <eblake@redhat.com>
diff --git a/backends/cryptodev.c b/backends/cryptodev.c
index d0dff1a..f35be37 100644
--- a/backends/cryptodev.c
+++ b/backends/cryptodev.c
@@ -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"
diff --git a/backends/hostmem.c b/backends/hostmem.c
index 8aa0412..74fc04a 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -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"
diff --git a/block.c b/block.c
index 628910f..c205320 100644
--- a/block.c
+++ b/block.c
@@ -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"
diff --git a/block/block-backend.c b/block/block-backend.c
index 0266ac9..94ffbb6 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -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"
diff --git a/block/crypto.c b/block/crypto.c
index 3df6694..aeac482 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -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"
diff --git a/block/nbd.c b/block/nbd.c
index 69b5fd5..d4e4172 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -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"
diff --git a/block/nfs.c b/block/nfs.c
index 6576a73..bbdb4fa 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -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>
diff --git a/block/qapi.c b/block/qapi.c
index 1fdeb1e..4c9923d 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -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"
diff --git a/block/qcow2.c b/block/qcow2.c
index fd79c0e..3dd098b 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -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"
/*
diff --git a/block/quorum.c b/block/quorum.c
index 19f1c34..14333c1 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -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
diff --git a/block/sheepdog.c b/block/sheepdog.c
index ac02b10..2152230 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -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"
diff --git a/block/ssh.c b/block/ssh.c
index b63addc..b11d4c5 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -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"
diff --git a/block/throttle-groups.c b/block/throttle-groups.c
index f26bcb5..36cc043 100644
--- a/block/throttle-groups.c
+++ b/block/throttle-groups.c
@@ -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"
diff --git a/block/write-threshold.c b/block/write-threshold.c
index db3de0f..1d48fc2 100644
--- a/block/write-threshold.c
+++ b/block/write-threshold.c
@@ -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)
{
diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index 3a5479b..65a8473 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -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"
diff --git a/blockdev.c b/blockdev.c
index 3fb1ca8..1fbfd3a 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -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"
diff --git a/blockjob.c b/blockjob.c
index 3f52f29..801d29d 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -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
diff --git a/chardev/char-fe.c b/chardev/char-fe.c
index e5f870e..392db78 100644
--- a/chardev/char-fe.c
+++ b/chardev/char-fe.c
@@ -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"
diff --git a/chardev/char-ringbuf.c b/chardev/char-ringbuf.c
index 679afaa..87832e2 100644
--- a/chardev/char-ringbuf.c
+++ b/chardev/char-ringbuf.c
@@ -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"
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index bdd6cff..22f6597 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -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"
diff --git a/chardev/char.c b/chardev/char.c
index c9a4da5..5d7b079 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -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"
diff --git a/cpus.c b/cpus.c
index af67826..ac5b21e 100644
--- a/cpus.c
+++ b/cpus.c
@@ -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"
diff --git a/crypto/cipherpriv.h b/crypto/cipherpriv.h
index 77da4c2..0823239 100644
--- a/crypto/cipherpriv.h
+++ b/crypto/cipherpriv.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;
diff --git a/hmp.c b/hmp.c
index ae86bfb..cc35a78 100644
--- a/hmp.c
+++ b/hmp.c
@@ -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"
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index b50b3ca..5d4ce92 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -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"
diff --git a/hw/block/block.c b/hw/block/block.c
index b0269c8..b91e2b6 100644
--- a/hw/block/block.c
+++ b/hw/block/block.c
@@ -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)
diff --git a/hw/block/hd-geometry.c b/hw/block/hd-geometry.c
index 57ad501..79384a2 100644
--- a/hw/block/hd-geometry.c
+++ b/hw/block/hd-geometry.c
@@ -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"
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index 4be5d4e..679a824 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -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) \
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 5d44583..5e2bbcd 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -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"
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 55e69d6..94cfd40 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -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"
diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
index 61e677f..acb656b 100644
--- a/hw/mem/nvdimm.c
+++ b/hw/mem/nvdimm.c
@@ -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,
diff --git a/hw/net/rocker/qmp-norocker.c b/hw/net/rocker/qmp-norocker.c
index 94c1e48..0d60513 100644
--- a/hw/net/rocker/qmp-norocker.c
+++ b/hw/net/rocker/qmp-norocker.c
@@ -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)
diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
index a2a76c2..c02cbef 100644
--- a/hw/net/rocker/rocker.c
+++ b/hw/net/rocker/rocker.c
@@ -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"
diff --git a/hw/net/rocker/rocker_fp.c b/hw/net/rocker/rocker_fp.c
index 4b3c984..27b17c8 100644
--- a/hw/net/rocker/rocker_fp.c
+++ b/hw/net/rocker/rocker_fp.c
@@ -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"
diff --git a/hw/net/rocker/rocker_of_dpa.c b/hw/net/rocker/rocker_of_dpa.c
index 9339df2..6004672 100644
--- a/hw/net/rocker/rocker_of_dpa.c
+++ b/hw/net/rocker/rocker_of_dpa.c
@@ -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"
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 369d40b..188744e 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -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"
diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index 4bb939d..0ec5fa4 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -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>
diff --git a/hw/tpm/tpm_emulator.c b/hw/tpm/tpm_emulator.c
index b787aee..f187a72 100644
--- a/hw/tpm/tpm_emulator.c
+++ b/hw/tpm/tpm_emulator.c
@@ -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
diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
index a495fe0..211df31 100644
--- a/hw/tpm/tpm_passthrough.c
+++ b/hw/tpm/tpm_passthrough.c
@@ -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
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 98a5dd6..c7843d5 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -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"
diff --git a/include/block/block.h b/include/block/block.h
index 19b3ab9..fac401b 100644
--- a/include/block/block.h
+++ b/include/block/block.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"
diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h
index e3f4bbf..09efec6 100644
--- a/include/block/dirty-bitmap.h
+++ b/include/block/dirty-bitmap.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,
diff --git a/include/block/nbd.h b/include/block/nbd.h
index 495564c..2285637 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -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"
diff --git a/include/chardev/char.h b/include/chardev/char.h
index a381dc3..ebf1e0b 100644
--- a/include/chardev/char.h
+++ b/include/chardev/char.h
@@ -1,6 +1,7 @@
#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"
diff --git a/include/crypto/cipher.h b/include/crypto/cipher.h
index 984fb82..bce2d4c 100644
--- a/include/crypto/cipher.h
+++ b/include/crypto/cipher.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;
diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index ca3267f..077ac7b 100644
--- a/include/crypto/hash.h
+++ b/include/crypto/hash.h
@@ -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 */
diff --git a/include/crypto/hmac.h b/include/crypto/hmac.h
index 5e88905..aa3c97a 100644
--- a/include/crypto/hmac.h
+++ b/include/crypto/hmac.h
@@ -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 {
diff --git a/include/crypto/secret.h b/include/crypto/secret.h
index 07a963e..edd0e13 100644
--- a/include/crypto/secret.h
+++ b/include/crypto/secret.h
@@ -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"
diff --git a/include/crypto/tlscreds.h b/include/crypto/tlscreds.h
index ad47d88..6b011e1 100644
--- a/include/crypto/tlscreds.h
+++ b/include/crypto/tlscreds.h
@@ -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
diff --git a/include/hw/block/block.h b/include/hw/block/block.h
index f532d10..d4f4dff 100644
--- a/include/hw/block/block.h
+++ b/include/hw/block/block.h
@@ -12,7 +12,7 @@
#define HW_BLOCK_H
#include "qemu-common.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-block-core.h"
/* Configuration */
diff --git a/include/hw/block/fdc.h b/include/hw/block/fdc.h
index 68a0c90..3b813c7 100644
--- a/include/hw/block/fdc.h
+++ b/include/hw/block/fdc.h
@@ -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
diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
index f8d9f5b..f6ff32e 100644
--- a/include/hw/ppc/spapr_drc.h
+++ b/include/hw/ppc/spapr_drc.h
@@ -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"
diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index 1d61a35..40c2c8a 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -1,6 +1,7 @@
#ifndef QEMU_QDEV_PROPERTIES_H
#define QEMU_QDEV_PROPERTIES_H
+#include "qapi-types.h"
#include "hw/qdev-core.h"
/*** qdev-properties.c ***/
diff --git a/include/io/dns-resolver.h b/include/io/dns-resolver.h
index 2f69c08..1a16218 100644
--- a/include/io/dns-resolver.h
+++ b/include/io/dns-resolver.h
@@ -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"
diff --git a/include/migration/colo.h b/include/migration/colo.h
index 50ace16..2fe48ad 100644
--- a/include/migration/colo.h
+++ b/include/migration/colo.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);
diff --git a/include/migration/failover.h b/include/migration/failover.h
index ad91ef2..4c37218 100644
--- a/include/migration/failover.h
+++ b/include/migration/failover.h
@@ -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,
diff --git a/include/migration/global_state.h b/include/migration/global_state.h
index d307de8..fd22dd3 100644
--- a/include/migration/global_state.h
+++ b/include/migration/global_state.h
@@ -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);
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index ad64ad8..50f7cea 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -3,6 +3,7 @@
#include "qemu-common.h"
#include "block/block.h"
+#include "qapi-types.h"
#include "qemu/readline.h"
extern Monitor *cur_mon;
diff --git a/include/net/filter.h b/include/net/filter.h
index 0c4a2ea..435acd6 100644
--- a/include/net/filter.h
+++ b/include/net/filter.h
@@ -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"
diff --git a/include/net/net.h b/include/net/net.h
index 3fc48e4..7276430 100644
--- a/include/net/net.h
+++ b/include/net/net.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"
diff --git a/include/qapi/clone-visitor.h b/include/qapi/clone-visitor.h
index b119d3d..5b665ee 100644
--- a/include/qapi/clone-visitor.h
+++ b/include/qapi/clone-visitor.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;
diff --git a/include/qapi/error.h b/include/qapi/error.h
index c2115a6..bcb86a7 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -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.
diff --git a/include/qapi/qmp/qobject.h b/include/qapi/qmp/qobject.h
index 38ac688..a2964fb 100644
--- a/include/qapi/qmp/qobject.h
+++ b/include/qapi/qmp/qobject.h
@@ -32,7 +32,7 @@
#ifndef QOBJECT_H
#define QOBJECT_H
-#include "qapi-types.h"
+#include "qapi-builtin-types.h"
struct QObject {
QType type;
diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h
index ecff296..9e57508 100644
--- a/include/qapi/visitor.h
+++ b/include/qapi/visitor.h
@@ -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
diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h
index 8889bcb..e88d4c3 100644
--- a/include/qemu/sockets.h
+++ b/include/qemu/sockets.h
@@ -9,7 +9,7 @@
#endif /* !_WIN32 */
-#include "qapi-types.h"
+#include "qapi/qapi-types-sockets.h"
/* misc helpers */
int qemu_socket(int domain, int type, int protocol);
diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h
index 03d45f4..abeb886 100644
--- a/include/qemu/throttle.h
+++ b/include/qemu/throttle.h
@@ -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
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index aff88fa..dc6d495 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -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"
diff --git a/include/qom/object.h b/include/qom/object.h
index dc73d59..5b5c016 100644
--- a/include/qom/object.h
+++ b/include/qom/object.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;
diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h
index c14bcfe..2424e31 100644
--- a/include/sysemu/dump.h
+++ b/include/sysemu/dump.h
@@ -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 */
diff --git a/include/sysemu/hostmem.h b/include/sysemu/hostmem.h
index d5ab0b9..e1efaf0 100644
--- a/include/sysemu/hostmem.h
+++ b/include/sysemu/hostmem.h
@@ -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"
diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index dc8ae7b..fb533ed 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -13,6 +13,7 @@
*/
#include "sysemu.h"
+#include "qapi-types.h"
/* replay clock kinds */
enum ReplayClockKind {
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 77bb3da..bfbef9e 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -2,6 +2,7 @@
#define SYSEMU_H
/* Misc. things related to the system emulator. */
+#include "qapi/qapi-types-run-state.h"
#include "qemu/queue.h"
#include "qemu/timer.h"
#include "qemu/notify.h"
diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h
index 32b753d..9ae1ab6 100644
--- a/include/sysemu/tpm.h
+++ b/include/sysemu/tpm.h
@@ -12,6 +12,7 @@
#ifndef QEMU_TPM_H
#define QEMU_TPM_H
+#include "qapi/qapi-types-tpm.h"
#include "qom/object.h"
int tpm_config_parse(QemuOptsList *opts_list, const char *optarg);
diff --git a/include/sysemu/watchdog.h b/include/sysemu/watchdog.h
index 677ace3..a08d163 100644
--- a/include/sysemu/watchdog.h
+++ b/include/sysemu/watchdog.h
@@ -23,7 +23,7 @@
#define QEMU_WATCHDOG_H
#include "qemu/queue.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-run-state.h"
struct WatchdogTimerModel {
QLIST_ENTRY(WatchdogTimerModel) entry;
diff --git a/include/ui/console.h b/include/ui/console.h
index f29bacd..e0d81f1 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -5,6 +5,7 @@
#include "qom/object.h"
#include "qemu/notify.h"
#include "qemu/error-report.h"
+#include "qapi/qapi-types-ui.h"
#ifdef CONFIG_OPENGL
# include <epoxy/gl.h>
diff --git a/include/ui/input.h b/include/ui/input.h
index ceb22b8..16395ab 100644
--- a/include/ui/input.h
+++ b/include/ui/input.h
@@ -1,7 +1,7 @@
#ifndef INPUT_H
#define INPUT_H
-#include "qapi-types.h"
+#include "qapi/qapi-types-ui.h"
#define INPUT_EVENT_MASK_KEY (1<<INPUT_EVENT_KIND_KEY)
#define INPUT_EVENT_MASK_BTN (1<<INPUT_EVENT_KIND_BTN)
diff --git a/io/channel-socket.c b/io/channel-socket.c
index 563e297..8359b66 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -20,6 +20,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
+#include "qapi/qapi-visit-sockets.h"
#include "io/channel-socket.h"
#include "io/channel-watch.h"
#include "trace.h"
diff --git a/io/dns-resolver.c b/io/dns-resolver.c
index c072d12..8c92407 100644
--- a/io/dns-resolver.c
+++ b/io/dns-resolver.c
@@ -21,6 +21,7 @@
#include "qemu/osdep.h"
#include "io/dns-resolver.h"
#include "qapi/clone-visitor.h"
+#include "qapi/qapi-visit-sockets.h"
#include "qemu/sockets.h"
#include "qapi/error.h"
#include "qemu/cutils.h"
diff --git a/migration/colo-failover.c b/migration/colo-failover.c
index 891785c..0ae0c41 100644
--- a/migration/colo-failover.c
+++ b/migration/colo-failover.c
@@ -15,8 +15,8 @@
#include "migration/failover.h"
#include "qemu/main-loop.h"
#include "migration.h"
-#include "qmp-commands.h"
#include "qapi/error.h"
+#include "qapi/qapi-commands-migration.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
#include "trace.h"
diff --git a/migration/colo.c b/migration/colo.c
index 245a46d..4381067 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -13,6 +13,7 @@
#include "qemu/osdep.h"
#include "sysemu/sysemu.h"
#include "qapi/error.h"
+#include "qapi/qapi-commands-migration.h"
#include "qemu-file-channel.h"
#include "migration.h"
#include "qemu-file.h"
@@ -24,7 +25,6 @@
#include "qemu/error-report.h"
#include "migration/failover.h"
#include "replication.h"
-#include "qmp-commands.h"
static bool vmstate_loading;
diff --git a/migration/migration.c b/migration/migration.c
index 0aa596f..e345d0c 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -31,15 +31,15 @@
#include "migration/vmstate.h"
#include "block/block.h"
#include "qapi/error.h"
+#include "qapi/qapi-commands-migration.h"
+#include "qapi/qapi-events-migration.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qnull.h"
#include "qemu/rcu.h"
#include "block.h"
#include "postcopy-ram.h"
#include "qemu/thread.h"
-#include "qmp-commands.h"
#include "trace.h"
-#include "qapi-event.h"
#include "exec/target_page.h"
#include "io/channel-buffer.h"
#include "migration/colo.h"
diff --git a/migration/migration.h b/migration/migration.h
index 82cf926..08c5d2d 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -15,6 +15,7 @@
#define QEMU_MIGRATION_H
#include "qemu-common.h"
+#include "qapi/qapi-types-migration.h"
#include "qemu/thread.h"
#include "exec/cpu-common.h"
#include "qemu/coroutine_int.h"
diff --git a/migration/ram.c b/migration/ram.c
index 5e33e5c..3b6c077 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -29,7 +29,6 @@
#include "qemu/osdep.h"
#include "cpu.h"
#include <zlib.h>
-#include "qapi-event.h"
#include "qemu/cutils.h"
#include "qemu/bitops.h"
#include "qemu/bitmap.h"
@@ -44,6 +43,7 @@
#include "migration/page_cache.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
+#include "qapi/qapi-events-migration.h"
#include "qapi/qmp/qerror.h"
#include "trace.h"
#include "exec/ram_addr.h"
diff --git a/migration/ram.h b/migration/ram.h
index f3a227b..53f0021 100644
--- a/migration/ram.h
+++ b/migration/ram.h
@@ -30,7 +30,7 @@
#define QEMU_MIGRATION_RAM_H
#include "qemu-common.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-migration.h"
#include "exec/cpu-common.h"
extern MigrationStats ram_counters;
diff --git a/net/colo-compare.c b/net/colo-compare.c
index 76e03fd..23b2d2c 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -25,7 +25,6 @@
#include "net/queue.h"
#include "chardev/char-fe.h"
#include "qemu/sockets.h"
-#include "qapi-visit.h"
#include "net/colo.h"
#include "sysemu/iothread.h"
diff --git a/net/filter-buffer.c b/net/filter-buffer.c
index 9ce96aa..7c48762 100644
--- a/net/filter-buffer.c
+++ b/net/filter-buffer.c
@@ -13,8 +13,8 @@
#include "qemu-common.h"
#include "qemu/timer.h"
#include "qemu/iov.h"
+#include "qapi-builtin-visit.h"
#include "qapi/qmp/qerror.h"
-#include "qapi-visit.h"
#include "qom/object.h"
#define TYPE_FILTER_BUFFER "filter-buffer"
diff --git a/net/filter-mirror.c b/net/filter-mirror.c
index bd78e25..3a61cf2 100644
--- a/net/filter-mirror.c
+++ b/net/filter-mirror.c
@@ -14,7 +14,6 @@
#include "net/net.h"
#include "qemu-common.h"
#include "qapi/error.h"
-#include "qapi-visit.h"
#include "qom/object.h"
#include "qemu/main-loop.h"
#include "qemu/error-report.h"
diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c
index 6201494..62dad2d 100644
--- a/net/filter-rewriter.c
+++ b/net/filter-rewriter.c
@@ -16,7 +16,6 @@
#include "net/net.h"
#include "qemu-common.h"
#include "qemu/error-report.h"
-#include "qapi-visit.h"
#include "qom/object.h"
#include "qemu/main-loop.h"
#include "qemu/iov.h"
diff --git a/net/net.c b/net/net.c
index 7d42925..547c499 100644
--- a/net/net.c
+++ b/net/net.c
@@ -33,18 +33,18 @@
#include "monitor/monitor.h"
#include "qemu/help_option.h"
+#include "qapi/qapi-commands-net.h"
+#include "qapi/qapi-visit-net.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
#include "qemu/sockets.h"
#include "qemu/cutils.h"
#include "qemu/config-file.h"
-#include "qmp-commands.h"
#include "hw/qdev.h"
#include "qemu/iov.h"
#include "qemu/main-loop.h"
#include "qemu/option.h"
-#include "qapi-visit.h"
#include "qapi/error.h"
#include "qapi/opts-visitor.h"
#include "sysemu/sysemu.h"
diff --git a/net/tap_int.h b/net/tap_int.h
index ae6888f..9f931d5 100644
--- a/net/tap_int.h
+++ b/net/tap_int.h
@@ -27,7 +27,7 @@
#define NET_TAP_INT_H
#include "qemu-common.h"
-#include "qapi-types.h"
+#include "qapi/qapi-types-net.h"
int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
int vnet_hdr_required, int mq_required, Error **errp);
diff --git a/net/vhost-user.c b/net/vhost-user.c
index d024573..e0f16c8 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -14,10 +14,10 @@
#include "net/vhost-user.h"
#include "chardev/char-fe.h"
#include "qapi/error.h"
+#include "qapi/qapi-commands-net.h"
#include "qemu/config-file.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
-#include "qmp-commands.h"
#include "trace.h"
typedef struct VhostUserState {
diff --git a/qemu-img.c b/qemu-img.c
index 56edc15..40bf7aa 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -27,7 +27,7 @@
#include "qemu-version.h"
#include "qapi/error.h"
-#include "qapi-visit.h"
+#include "qapi/qapi-visit-block-core.h"
#include "qapi/qobject-output-visitor.h"
#include "qapi/qmp/qjson.h"
#include "qapi/qmp/qdict.h"
diff --git a/qom/object.c b/qom/object.c
index 5dcee46..81b4f7a 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -16,9 +16,9 @@
#include "qom/object_interfaces.h"
#include "qemu/cutils.h"
#include "qapi/visitor.h"
-#include "qapi-visit.h"
#include "qapi/string-input-visitor.h"
#include "qapi/string-output-visitor.h"
+#include "qapi-builtin-visit.h"
#include "qapi/qmp/qerror.h"
#include "trace.h"
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index 43d9aa0..2f76e1f 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -5,7 +5,6 @@
#include "qom/object_interfaces.h"
#include "qemu/module.h"
#include "qemu/option.h"
-#include "qapi-visit.h"
#include "qapi/opts-visitor.h"
#include "qemu/config-file.h"
diff --git a/replay/replay-input.c b/replay/replay-input.c
index 3ab1536..6ee8b5f 100644
--- a/replay/replay-input.c
+++ b/replay/replay-input.c
@@ -16,6 +16,7 @@
#include "qemu/notify.h"
#include "ui/input.h"
#include "qapi/clone-visitor.h"
+#include "qapi/qapi-visit-ui.h"
void replay_save_input_event(InputEvent *evt)
{
diff --git a/replication.h b/replication.h
index ece6ca6..8faefe0 100644
--- a/replication.h
+++ b/replication.h
@@ -15,6 +15,7 @@
#ifndef REPLICATION_H
#define REPLICATION_H
+#include "qapi/qapi-types-block-core.h"
#include "qemu/queue.h"
typedef struct ReplicationOps ReplicationOps;
diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py
index a43bccb..9534491 100644
--- a/scripts/qapi/commands.py
+++ b/scripts/qapi/commands.py
@@ -241,6 +241,9 @@
def _begin_module(self, name):
self._visited_ret_types[self._genc] = set()
+ commands = self._module_basename('qapi-commands', name)
+ types = self._module_basename('qapi-types', name)
+ visit = self._module_basename('qapi-visit', name)
self._genc.add(mcgen('''
#include "qemu/osdep.h"
#include "qemu-common.h"
@@ -251,18 +254,17 @@
#include "qapi/qobject-input-visitor.h"
#include "qapi/dealloc-visitor.h"
#include "qapi/error.h"
-#include "%(prefix)sqapi-types.h"
-#include "%(prefix)sqapi-visit.h"
-#include "%(prefix)sqmp-commands.h"
+#include "%(visit)s.h"
+#include "%(commands)s.h"
''',
- prefix=self._prefix))
+ commands=commands, visit=visit))
self._genh.add(mcgen('''
-#include "%(prefix)sqapi-types.h"
+#include "%(types)s.h"
#include "qapi/qmp/dispatch.h"
''',
- prefix=self._prefix))
+ types=types))
def visit_end(self):
(genc, genh) = self._module[self._main_module]
diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py
index 1e0b990..5ad6708 100644
--- a/scripts/qapi/events.py
+++ b/scripts/qapi/events.py
@@ -165,24 +165,26 @@
return basename
def _begin_module(self, name):
+ types = self._module_basename('qapi-types', name)
+ visit = self._module_basename('qapi-visit', name)
self._genc.add(mcgen('''
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "%(prefix)sqapi-event.h"
-#include "%(prefix)sqapi-visit.h"
+#include "%(visit)s.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qobject-output-visitor.h"
#include "qapi/qmp-event.h"
''',
- prefix=self._prefix))
+ visit=visit, prefix=self._prefix))
self._genh.add(mcgen('''
#include "qapi/util.h"
-#include "%(prefix)sqapi-types.h"
+#include "%(types)s.h"
''',
- prefix=self._prefix))
+ types=types))
def visit_end(self):
self._genh.add(gen_enum(self._enum_name, self._event_names))
diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py
index 59826b1..2a3c502 100644
--- a/scripts/qapi/types.py
+++ b/scripts/qapi/types.py
@@ -185,13 +185,15 @@
'''))
def _begin_module(self, name):
+ types = self._module_basename('qapi-types', name)
+ visit = self._module_basename('qapi-visit', name)
self._genc.preamble_add(mcgen('''
#include "qemu/osdep.h"
#include "qapi/dealloc-visitor.h"
-#include "%(prefix)sqapi-types.h"
-#include "%(prefix)sqapi-visit.h"
+#include "%(types)s.h"
+#include "%(visit)s.h"
''',
- prefix=self._prefix))
+ types=types, visit=visit))
self._genh.preamble_add(mcgen('''
#include "qapi-builtin-types.h"
'''))
diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
index 9b678e7..de09966 100644
--- a/scripts/qapi/visit.py
+++ b/scripts/qapi/visit.py
@@ -284,20 +284,22 @@
prefix=prefix))
def _begin_module(self, name):
+ types = self._module_basename('qapi-types', name)
+ visit = self._module_basename('qapi-visit', name)
self._genc.preamble_add(mcgen('''
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
-#include "%(prefix)sqapi-visit.h"
+#include "%(visit)s.h"
''',
- prefix=self._prefix))
+ visit=visit, prefix=self._prefix))
self._genh.preamble_add(mcgen('''
#include "qapi-builtin-visit.h"
-#include "%(prefix)sqapi-types.h"
+#include "%(types)s.h"
''',
- prefix=self._prefix))
+ types=types))
def visit_enum_type(self, name, info, values, prefix):
self._genh.add(gen_visit_decl(name, scalar=True))
diff --git a/stubs/tpm.c b/stubs/tpm.c
index c18aac1..6729bc8 100644
--- a/stubs/tpm.c
+++ b/stubs/tpm.c
@@ -4,9 +4,10 @@
* 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 "qapi/qapi-commands-tpm.h"
#include "sysemu/tpm.h"
-#include "qmp-commands.h"
int tpm_init(void)
{
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index 656aaea..f570896 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -41,7 +41,6 @@
#include "exec/gdbstub.h"
#include "exec/address-spaces.h"
#include "trace.h"
-#include "qapi-event.h"
#include "hw/s390x/s390-pci-inst.h"
#include "hw/s390x/s390-pci-bus.h"
#include "hw/s390x/ipl.h"
diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c
index 5a7a9c4..92b2830 100644
--- a/target/s390x/sigp.c
+++ b/target/s390x/sigp.c
@@ -17,6 +17,7 @@
#include "exec/exec-all.h"
#include "sysemu/sysemu.h"
#include "trace.h"
+#include "qapi-types.h"
QemuMutex qemu_sigp_mutex;
diff --git a/tests/test-char.c b/tests/test-char.c
index b358620..b3a77af 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -8,9 +8,9 @@
#include "chardev/char-mux.h"
#include "sysemu/sysemu.h"
#include "qapi/error.h"
+#include "qapi/qapi-commands-char.h"
#include "qapi/qmp/qdict.h"
#include "qom/qom-qobject.h"
-#include "qmp-commands.h"
static bool quit;
diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
index 8012341..5fbe7e5 100644
--- a/tests/test-qmp-event.c
+++ b/tests/test-qmp-event.c
@@ -14,7 +14,6 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
-#include "test-qapi-visit.h"
#include "test-qapi-event.h"
#include "qapi/error.h"
#include "qapi/qmp/qbool.h"
diff --git a/tpm.c b/tpm.c
index d11b10b..2db03a0 100644
--- a/tpm.c
+++ b/tpm.c
@@ -15,12 +15,12 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
+#include "qapi/qapi-commands-tpm.h"
#include "qapi/qmp/qerror.h"
#include "sysemu/tpm_backend.h"
#include "sysemu/tpm.h"
#include "qemu/config-file.h"
#include "qemu/error-report.h"
-#include "qmp-commands.h"
static QLIST_HEAD(, TPMBackend) tpm_backends =
QLIST_HEAD_INITIALIZER(tpm_backends);
diff --git a/trace/qmp.c b/trace/qmp.c
index ccd35cd..756086c 100644
--- a/trace/qmp.c
+++ b/trace/qmp.c
@@ -9,7 +9,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
-#include "qmp-commands.h"
+#include "qapi/qapi-commands-trace.h"
#include "trace/control.h"
diff --git a/ui/console.c b/ui/console.c
index e22931a..6a1f499 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -26,9 +26,9 @@
#include "ui/console.h"
#include "hw/qdev-core.h"
#include "qapi/error.h"
+#include "qapi/qapi-commands-ui.h"
#include "qemu/option.h"
#include "qemu/timer.h"
-#include "qmp-commands.h"
#include "chardev/char-fe.h"
#include "trace.h"
#include "exec/memory.h"
diff --git a/ui/input-legacy.c b/ui/input-legacy.c
index 92b37cc..e5d4db1 100644
--- a/ui/input-legacy.c
+++ b/ui/input-legacy.c
@@ -23,9 +23,9 @@
*/
#include "qemu/osdep.h"
+#include "qapi/qapi-commands-ui.h"
#include "sysemu/sysemu.h"
#include "ui/console.h"
-#include "qmp-commands.h"
#include "ui/keymaps.h"
#include "ui/input.h"
diff --git a/ui/input.c b/ui/input.c
index 8bef0fb..51b1019 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -1,9 +1,9 @@
#include "qemu/osdep.h"
#include "sysemu/sysemu.h"
#include "qapi/error.h"
+#include "qapi/qapi-commands-ui.h"
#include "qapi/qmp/qdict.h"
#include "qemu/error-report.h"
-#include "qmp-commands.h"
#include "trace.h"
#include "ui/input.h"
#include "ui/console.h"
diff --git a/ui/spice-core.c b/ui/spice-core.c
index e449172..ae8921a 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -28,14 +28,14 @@
#include "qemu/queue.h"
#include "qemu-x509.h"
#include "qemu/sockets.h"
-#include "qmp-commands.h"
#include "qapi/error.h"
+#include "qapi/qapi-commands-ui.h"
+#include "qapi/qapi-events-ui.h"
#include "qemu/notify.h"
#include "qemu/option.h"
#include "migration/misc.h"
#include "hw/hw.h"
#include "ui/spice-display.h"
-#include "qapi-event.h"
/* core bits */
diff --git a/ui/vnc.c b/ui/vnc.c
index d19f86c..a25e408 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -36,7 +36,7 @@
#include "qemu/acl.h"
#include "qemu/config-file.h"
#include "qapi/error.h"
-#include "qmp-commands.h"
+#include "qapi/qapi-commands-ui.h"
#include "ui/input.h"
#include "qapi-event.h"
#include "crypto/hash.h"
diff --git a/ui/vnc.h b/ui/vnc.h
index 1ca062f..7b29def 100644
--- a/ui/vnc.h
+++ b/ui/vnc.h
@@ -28,6 +28,7 @@
#define QEMU_VNC_H
#include "qemu-common.h"
+#include "qapi/qapi-types-ui.h"
#include "qemu/queue.h"
#include "qemu/thread.h"
#include "ui/console.h"
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index fbbef69..7f13e8a 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -24,11 +24,11 @@
#include "monitor/monitor.h"
#include "qapi/clone-visitor.h"
#include "qapi/error.h"
+#include "qapi/qapi-visit-sockets.h"
#include "qemu/sockets.h"
#include "qemu/main-loop.h"
#include "qapi/qobject-input-visitor.h"
#include "qapi/qobject-output-visitor.h"
-#include "qapi-visit.h"
#include "qemu/cutils.h"
#ifndef AI_ADDRCONFIG
diff --git a/vl.c b/vl.c
index a33ac00..e2e4e68 100644
--- a/vl.c
+++ b/vl.c
@@ -97,7 +97,6 @@
#include "sysemu/kvm.h"
#include "sysemu/hax.h"
#include "qapi/qobject-input-visitor.h"
-#include "qapi-visit.h"
#include "qemu/option.h"
#include "qemu/config-file.h"
#include "qemu-options.h"
@@ -122,10 +121,11 @@
#include "qapi/string-input-visitor.h"
#include "qapi/opts-visitor.h"
#include "qom/object_interfaces.h"
-#include "qapi-event.h"
#include "exec/semihost.h"
#include "crypto/init.h"
#include "sysemu/replay.h"
+#include "qapi/qapi-events-run-state.h"
+#include "qapi/qapi-visit-block-core.h"
#include "qapi/qmp/qerror.h"
#include "sysemu/iothread.h"