summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/cryptodev.c1
-rw-r--r--backends/hostmem.c3
-rw-r--r--block.c1
-rw-r--r--block/block-backend.c2
-rw-r--r--block/crypto.c2
-rw-r--r--block/nbd.c2
-rw-r--r--block/nfs.c2
-rw-r--r--block/qapi.c4
-rw-r--r--block/qcow2.c3
-rw-r--r--block/quorum.c2
-rw-r--r--block/sheepdog.c2
-rw-r--r--block/ssh.c2
-rw-r--r--block/throttle-groups.c2
-rw-r--r--block/write-threshold.c4
-rw-r--r--blockdev-nbd.c2
-rw-r--r--blockdev.c5
-rw-r--r--blockjob.c2
-rw-r--r--chardev/char-fe.c1
-rw-r--r--chardev/char-ringbuf.c2
-rw-r--r--chardev/char-socket.c1
-rw-r--r--chardev/char.c3
-rw-r--r--cpus.c2
-rw-r--r--crypto/cipherpriv.h2
-rw-r--r--hmp.c2
-rw-r--r--hw/acpi/core.c2
-rw-r--r--hw/block/block.c1
-rw-r--r--hw/block/hd-geometry.c1
-rw-r--r--hw/char/virtio-console.c2
-rw-r--r--hw/core/machine.c2
-rw-r--r--hw/i386/pc.c2
-rw-r--r--hw/mem/nvdimm.c1
-rw-r--r--hw/net/rocker/qmp-norocker.c2
-rw-r--r--hw/net/rocker/rocker.c2
-rw-r--r--hw/net/rocker/rocker_fp.c2
-rw-r--r--hw/net/rocker/rocker_of_dpa.c2
-rw-r--r--hw/net/virtio-net.c2
-rw-r--r--hw/ppc/spapr_rtas.c1
-rw-r--r--hw/tpm/tpm_emulator.c1
-rw-r--r--hw/tpm/tpm_passthrough.c1
-rw-r--r--hw/watchdog/watchdog.c2
-rw-r--r--include/block/block.h2
-rw-r--r--include/block/dirty-bitmap.h2
-rw-r--r--include/block/nbd.h2
-rw-r--r--include/chardev/char.h1
-rw-r--r--include/crypto/cipher.h2
-rw-r--r--include/crypto/hash.h2
-rw-r--r--include/crypto/hmac.h2
-rw-r--r--include/crypto/secret.h1
-rw-r--r--include/crypto/tlscreds.h1
-rw-r--r--include/hw/block/block.h2
-rw-r--r--include/hw/block/fdc.h2
-rw-r--r--include/hw/ppc/spapr_drc.h1
-rw-r--r--include/hw/qdev-properties.h1
-rw-r--r--include/io/dns-resolver.h1
-rw-r--r--include/migration/colo.h2
-rw-r--r--include/migration/failover.h2
-rw-r--r--include/migration/global_state.h1
-rw-r--r--include/monitor/monitor.h1
-rw-r--r--include/net/filter.h1
-rw-r--r--include/net/net.h2
-rw-r--r--include/qapi/clone-visitor.h1
-rw-r--r--include/qapi/error.h2
-rw-r--r--include/qapi/qmp/qobject.h2
-rw-r--r--include/qapi/visitor.h2
-rw-r--r--include/qemu/sockets.h2
-rw-r--r--include/qemu/throttle.h2
-rw-r--r--include/qom/cpu.h1
-rw-r--r--include/qom/object.h2
-rw-r--r--include/sysemu/dump.h2
-rw-r--r--include/sysemu/hostmem.h1
-rw-r--r--include/sysemu/replay.h1
-rw-r--r--include/sysemu/sysemu.h1
-rw-r--r--include/sysemu/tpm.h1
-rw-r--r--include/sysemu/watchdog.h2
-rw-r--r--include/ui/console.h1
-rw-r--r--include/ui/input.h2
-rw-r--r--io/channel-socket.c1
-rw-r--r--io/dns-resolver.c1
-rw-r--r--migration/colo-failover.c2
-rw-r--r--migration/colo.c2
-rw-r--r--migration/migration.c4
-rw-r--r--migration/migration.h1
-rw-r--r--migration/ram.c2
-rw-r--r--migration/ram.h2
-rw-r--r--net/colo-compare.c1
-rw-r--r--net/filter-buffer.c2
-rw-r--r--net/filter-mirror.c1
-rw-r--r--net/filter-rewriter.c1
-rw-r--r--net/net.c4
-rw-r--r--net/tap_int.h2
-rw-r--r--net/vhost-user.c2
-rw-r--r--qemu-img.c2
-rw-r--r--qom/object.c2
-rw-r--r--qom/object_interfaces.c1
-rw-r--r--replay/replay-input.c1
-rw-r--r--replication.h1
-rw-r--r--scripts/qapi/commands.py14
-rw-r--r--scripts/qapi/events.py10
-rw-r--r--scripts/qapi/types.py8
-rw-r--r--scripts/qapi/visit.py10
-rw-r--r--stubs/tpm.c3
-rw-r--r--target/s390x/kvm.c1
-rw-r--r--target/s390x/sigp.c1
-rw-r--r--tests/test-char.c2
-rw-r--r--tests/test-qmp-event.c1
-rw-r--r--tpm.c2
-rw-r--r--trace/qmp.c2
-rw-r--r--ui/console.c2
-rw-r--r--ui/input-legacy.c2
-rw-r--r--ui/input.c2
-rw-r--r--ui/spice-core.c4
-rw-r--r--ui/vnc.c2
-rw-r--r--ui/vnc.h1
-rw-r--r--util/qemu-sockets.c2
-rw-r--r--vl.c4
115 files changed, 135 insertions, 109 deletions
diff --git a/backends/cryptodev.c b/backends/cryptodev.c
index d0dff1a463..f35be377ef 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 8aa0412032..74fc04a362 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 628910f638..c205320a50 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 0266ac990b..94ffbb6a60 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 3df66947c5..aeac482e7b 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 69b5fd5e8f..d4e4172c08 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 6576a73d6e..bbdb4fadad 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 1fdeb1ef2f..4c9923d262 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 fd79c0ebaa..3dd098b74f 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 19f1c34425..14333c18aa 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 ac02b10fe0..215223053b 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 b63addcf94..b11d4c5e86 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 f26bcb5eee..36cc0430c3 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 db3de0fa6d..1d48fc2077 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 3a5479bdad..65a84739ed 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 3fb1ca803c..1fbfd3a2c4 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 3f52f29f75..801d29d849 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 e5f870e4d2..392db78b13 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 679afaa4fd..87832e2792 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 bdd6cff5f6..22f65971a1 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 c9a4da5516..5d7b079ef0 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 af678264f6..ac5b21ef07 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 77da4c2f32..0823239f41 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 ae86bfbade..cc35a787f9 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 b50b3ca772..5d4ce925dc 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 b0269c857f..b91e2b6d7e 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 57ad5012a7..79384a2b0a 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 4be5d4ee52..679a824888 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 5d445839e8..5e2bbcdace 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 55e69d66fe..94cfd40ef2 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 61e677f92f..acb656b672 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 94c1e480ae..0d60513c01 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 a2a76c2a74..c02cbefece 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 4b3c9847db..27b17c890f 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 9339df2d09..60046720a5 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 369d40b378..188744e17d 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 4bb939d3d1..0ec5fa4cfe 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 b787aee13b..f187a72c10 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 a495fe07f4..211df3191c 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 98a5dd6689..c7843d5748 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 19b3ab9cb5..fac401ba3e 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 e3f4bbf51d..09efec609f 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 495564c73a..2285637e67 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 a381dc3df8..ebf1e0ba04 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 984fb8243f..bce2d4c8e4 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 ca3267f3df..077ac7bea0 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 5e88905989..aa3c97a2ff 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 07a963e794..edd0e13236 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 ad47d88be7..6b011e1dbc 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 f532d10e35..d4f4dfffab 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 68a0c904ea..3b813c7f7d 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 f8d9f5b231..f6ff32e7e2 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 1d61a35108..40c2c8acb1 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 2f69c08c13..1a162185cc 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 50ace16205..2fe48ad353 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 ad91ef2381..4c37218dcc 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 d307de8350..fd22dd3034 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 ad64ad8e68..50f7cea057 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 0c4a2ea6c9..435acd6f82 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 3fc48e4f51..727643032c 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 b119d3daa9..5b665ee38c 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 c2115a6a4a..bcb86a79f5 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 38ac68845c..a2964fbf25 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 ecff296c11..9e57508446 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 8889bcb1ec..e88d4c37ab 100644
--- a/include/qemu/sockets.h
+++ b/include/qemu/sockets.h
@@ -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);
diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h
index 03d45f44f8..abeb886d93 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 aff88fa16f..dc6d4956a8 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 dc73d59660..5b5c016d8f 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 c14bcfe8c6..2424e31425 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 d5ab0b99c6..e1efaf04ac 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 dc8ae7b6b1..fb533ed9b6 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 77bb3da582..bfbef9e69c 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 32b753d4f3..9ae1ab6da3 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 677ace3945..a08d16380d 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 f29bacd625..e0d81f1144 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 ceb22b8eef..16395ab8f2 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 563e297357..8359b6683a 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 c072d121c3..8c924071c4 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 891785cb63..0ae0c41221 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 245a46d59d..4381067ed4 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 0aa596f867..e345d0cc7e 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 82cf926b17..08c5d2ded1 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 5e33e5cc79..3b6c077964 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 f3a227b4fc..53f0021c51 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 76e03fdb14..23b2d2c4cc 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 9ce96aaa35..7c487629f9 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 bd78e25d12..3a61cf21e8 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 6201494ceb..62dad2d773 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 7d42925258..547c499110 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 ae6888f74a..9f931d52d6 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 d024573e45..e0f16c895b 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 56edc15218..40bf7aa7d1 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 5dcee4683c..81b4f7ac48 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 43d9aa0946..2f76e1f36d 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 3ab1536bf7..6ee8b5f8db 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 ece6ca6133..8faefe005f 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 a43bccb190..953449171b 100644
--- a/scripts/qapi/commands.py
+++ b/scripts/qapi/commands.py
@@ -241,6 +241,9 @@ class QAPISchemaGenCommandVisitor(QAPISchemaModularCVisitor):
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 @@ class QAPISchemaGenCommandVisitor(QAPISchemaModularCVisitor):
#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 1e0b990f35..5ad6708491 100644
--- a/scripts/qapi/events.py
+++ b/scripts/qapi/events.py
@@ -165,24 +165,26 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVisitor):
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 59826b1162..2a3c502cf6 100644
--- a/scripts/qapi/types.py
+++ b/scripts/qapi/types.py
@@ -185,13 +185,15 @@ class QAPISchemaGenTypeVisitor(QAPISchemaModularCVisitor):
'''))
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 9b678e7263..de09966643 100644
--- a/scripts/qapi/visit.py
+++ b/scripts/qapi/visit.py
@@ -284,20 +284,22 @@ class QAPISchemaGenVisitVisitor(QAPISchemaModularCVisitor):
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 c18aac1c73..6729bc8517 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 656aaea2cd..f570896dc1 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 5a7a9c4cfb..92b2830940 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 b358620911..b3a77af085 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 8012341343..5fbe7e551f 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 d11b10bed8..2db03a09b2 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 ccd35cd840..756086c79f 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 e22931a396..6a1f49916e 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 92b37ccb90..e5d4db1d97 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 8bef0fb038..51b1019252 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 e449172fe9..ae8921a201 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 d19f86c7f4..a25e408cf0 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 1ca062f332..7b29def77d 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 fbbef69f62..7f13e8a338 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 a33ac008fb..e2e4e68c35 100644
--- a/vl.c
+++ b/vl.c
@@ -97,7 +97,6 @@ int main(int argc, char **argv)
#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 @@ int main(int argc, char **argv)
#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"