Include qapi/error.h exactly where needed
This cleanup makes the number of objects depending on qapi/error.h
drop from 1910 (out of 4743) to 1612 in my "build everything" tree.
While there, separate #include from file comment with a blank line,
and drop a useless comment on why qemu/osdep.h is included first.
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180201111846.21846-5-armbru@redhat.com>
[Semantic conflict with commit 34e304e975 resolved, OSX breakage fixed]
diff --git a/audio/wavcapture.c b/audio/wavcapture.c
index 5863803..cf31ed6 100644
--- a/audio/wavcapture.c
+++ b/audio/wavcapture.c
@@ -1,6 +1,7 @@
#include "qemu/osdep.h"
#include "hw/hw.h"
#include "monitor/monitor.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "audio.h"
diff --git a/balloon.c b/balloon.c
index 1d720ff..f8b5ca9 100644
--- a/balloon.c
+++ b/balloon.c
@@ -31,6 +31,7 @@
#include "sysemu/balloon.h"
#include "trace-root.h"
#include "qmp-commands.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qjson.h"
diff --git a/block.c b/block.c
index a8da4f2..2a8bc27 100644
--- a/block.c
+++ b/block.c
@@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include "block/trace.h"
#include "block/block_int.h"
@@ -29,6 +30,7 @@
#include "qemu/error-report.h"
#include "module_block.h"
#include "qemu/module.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qjson.h"
diff --git a/block/block-backend.c b/block/block-backend.c
index f66349c..532893c 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -18,6 +18,7 @@
#include "sysemu/blockdev.h"
#include "sysemu/sysemu.h"
#include "qapi-event.h"
+#include "qapi/error.h"
#include "qemu/id.h"
#include "trace.h"
#include "migration/misc.h"
diff --git a/block/iscsi.c b/block/iscsi.c
index 6a1c537..9a1bf43 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -38,6 +38,7 @@
#include "qemu/iov.h"
#include "qemu/uuid.h"
#include "qmp-commands.h"
+#include "qapi/error.h"
#include "qapi/qmp/qstring.h"
#include "crypto/secret.h"
#include "scsi/utils.h"
diff --git a/block/qapi.c b/block/qapi.c
index fc10f0a..4fc9fd8 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -29,6 +29,7 @@
#include "block/write-threshold.h"
#include "qmp-commands.h"
#include "qapi-visit.h"
+#include "qapi/error.h"
#include "qapi/qobject-output-visitor.h"
#include "qapi/qmp/types.h"
#include "sysemu/block-backend.h"
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index a3fec27..3a979bc 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -25,7 +25,6 @@
#include "qemu/osdep.h"
#include <zlib.h>
-#include "qapi/error.h"
#include "qemu-common.h"
#include "block/block_int.h"
#include "block/qcow2.h"
diff --git a/block/qcow2.c b/block/qcow2.c
index 1f80961..7645b3c 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include "block/block_int.h"
#include "sysemu/block-backend.h"
@@ -28,6 +29,7 @@
#include <zlib.h>
#include "block/qcow2.h"
#include "qemu/error-report.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/types.h"
diff --git a/block/quorum.c b/block/quorum.c
index 272f9a5..ec427c3 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -16,6 +16,7 @@
#include "qemu/osdep.h"
#include "qemu/cutils.h"
#include "block/block_int.h"
+#include "qapi/error.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
diff --git a/block/write-threshold.c b/block/write-threshold.c
index 0bd1a01..db3de0f 100644
--- a/block/write-threshold.c
+++ b/block/write-threshold.c
@@ -16,9 +16,9 @@
#include "block/write-threshold.h"
#include "qemu/notify.h"
#include "qapi-event.h"
+#include "qapi/error.h"
#include "qmp-commands.h"
-
uint64_t bdrv_write_threshold_get(const BlockDriverState *bs)
{
return bs->write_threshold_offset;
diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index a9f79c6..e0f0982 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -13,6 +13,7 @@
#include "sysemu/blockdev.h"
#include "sysemu/block-backend.h"
#include "hw/block/block.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "sysemu/sysemu.h"
#include "qmp-commands.h"
diff --git a/blockdev.c b/blockdev.c
index 8e977ee..ad82dbb 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -42,6 +42,7 @@
#include "qemu/config-file.h"
#include "qapi/qmp/types.h"
#include "qapi-visit.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qobject-output-visitor.h"
#include "sysemu/sysemu.h"
diff --git a/blockjob.c b/blockjob.c
index f5cea84..d766fdc 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -29,6 +29,7 @@
#include "block/blockjob_int.h"
#include "block/block_int.h"
#include "sysemu/block-backend.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qjson.h"
#include "qemu/coroutine.h"
diff --git a/chardev/char-ringbuf.c b/chardev/char-ringbuf.c
index df52b04..c1fa4c3 100644
--- a/chardev/char-ringbuf.c
+++ b/chardev/char-ringbuf.c
@@ -21,9 +21,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include "chardev/char.h"
#include "qmp-commands.h"
+#include "qapi/error.h"
#include "qemu/base64.h"
/* Ring buffer chardev */
diff --git a/chardev/char.c b/chardev/char.c
index 3e14de1..51f2697 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include "qemu/cutils.h"
#include "monitor/monitor.h"
@@ -30,6 +31,7 @@
#include "chardev/char.h"
#include "qmp-commands.h"
#include "qapi-visit.h"
+#include "qapi/error.h"
#include "sysemu/replay.h"
#include "qemu/help_option.h"
diff --git a/chardev/spice.c b/chardev/spice.c
index a312078..bbdf649 100644
--- a/chardev/spice.c
+++ b/chardev/spice.c
@@ -2,6 +2,7 @@
#include "trace.h"
#include "ui/qemu-spice.h"
#include "chardev/char.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include <spice.h>
#include <spice/protocol.h>
diff --git a/cpus.c b/cpus.c
index 182caf7..da5e3a6 100644
--- a/cpus.c
+++ b/cpus.c
@@ -22,12 +22,12 @@
* THE SOFTWARE.
*/
-/* Needed early for CONFIG_BSD etc. */
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/config-file.h"
#include "cpu.h"
#include "monitor/monitor.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
#include "sysemu/sysemu.h"
diff --git a/crypto/hash.c b/crypto/hash.c
index 8dab25d..b97323c 100644
--- a/crypto/hash.c
+++ b/crypto/hash.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "crypto/hash.h"
#include "hashpriv.h"
diff --git a/crypto/hmac.c b/crypto/hmac.c
index f6c2d8d..4de7e8c 100644
--- a/crypto/hmac.c
+++ b/crypto/hmac.c
@@ -10,7 +10,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "crypto/hmac.h"
#include "hmacpriv.h"
diff --git a/crypto/ivgen-essiv.c b/crypto/ivgen-essiv.c
index ad4d926..aeaa8fc 100644
--- a/crypto/ivgen-essiv.c
+++ b/crypto/ivgen-essiv.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "qemu/bswap.h"
#include "crypto/ivgen-essiv.h"
diff --git a/crypto/ivgen-plain.c b/crypto/ivgen-plain.c
index 9b9b4ad..bf2fb7a 100644
--- a/crypto/ivgen-plain.c
+++ b/crypto/ivgen-plain.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "qemu/bswap.h"
#include "crypto/ivgen-plain.h"
diff --git a/crypto/ivgen-plain64.c b/crypto/ivgen-plain64.c
index 6c6b1b4..e4679a1 100644
--- a/crypto/ivgen-plain64.c
+++ b/crypto/ivgen-plain64.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "qemu/bswap.h"
#include "crypto/ivgen-plain.h"
diff --git a/crypto/random-gnutls.c b/crypto/random-gnutls.c
index 5350003..445fd6a 100644
--- a/crypto/random-gnutls.c
+++ b/crypto/random-gnutls.c
@@ -21,6 +21,7 @@
#include "qemu/osdep.h"
#include "crypto/random.h"
+#include "qapi/error.h"
#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>
diff --git a/crypto/random-platform.c b/crypto/random-platform.c
index 92eed0e..7541b4c 100644
--- a/crypto/random-platform.c
+++ b/crypto/random-platform.c
@@ -21,6 +21,7 @@
#include "qemu/osdep.h"
#include "crypto/random.h"
+#include "qapi/error.h"
#ifdef _WIN32
#include <wincrypt.h>
diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt
index 06ab699..5900b39 100644
--- a/docs/devel/qapi-code-gen.txt
+++ b/docs/devel/qapi-code-gen.txt
@@ -1170,7 +1170,6 @@
#include "example-qapi-types.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/dispatch.h"
- #include "qapi/error.h"
void example_qmp_init_marshal(QmpCommandList *cmds);
UserDefOne *qmp_my_command(UserDefOneList *arg1, Error **errp);
@@ -1263,7 +1262,6 @@
#ifndef EXAMPLE_QAPI_EVENT_H
#define EXAMPLE_QAPI_EVENT_H
- #include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "example-qapi-types.h"
diff --git a/dump.c b/dump.c
index e9dfed0..7b13baa 100644
--- a/dump.c
+++ b/dump.c
@@ -22,6 +22,7 @@
#include "sysemu/sysemu.h"
#include "sysemu/memory_mapping.h"
#include "sysemu/cpus.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qmp-commands.h"
#include "qapi-event.h"
diff --git a/fsdev/qemu-fsdev-throttle.h b/fsdev/qemu-fsdev-throttle.h
index e418643..4e83bda 100644
--- a/fsdev/qemu-fsdev-throttle.h
+++ b/fsdev/qemu-fsdev-throttle.h
@@ -18,7 +18,6 @@
#include "block/aio.h"
#include "qemu/main-loop.h"
#include "qemu/coroutine.h"
-#include "qapi/error.h"
#include "qemu/throttle.h"
typedef struct FsThrottle {
diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c
index 941e309..de819cf 100644
--- a/fsdev/qemu-fsdev.c
+++ b/fsdev/qemu-fsdev.c
@@ -8,9 +8,10 @@
*
* This work is licensed under the terms of the GNU GPL, version 2. See
* the COPYING file in the top-level directory.
- *
*/
+
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "qemu-fsdev.h"
#include "qemu/queue.h"
#include "qemu-common.h"
diff --git a/hmp.c b/hmp.c
index b3de32d..13550b0 100644
--- a/hmp.c
+++ b/hmp.c
@@ -27,6 +27,7 @@
#include "qemu/sockets.h"
#include "monitor/monitor.h"
#include "monitor/qdev.h"
+#include "qapi/error.h"
#include "qapi/opts-visitor.h"
#include "qapi/qmp/qerror.h"
#include "qapi/string-input-visitor.h"
diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
index b25c185..fe85726 100644
--- a/hw/9pfs/9p-local.c
+++ b/hw/9pfs/9p-local.c
@@ -8,7 +8,6 @@
*
* This work is licensed under the terms of the GNU GPL, version 2. See
* the COPYING file in the top-level directory.
- *
*/
#include "qemu/osdep.h"
@@ -23,6 +22,7 @@
#include <sys/socket.h>
#include <sys/un.h>
#include "qemu/xattr.h"
+#include "qapi/error.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
#include <libgen.h>
diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c
index f030c6a..0f288b1 100644
--- a/hw/9pfs/9p-proxy.c
+++ b/hw/9pfs/9p-proxy.c
@@ -9,10 +9,12 @@
* This work is licensed under the terms of the GNU GPL, version 2. See
* the COPYING file in the top-level directory.
*/
+
#include "qemu/osdep.h"
#include <sys/socket.h>
#include <sys/un.h>
#include "9p.h"
+#include "qapi/error.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
#include "fsdev/qemu-fsdev.h"
diff --git a/hw/acpi/acpi-stub.c b/hw/acpi/acpi-stub.c
index 26bd22f..7dfc8af 100644
--- a/hw/acpi/acpi-stub.c
+++ b/hw/acpi/acpi-stub.c
@@ -19,6 +19,7 @@
*/
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qmp-commands.h"
#include "hw/acpi/acpi.h"
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index eb9b76f..5ee5541 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -18,12 +18,14 @@
* Contributions after 2012-01-13 are licensed under the terms of the
* GNU GPL, version 2 or (at your option) any later version.
*/
+
#include "qemu/osdep.h"
#include "sysemu/sysemu.h"
#include "hw/hw.h"
#include "hw/acpi/acpi.h"
#include "hw/nvram/fw_cfg.h"
#include "qemu/config-file.h"
+#include "qapi/error.h"
#include "qapi/opts-visitor.h"
#include "qapi-visit.h"
#include "qapi-event.h"
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index cda2c9d..ea958a0 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -6,6 +6,7 @@
#include "hw/qdev-core.h"
#include "trace.h"
#include "qapi-event.h"
+#include "qapi/error.h"
#define MEMORY_SLOTS_NUMBER "MDNR"
#define MEMORY_HOTPLUG_IO_REGION "HPMR"
diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
index ba6f47b..f25eafc 100644
--- a/hw/acpi/vmgenid.c
+++ b/hw/acpi/vmgenid.c
@@ -11,6 +11,7 @@
*/
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "qmp-commands.h"
#include "hw/acpi/acpi.h"
#include "hw/acpi/aml-build.h"
diff --git a/hw/adc/stm32f2xx_adc.c b/hw/adc/stm32f2xx_adc.c
index 13f31ad..329a8aa 100644
--- a/hw/adc/stm32f2xx_adc.c
+++ b/hw/adc/stm32f2xx_adc.c
@@ -25,7 +25,6 @@
#include "qemu/osdep.h"
#include "hw/sysbus.h"
#include "hw/hw.h"
-#include "qapi/error.h"
#include "qemu/log.h"
#include "hw/adc/stm32f2xx_adc.h"
diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c
index 56fa402..faae083 100644
--- a/hw/char/mcf_uart.c
+++ b/hw/char/mcf_uart.c
@@ -11,7 +11,6 @@
#include "hw/m68k/mcf.h"
#include "chardev/char-fe.h"
#include "exec/address-spaces.h"
-#include "qapi/error.h"
typedef struct {
SysBusDevice parent_obj;
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index 172c72d..4be5d4e 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -16,6 +16,7 @@
#include "trace.h"
#include "hw/virtio/virtio-serial.h"
#include "qapi-event.h"
+#include "qapi/error.h"
#define TYPE_VIRTIO_CONSOLE_SERIAL_PORT "virtserialport"
#define VIRTIO_CONSOLE(obj) \
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 11f8a27..515cd50 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -28,6 +28,7 @@
#include "qemu/osdep.h"
#include "hw/qdev.h"
#include "sysemu/sysemu.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/visitor.h"
#include "qapi/qmp/qjson.h"
diff --git a/hw/display/milkymist-tmu2.c b/hw/display/milkymist-tmu2.c
index 59120dd..3ce44fd 100644
--- a/hw/display/milkymist-tmu2.c
+++ b/hw/display/milkymist-tmu2.c
@@ -28,6 +28,7 @@
#include "hw/hw.h"
#include "hw/sysbus.h"
#include "trace.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index b9fa067..a71714c 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -21,6 +21,7 @@
#include "qemu/osdep.h"
#include <zlib.h>
+#include "qapi/error.h"
#include "qemu-common.h"
#include "qemu/timer.h"
#include "qemu/queue.h"
diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
index 8c106a6..7db84ef 100644
--- a/hw/display/virtio-gpu-3d.c
+++ b/hw/display/virtio-gpu-3d.c
@@ -17,7 +17,6 @@
#include "trace.h"
#include "hw/virtio/virtio.h"
#include "hw/virtio/virtio-gpu.h"
-#include "qapi/error.h"
#ifdef CONFIG_VIRGL
diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index 3519dc8..cece4aa 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -10,7 +10,9 @@
* See the COPYING file in the top-level directory.
*
*/
+
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "hw/pci/pci.h"
#include "hw/virtio/virtio.h"
#include "hw/virtio/virtio-bus.h"
diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c
index ead4e1a..6715b9c 100644
--- a/hw/display/xlnx_dp.c
+++ b/hw/display/xlnx_dp.c
@@ -23,6 +23,7 @@
*/
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "qemu/log.h"
#include "hw/display/xlnx_dp.h"
diff --git a/hw/i2c/ppc4xx_i2c.c b/hw/i2c/ppc4xx_i2c.c
index e873a44..ab64d19 100644
--- a/hw/i2c/ppc4xx_i2c.c
+++ b/hw/i2c/ppc4xx_i2c.c
@@ -25,7 +25,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "qemu-common.h"
#include "qemu/log.h"
#include "cpu.h"
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index ccc50ba..f610253 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include "hw/hw.h"
#include "hw/i386/pc.h"
@@ -64,6 +65,7 @@
#include "hw/pci/pci_host.h"
#include "acpi-build.h"
#include "hw/mem/pc-dimm.h"
+#include "qapi/error.h"
#include "qapi/visitor.h"
#include "qapi-visit.h"
#include "qom/cpu.h"
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index a25619d..456dc9e 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -47,6 +47,7 @@
#include "exec/address-spaces.h"
#include "hw/acpi/acpi.h"
#include "cpu.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#ifdef CONFIG_XEN
#include <xen/hvm/hvm_info_table.h>
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index ed3a0b8..aba7541 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -27,6 +27,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include "hw/hw.h"
#include "hw/loader.h"
@@ -48,6 +49,7 @@
#include "hw/ide/pci.h"
#include "hw/ide/ahci.h"
#include "hw/usb.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "sysemu/numa.h"
diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index 8028bed..bfdbe55 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -17,7 +17,7 @@
#include "hw/xen/xen_common.h"
#include "hw/xen/xen_backend.h"
#include "qmp-commands.h"
-
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/range.h"
#include "sysemu/xen-mapcache.h"
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 5be72d4..257b429 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -22,6 +22,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include "hw/hw.h"
#include "hw/pci/pci.h"
@@ -33,6 +34,7 @@
#include "sysemu/dma.h"
#include "hw/block/block.h"
#include "sysemu/block-backend.h"
+#include "qapi/error.h"
#include "qemu/cutils.h"
#include "hw/ide/internal.h"
diff --git a/hw/intc/xics_pnv.c b/hw/intc/xics_pnv.c
index 2a955a8..c87de21 100644
--- a/hw/intc/xics_pnv.c
+++ b/hw/intc/xics_pnv.c
@@ -19,7 +19,6 @@
#include "qemu/osdep.h"
#include "sysemu/sysemu.h"
-#include "qapi/error.h"
#include "qemu/log.h"
#include "hw/ppc/xics.h"
diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c
index 5a0967c..2e27b92 100644
--- a/hw/intc/xics_spapr.c
+++ b/hw/intc/xics_spapr.c
@@ -34,7 +34,6 @@
#include "hw/ppc/xics.h"
#include "hw/ppc/fdt.h"
#include "qapi/visitor.h"
-#include "qapi/error.h"
/*
* Guest interfaces
diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c
index b27babd..adbbf6e 100644
--- a/hw/ipmi/ipmi.c
+++ b/hw/ipmi/ipmi.c
@@ -28,6 +28,7 @@
#include "sysemu/sysemu.h"
#include "qmp-commands.h"
#include "qom/object_interfaces.h"
+#include "qapi/error.h"
#include "qapi/visitor.h"
static uint32_t ipmi_current_uuid = 1;
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index 596f3c2..b09871a 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -45,6 +45,7 @@
#include "hw/sysbus.h"
#include "exec/address-spaces.h"
#include "sysemu/qtest.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/help_option.h"
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 7ca8ba2..6f0deb9 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -51,6 +51,7 @@
#include "hw/sysbus.h" /* SysBusDevice */
#include "qemu/host-utils.h"
#include "sysemu/qtest.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "hw/empty_slot.h"
#include "sysemu/kvm.h"
diff --git a/hw/misc/exynos4210_rng.c b/hw/misc/exynos4210_rng.c
index 31ebe38..4ecbebd 100644
--- a/hw/misc/exynos4210_rng.c
+++ b/hw/misc/exynos4210_rng.c
@@ -20,6 +20,7 @@
#include "qemu/osdep.h"
#include "crypto/random.h"
#include "hw/sysbus.h"
+#include "qapi/error.h"
#include "qemu/log.h"
#define DEBUG_EXYNOS_RNG 0
diff --git a/hw/misc/mips_cmgcr.c b/hw/misc/mips_cmgcr.c
index 211f609..d019d41 100644
--- a/hw/misc/mips_cmgcr.c
+++ b/hw/misc/mips_cmgcr.c
@@ -10,7 +10,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "qemu/log.h"
#include "hw/hw.h"
#include "hw/sysbus.h"
diff --git a/hw/misc/mps2-scc.c b/hw/misc/mps2-scc.c
index 32be2a9..6a9d251 100644
--- a/hw/misc/mps2-scc.c
+++ b/hw/misc/mps2-scc.c
@@ -19,7 +19,6 @@
#include "qemu/osdep.h"
#include "qemu/log.h"
-#include "qapi/error.h"
#include "trace.h"
#include "hw/sysbus.h"
#include "hw/registerfields.h"
diff --git a/hw/net/rocker/qmp-norocker.c b/hw/net/rocker/qmp-norocker.c
index 6acbcdb..94c1e48 100644
--- a/hw/net/rocker/qmp-norocker.c
+++ b/hw/net/rocker/qmp-norocker.c
@@ -18,6 +18,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qmp-commands.h"
+#include "qapi/error.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 823a29d..a2a76c2 100644
--- a/hw/net/rocker/rocker.c
+++ b/hw/net/rocker/rocker.c
@@ -21,6 +21,7 @@
#include "hw/pci/msix.h"
#include "net/net.h"
#include "net/eth.h"
+#include "qapi/error.h"
#include "qemu/iov.h"
#include "qemu/bitops.h"
#include "qmp-commands.h"
diff --git a/hw/net/rocker/rocker_of_dpa.c b/hw/net/rocker/rocker_of_dpa.c
index 191a58e..9339df2 100644
--- a/hw/net/rocker/rocker_of_dpa.c
+++ b/hw/net/rocker/rocker_of_dpa.c
@@ -16,6 +16,7 @@
#include "qemu/osdep.h"
#include "net/eth.h"
+#include "qapi/error.h"
#include "qemu/iov.h"
#include "qemu/timer.h"
#include "qmp-commands.h"
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 38674b0..0dd3cb8 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -22,6 +22,7 @@
#include "hw/virtio/virtio-net.h"
#include "net/vhost_net.h"
#include "hw/virtio/virtio-bus.h"
+#include "qapi/error.h"
#include "qapi/qmp/qjson.h"
#include "qapi-event.h"
#include "hw/virtio/virtio-access.h"
diff --git a/hw/nios2/cpu_pic.c b/hw/nios2/cpu_pic.c
index 0f95987..6bccce2 100644
--- a/hw/nios2/cpu_pic.c
+++ b/hw/nios2/cpu_pic.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "qemu-common.h"
#include "cpu.h"
diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
index cb522bf..f557b12 100644
--- a/hw/pci-bridge/i82801b11.c
+++ b/hw/pci-bridge/i82801b11.c
@@ -44,8 +44,6 @@
#include "qemu/osdep.h"
#include "hw/pci/pci.h"
#include "hw/i386/ich9.h"
-#include "qapi/error.h"
-
/*****************************************************************************/
/* ICH9 DMI-to-PCI bridge */
diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c
index 5f56a2f..79fa84d 100644
--- a/hw/pci-bridge/ioh3420.c
+++ b/hw/pci-bridge/ioh3420.c
@@ -25,7 +25,6 @@
#include "hw/pci/msi.h"
#include "hw/pci/pcie.h"
#include "ioh3420.h"
-#include "qapi/error.h"
#define PCI_DEVICE_ID_IOH_EPORT 0x3420 /* D0:F0 express mode */
#define PCI_DEVICE_ID_IOH_REV 0x2
diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c
index 227997c..df56925 100644
--- a/hw/pci-bridge/xio3130_upstream.c
+++ b/hw/pci-bridge/xio3130_upstream.c
@@ -24,7 +24,6 @@
#include "hw/pci/msi.h"
#include "hw/pci/pcie.h"
#include "xio3130_upstream.h"
-#include "qapi/error.h"
#define PCI_DEVICE_ID_TI_XIO3130U 0x8232 /* upstream port */
#define XIO3130_REVISION 0x2
diff --git a/hw/pci-host/sabre.c b/hw/pci-host/sabre.c
index 2268a41..e2f4ee4 100644
--- a/hw/pci-host/sabre.c
+++ b/hw/pci-host/sabre.c
@@ -34,7 +34,6 @@
#include "hw/pci-host/sabre.h"
#include "sysemu/sysemu.h"
#include "exec/address-spaces.h"
-#include "qapi/error.h"
#include "qemu/log.h"
#include "trace.h"
diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c
index d5ce007..74ce731 100644
--- a/hw/pci/pci-stub.c
+++ b/hw/pci/pci-stub.c
@@ -21,6 +21,7 @@
#include "qemu/osdep.h"
#include "sysemu/sysemu.h"
#include "monitor/monitor.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "hw/pci/pci.h"
#include "qmp-commands.h"
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index fc25cde..239f73d 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include "hw/hw.h"
#include "hw/pci/pci.h"
@@ -40,6 +41,7 @@
#include "exec/address-spaces.h"
#include "hw/hotplug.h"
#include "hw/boards.h"
+#include "qapi/error.h"
#include "qemu/cutils.h"
//#define DEBUG_PCI
diff --git a/hw/ppc/fdt.c b/hw/ppc/fdt.c
index 38a7234..2ffc586 100644
--- a/hw/ppc/fdt.c
+++ b/hw/ppc/fdt.c
@@ -8,7 +8,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "target/ppc/cpu.h"
#include "hw/ppc/fdt.h"
diff --git a/hw/ppc/pnv_bmc.c b/hw/ppc/pnv_bmc.c
index b2cf441..4b76d34 100644
--- a/hw/ppc/pnv_bmc.c
+++ b/hw/ppc/pnv_bmc.c
@@ -20,7 +20,6 @@
#include "hw/hw.h"
#include "sysemu/sysemu.h"
#include "target/ppc/cpu.h"
-#include "qapi/error.h"
#include "qemu/log.h"
#include "hw/ipmi/ipmi.h"
#include "hw/ppc/fdt.h"
diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c
index 99c40ef..46fae41 100644
--- a/hw/ppc/pnv_xscom.c
+++ b/hw/ppc/pnv_xscom.c
@@ -17,7 +17,6 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "hw/hw.h"
#include "qemu/log.h"
#include "sysemu/hw_accel.h"
diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index 7ec35de..ec4be25 100644
--- a/hw/ppc/ppc.c
+++ b/hw/ppc/ppc.c
@@ -33,7 +33,6 @@
#include "hw/timer/m48t59.h"
#include "qemu/log.h"
#include "qemu/error-report.h"
-#include "qapi/error.h"
#include "hw/loader.h"
#include "sysemu/kvm.h"
#include "kvm_ppc.h"
diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c
index 053efb0..71491db 100644
--- a/hw/ppc/spapr_pci_vfio.c
+++ b/hw/ppc/spapr_pci_vfio.c
@@ -19,7 +19,6 @@
#include "qemu/osdep.h"
#include <linux/vfio.h>
-#include "qapi/error.h"
#include "qemu-common.h"
#include "cpu.h"
#include "hw/ppc/spapr.h"
diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c
index 9ec3078..cfdb274 100644
--- a/hw/ppc/spapr_rtc.c
+++ b/hw/ppc/spapr_rtc.c
@@ -23,14 +23,15 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
- *
*/
+
#include "qemu/osdep.h"
#include "cpu.h"
#include "qemu/timer.h"
#include "sysemu/sysemu.h"
#include "hw/ppc/spapr.h"
#include "qapi-event.h"
+#include "qapi/error.h"
#include "qemu/cutils.h"
void spapr_rtc_read(sPAPRRTCState *rtc, struct tm *tm, uint32_t *ns)
diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c
index 53ad5d3..fd994f8 100644
--- a/hw/s390x/s390-skeys.c
+++ b/hw/s390x/s390-skeys.c
@@ -13,6 +13,7 @@
#include "hw/boards.h"
#include "qmp-commands.h"
#include "hw/s390x/storage-keys.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "sysemu/kvm.h"
#include "migration/register.h"
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index ee586e7..45975c2 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -27,7 +27,6 @@
#include "hw/sysbus.h"
#include "hw/scsi/esp.h"
#include "trace.h"
-#include "qapi/error.h"
#include "qemu/log.h"
/*
diff --git a/hw/scsi/vhost-scsi-common.c b/hw/scsi/vhost-scsi-common.c
index d434b3e..77e9897 100644
--- a/hw/scsi/vhost-scsi-common.c
+++ b/hw/scsi/vhost-scsi-common.c
@@ -16,7 +16,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "qemu/error-report.h"
#include "migration/migration.h"
#include "hw/virtio/vhost.h"
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index fac7fa5..37b2172 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -32,7 +32,6 @@
#include "qemu/bitops.h"
#include "hw/sd/sdhci.h"
#include "sdhci-internal.h"
-#include "qapi/error.h"
#include "qemu/log.h"
#include "trace.h"
diff --git a/hw/smbios/smbios-stub.c b/hw/smbios/smbios-stub.c
index 3087394..61becef 100644
--- a/hw/smbios/smbios-stub.c
+++ b/hw/smbios/smbios-stub.c
@@ -21,6 +21,7 @@
*/
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qmp-commands.h"
#include "hw/smbios/smbios.h"
diff --git a/hw/sparc64/niagara.c b/hw/sparc64/niagara.c
index 996ce2a..1874477 100644
--- a/hw/sparc64/niagara.c
+++ b/hw/sparc64/niagara.c
@@ -23,7 +23,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "qemu-common.h"
#include "cpu.h"
#include "hw/hw.h"
diff --git a/hw/sparc64/sun4u_iommu.c b/hw/sparc64/sun4u_iommu.c
index 4cf8e69..eb3aaa8 100644
--- a/hw/sparc64/sun4u_iommu.c
+++ b/hw/sparc64/sun4u_iommu.c
@@ -28,7 +28,6 @@
#include "hw/sysbus.h"
#include "hw/sparc/sun4u_iommu.h"
#include "exec/address-spaces.h"
-#include "qapi/error.h"
#include "qemu/log.h"
#include "trace.h"
diff --git a/hw/ssi/stm32f2xx_spi.c b/hw/ssi/stm32f2xx_spi.c
index 69514da..930c616 100644
--- a/hw/ssi/stm32f2xx_spi.c
+++ b/hw/ssi/stm32f2xx_spi.c
@@ -23,7 +23,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "qemu/log.h"
#include "hw/ssi/stm32f2xx_spi.h"
diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c
index 844aad5..742c576 100644
--- a/hw/timer/m48t59.c
+++ b/hw/timer/m48t59.c
@@ -25,7 +25,6 @@
#include "qemu/osdep.h"
#include "hw/hw.h"
#include "hw/timer/m48t59.h"
-#include "qapi/error.h"
#include "qemu/timer.h"
#include "sysemu/sysemu.h"
#include "hw/sysbus.h"
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index 35a05a6..9d93a16 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include "qemu/cutils.h"
#include "qemu/bcd.h"
@@ -29,6 +30,7 @@
#include "sysemu/sysemu.h"
#include "sysemu/replay.h"
#include "hw/timer/mc146818rtc.h"
+#include "qapi/error.h"
#include "qapi/visitor.h"
#include "qapi-event.h"
#include "qmp-commands.h"
diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c
index 085ed2c..b7dd360 100644
--- a/hw/usb/ccid-card-passthru.c
+++ b/hw/usb/ccid-card-passthru.c
@@ -9,7 +9,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include <cacard/vscard_common.h>
#include "chardev/char-fe.h"
#include "qemu/error-report.h"
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 14e08d2..e05df20 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -23,6 +23,7 @@
#include "hw/virtio/virtio-balloon.h"
#include "sysemu/kvm.h"
#include "exec/address-spaces.h"
+#include "qapi/error.h"
#include "qapi/visitor.h"
#include "qapi-event.h"
#include "trace.h"
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 670114e..25dcb25 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -23,6 +23,7 @@
#include "qemu/option.h"
#include "qemu/config-file.h"
#include "qemu/queue.h"
+#include "qapi/error.h"
#include "qapi/qmp/types.h"
#include "sysemu/sysemu.h"
#include "sysemu/watchdog.h"
diff --git a/include/crypto/random.h b/include/crypto/random.h
index a07229c..8764ca0 100644
--- a/include/crypto/random.h
+++ b/include/crypto/random.h
@@ -22,8 +22,6 @@
#define QCRYPTO_RANDOM_H
#include "qemu-common.h"
-#include "qapi/error.h"
-
/**
* qcrypto_random_bytes:
diff --git a/include/crypto/xts.h b/include/crypto/xts.h
index da32ab8..3c8967a 100644
--- a/include/crypto/xts.h
+++ b/include/crypto/xts.h
@@ -27,8 +27,6 @@
#define QCRYPTO_XTS_H
#include "qemu-common.h"
-#include "qapi/error.h"
-
#define XTS_BLOCK_SIZE 16
diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h
index 31851b4..88212f5 100644
--- a/include/hw/ide/internal.h
+++ b/include/hw/ide/internal.h
@@ -12,7 +12,6 @@
#include "sysemu/sysemu.h"
#include "hw/block/block.h"
#include "scsi/constants.h"
-#include "qapi/error.h"
/* debug IDE devices */
#define USE_DMA_CDROM
diff --git a/include/ui/console.h b/include/ui/console.h
index 2a5efa7..f3a1ec2 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -6,7 +6,6 @@
#include "qapi/qmp/qdict.h"
#include "qemu/notify.h"
#include "qemu/error-report.h"
-#include "qapi/error.h"
#ifdef CONFIG_OPENGL
# include <epoxy/gl.h>
diff --git a/iothread.c b/iothread.c
index d8b6c1f..4b9bbde 100644
--- a/iothread.c
+++ b/iothread.c
@@ -19,6 +19,7 @@
#include "block/block.h"
#include "sysemu/iothread.h"
#include "qmp-commands.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/rcu.h"
#include "qemu/main-loop.h"
diff --git a/migration/colo-failover.c b/migration/colo-failover.c
index 6563862..891785c 100644
--- a/migration/colo-failover.c
+++ b/migration/colo-failover.c
@@ -16,6 +16,7 @@
#include "qemu/main-loop.h"
#include "migration.h"
#include "qmp-commands.h"
+#include "qapi/error.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 dee3aa8..245a46d 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -12,6 +12,7 @@
#include "qemu/osdep.h"
#include "sysemu/sysemu.h"
+#include "qapi/error.h"
#include "qemu-file-channel.h"
#include "migration.h"
#include "qemu-file.h"
diff --git a/migration/exec.c b/migration/exec.c
index c953797..0bc5a42 100644
--- a/migration/exec.c
+++ b/migration/exec.c
@@ -18,7 +18,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "channel.h"
#include "exec.h"
#include "io/channel-command.h"
diff --git a/migration/fd.c b/migration/fd.c
index 6284a97..cd06182 100644
--- a/migration/fd.c
+++ b/migration/fd.c
@@ -15,7 +15,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "channel.h"
#include "fd.h"
#include "monitor/monitor.h"
diff --git a/migration/migration.c b/migration/migration.c
index 0fdb2e4..274160e 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -30,6 +30,7 @@
#include "qemu-file.h"
#include "migration/vmstate.h"
#include "block/block.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/rcu.h"
#include "block.h"
diff --git a/migration/ram.c b/migration/ram.c
index 5a109ef..8333d8e 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -25,6 +25,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include "cpu.h"
#include <zlib.h>
@@ -42,6 +43,7 @@
#include "postcopy-ram.h"
#include "migration/page_cache.h"
#include "qemu/error-report.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "trace.h"
#include "exec/ram_addr.h"
diff --git a/migration/savevm.c b/migration/savevm.c
index f202c3d..3f611c0 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -40,6 +40,7 @@
#include "qemu-file.h"
#include "savevm.h"
#include "postcopy-ram.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
#include "sysemu/cpus.h"
diff --git a/monitor.c b/monitor.c
index b9da5e2..2de69f6 100644
--- a/monitor.c
+++ b/monitor.c
@@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include <dirent.h>
#include "qemu-common.h"
@@ -70,6 +71,7 @@
#include "hmp.h"
#include "qemu/thread.h"
#include "block/qapi.h"
+#include "qapi/error.h"
#include "qapi/qmp-event.h"
#include "qapi-event.h"
#include "qmp-introspect.h"
diff --git a/nbd/common.c b/nbd/common.c
index 6047d71..6295526 100644
--- a/nbd/common.c
+++ b/nbd/common.c
@@ -17,7 +17,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "trace.h"
#include "nbd-internal.h"
diff --git a/net/filter-replay.c b/net/filter-replay.c
index cff65f8..09e68fd 100644
--- a/net/filter-replay.c
+++ b/net/filter-replay.c
@@ -11,7 +11,6 @@
#include "qemu/osdep.h"
#include "clients.h"
-#include "qapi/error.h"
#include "qemu-common.h"
#include "qemu/error-report.h"
#include "qemu/iov.h"
diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c
index 2be388f..3ea3798 100644
--- a/net/filter-rewriter.c
+++ b/net/filter-rewriter.c
@@ -15,7 +15,6 @@
#include "net/filter.h"
#include "net/net.h"
#include "qemu-common.h"
-#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
#include "qapi-visit.h"
diff --git a/net/net.c b/net/net.c
index e1569e7..b36449d 100644
--- a/net/net.c
+++ b/net/net.c
@@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include "net/net.h"
@@ -43,6 +44,7 @@
#include "qemu/iov.h"
#include "qemu/main-loop.h"
#include "qapi-visit.h"
+#include "qapi/error.h"
#include "qapi/opts-visitor.h"
#include "sysemu/sysemu.h"
#include "sysemu/qtest.h"
diff --git a/net/vhost-user.c b/net/vhost-user.c
index c23927c..fd76650 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -13,6 +13,7 @@
#include "net/vhost_net.h"
#include "net/vhost-user.h"
#include "chardev/char-fe.h"
+#include "qapi/error.h"
#include "qemu/config-file.h"
#include "qemu/error-report.h"
#include "qmp-commands.h"
diff --git a/numa.c b/numa.c
index a9528aa..7e0e789 100644
--- a/numa.c
+++ b/numa.c
@@ -30,6 +30,7 @@
#include "qom/cpu.h"
#include "qemu/error-report.h"
#include "qapi-visit.h"
+#include "qapi/error.h"
#include "qapi/opts-visitor.h"
#include "hw/boards.h"
#include "sysemu/hostmem.h"
diff --git a/qdev-monitor.c b/qdev-monitor.c
index c436616..0aa8a6c 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -24,6 +24,7 @@
#include "monitor/qdev.h"
#include "qmp-commands.h"
#include "sysemu/arch_init.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/config-file.h"
#include "qemu/error-report.h"
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index e809e38..88807f3 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -18,6 +18,7 @@
#include <dirent.h>
#include "qga/guest-agent-core.h"
#include "qga-qmp-commands.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/queue.h"
#include "qemu/host-utils.h"
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index d79974f..bedae32 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -14,6 +14,7 @@
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0600
#endif
+
#include "qemu/osdep.h"
#include <wtypes.h>
#include <powrprof.h>
@@ -34,6 +35,7 @@
#include "qga/guest-agent-core.h"
#include "qga/vss-win32.h"
#include "qga-qmp-commands.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/queue.h"
#include "qemu/host-utils.h"
diff --git a/qga/commands.c b/qga/commands.c
index ff89e80..6d710db 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -13,6 +13,7 @@
#include "qemu/osdep.h"
#include "qga/guest-agent-core.h"
#include "qga-qmp-commands.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/base64.h"
#include "qemu/cutils.h"
diff --git a/qga/main.c b/qga/main.c
index 62a6275..57083ca 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -10,6 +10,7 @@
* 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 <getopt.h>
#include <glib/gstdio.h>
@@ -23,6 +24,7 @@
#include "qga/guest-agent-core.h"
#include "qemu/module.h"
#include "qapi/qmp/qerror.h"
+#include "qapi/error.h"
#include "qapi/qmp/dispatch.h"
#include "qga/channel.h"
#include "qemu/bswap.h"
diff --git a/qga/vss-win32.c b/qga/vss-win32.c
index dcb2756..0199c2a 100644
--- a/qga/vss-win32.c
+++ b/qga/vss-win32.c
@@ -12,6 +12,7 @@
#include "qemu/osdep.h"
#include <windows.h>
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qga/guest-agent-core.h"
#include "qga/vss-win32.h"
diff --git a/qmp.c b/qmp.c
index 52cfd2d..a56faf1 100644
--- a/qmp.c
+++ b/qmp.c
@@ -30,6 +30,7 @@
#include "sysemu/blockdev.h"
#include "sysemu/block-backend.h"
#include "qom/qom-qobject.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qobject.h"
#include "qapi/qobject-input-visitor.h"
diff --git a/qobject/qnum.c b/qobject/qnum.c
index 410686a..517610d 100644
--- a/qobject/qnum.c
+++ b/qobject/qnum.c
@@ -13,7 +13,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qobject.h"
#include "qemu-common.h"
diff --git a/replay/replay-input.c b/replay/replay-input.c
index bd93554..3ab1536 100644
--- a/replay/replay-input.c
+++ b/replay/replay-input.c
@@ -10,7 +10,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "qemu-common.h"
#include "sysemu/replay.h"
#include "replay-internal.h"
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 974d0a4..dc7c418 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -289,6 +289,7 @@
c_comment, h_comment)
fdef.write(mcgen('''
+
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/module.h"
@@ -297,6 +298,7 @@
#include "qapi/qobject-output-visitor.h"
#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"
@@ -308,7 +310,6 @@
#include "%(prefix)sqapi-types.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/dispatch.h"
-#include "qapi/error.h"
void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
''',
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index 07b4b70..9d71346 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -209,6 +209,7 @@
#include "qemu-common.h"
#include "%(prefix)sqapi-event.h"
#include "%(prefix)sqapi-visit.h"
+#include "qapi/error.h"
#include "qapi/qobject-output-visitor.h"
#include "qapi/qmp-event.h"
@@ -216,7 +217,6 @@
prefix=prefix))
fdecl.write(mcgen('''
-#include "qapi/error.h"
#include "qapi/util.h"
#include "qapi/qmp/qdict.h"
#include "%(prefix)sqapi-types.h"
diff --git a/stubs/arch-query-cpu-def.c b/stubs/arch-query-cpu-def.c
index cefe4be..d436f95 100644
--- a/stubs/arch-query-cpu-def.c
+++ b/stubs/arch-query-cpu-def.c
@@ -1,6 +1,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "sysemu/arch_init.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
diff --git a/stubs/arch-query-cpu-model-baseline.c b/stubs/arch-query-cpu-model-baseline.c
index 094ec13..0d066da 100644
--- a/stubs/arch-query-cpu-model-baseline.c
+++ b/stubs/arch-query-cpu-model-baseline.c
@@ -1,6 +1,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "sysemu/arch_init.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
CpuModelBaselineInfo *arch_query_cpu_model_baseline(CpuModelInfo *modela,
diff --git a/stubs/arch-query-cpu-model-comparison.c b/stubs/arch-query-cpu-model-comparison.c
index d5486ae..8eb311a 100644
--- a/stubs/arch-query-cpu-model-comparison.c
+++ b/stubs/arch-query-cpu-model-comparison.c
@@ -1,6 +1,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "sysemu/arch_init.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
CpuModelCompareInfo *arch_query_cpu_model_comparison(CpuModelInfo *modela,
diff --git a/stubs/arch-query-cpu-model-expansion.c b/stubs/arch-query-cpu-model-expansion.c
index ae7cf55..26273a8 100644
--- a/stubs/arch-query-cpu-model-expansion.c
+++ b/stubs/arch-query-cpu-model-expansion.c
@@ -1,6 +1,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "sysemu/arch_init.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,
diff --git a/stubs/vmgenid.c b/stubs/vmgenid.c
index c64eb7a..3c8fe55 100644
--- a/stubs/vmgenid.c
+++ b/stubs/vmgenid.c
@@ -1,5 +1,6 @@
#include "qemu/osdep.h"
#include "qmp-commands.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
GuidInfo *qmp_query_vm_generation_id(Error **errp)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 6b4103c..0378193 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -16,6 +16,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
+
#include "qemu/osdep.h"
#include "qemu/cutils.h"
@@ -29,6 +30,7 @@
#include "qemu/error-report.h"
#include "qemu/option.h"
#include "qemu/config-file.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/types.h"
diff --git a/target/i386/xsave_helper.c b/target/i386/xsave_helper.c
index ca735ee..52ea7e6 100644
--- a/target/i386/xsave_helper.c
+++ b/target/i386/xsave_helper.c
@@ -3,7 +3,6 @@
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "qemu-common.h"
#include "cpu.h"
diff --git a/target/nios2/helper.c b/target/nios2/helper.c
index a169c91..a8b8ec6 100644
--- a/target/nios2/helper.c
+++ b/target/nios2/helper.c
@@ -22,7 +22,6 @@
#include "cpu.h"
#include "qemu/host-utils.h"
-#include "qapi/error.h"
#include "exec/exec-all.h"
#include "exec/log.h"
#include "exec/helper-proto.h"
diff --git a/target/ppc/mmu-book3s-v3.c b/target/ppc/mmu-book3s-v3.c
index e7798b3..b60df44 100644
--- a/target/ppc/mmu-book3s-v3.c
+++ b/target/ppc/mmu-book3s-v3.c
@@ -18,7 +18,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "cpu.h"
#include "mmu-hash64.h"
#include "mmu-book3s-v3.h"
diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c
index 14d34e5..c9b72b7 100644
--- a/target/ppc/mmu-hash64.c
+++ b/target/ppc/mmu-hash64.c
@@ -18,7 +18,6 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "cpu.h"
#include "exec/exec-all.h"
#include "exec/helper-proto.h"
diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c
index bbd37e3..ab76cbc 100644
--- a/target/ppc/mmu-radix64.c
+++ b/target/ppc/mmu-radix64.c
@@ -18,7 +18,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "cpu.h"
#include "exec/exec-all.h"
#include "exec/helper-proto.h"
diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c
index 16ef5ac..5568d16 100644
--- a/target/ppc/mmu_helper.c
+++ b/target/ppc/mmu_helper.c
@@ -17,7 +17,6 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "cpu.h"
#include "exec/helper-proto.h"
#include "sysemu/kvm.h"
diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c
index e7b1044..972f4ca 100644
--- a/target/ppc/translate_init.c
+++ b/target/ppc/translate_init.c
@@ -29,6 +29,7 @@
#include "mmu-hash32.h"
#include "mmu-hash64.h"
#include "qemu/error-report.h"
+#include "qapi/error.h"
#include "qapi/visitor.h"
#include "hw/qdev-properties.h"
#include "hw/ppc/ppc.h"
diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c
index e8f7a40..6967fbf 100644
--- a/target/s390x/excp_helper.c
+++ b/target/s390x/excp_helper.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "cpu.h"
#include "internal.h"
#include "qemu/timer.h"
diff --git a/target/s390x/helper.c b/target/s390x/helper.c
index 35d9741..84aaef3 100644
--- a/target/s390x/helper.c
+++ b/target/s390x/helper.c
@@ -19,7 +19,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "cpu.h"
#include "internal.h"
#include "exec/gdbstub.h"
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index 8736001..63c531e 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -31,6 +31,7 @@
#include "cpu.h"
#include "internal.h"
#include "kvm_s390x.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/timer.h"
#include "sysemu/sysemu.h"
diff --git a/tests/check-qlist.c b/tests/check-qlist.c
index 894e991..259980d 100644
--- a/tests/check-qlist.c
+++ b/tests/check-qlist.c
@@ -11,7 +11,6 @@
*/
#include "qemu/osdep.h"
-#include "qapi/error.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qlist.h"
diff --git a/tests/check-qnum.c b/tests/check-qnum.c
index d702d5d..2b667f7 100644
--- a/tests/check-qnum.c
+++ b/tests/check-qnum.c
@@ -15,7 +15,6 @@
#include "qemu/osdep.h"
#include "qapi/qmp/qnum.h"
-#include "qapi/error.h"
#include "qemu-common.h"
/*
diff --git a/tests/io-channel-helpers.c b/tests/io-channel-helpers.c
index 5430e13..ab988ef 100644
--- a/tests/io-channel-helpers.c
+++ b/tests/io-channel-helpers.c
@@ -20,7 +20,6 @@
#include "qemu/osdep.h"
#include "io-channel-helpers.h"
-#include "qapi/error.h"
#include "qemu/iov.h"
struct QIOChannelTest {
diff --git a/tests/test-aio-multithread.c b/tests/test-aio-multithread.c
index c8bec81..6440d54 100644
--- a/tests/test-aio-multithread.c
+++ b/tests/test-aio-multithread.c
@@ -12,7 +12,6 @@
#include "qemu/osdep.h"
#include "block/aio.h"
-#include "qapi/error.h"
#include "qemu/coroutine.h"
#include "qemu/thread.h"
#include "qemu/error-report.h"
diff --git a/tests/test-qmp-commands.c b/tests/test-qmp-commands.c
index 904c89d..52c1802 100644
--- a/tests/test-qmp-commands.c
+++ b/tests/test-qmp-commands.c
@@ -2,6 +2,7 @@
#include "qemu-common.h"
#include "qapi/qmp/types.h"
#include "test-qmp-commands.h"
+#include "qapi/error.h"
#include "qapi/qmp/dispatch.h"
#include "qemu/module.h"
#include "qapi/qobject-input-visitor.h"
diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
index 46825b4..5be2d8e 100644
--- a/tests/test-qmp-event.c
+++ b/tests/test-qmp-event.c
@@ -16,6 +16,7 @@
#include "qemu-common.h"
#include "test-qapi-visit.h"
#include "test-qapi-event.h"
+#include "qapi/error.h"
#include "qapi/qmp/types.h"
#include "qapi/qmp/qobject.h"
#include "qapi/qmp-event.h"
diff --git a/tests/test-x86-cpuid-compat.c b/tests/test-x86-cpuid-compat.c
index 58a2dd9..c594b5b 100644
--- a/tests/test-x86-cpuid-compat.c
+++ b/tests/test-x86-cpuid-compat.c
@@ -1,6 +1,5 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
-#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qbool.h"
diff --git a/tpm.c b/tpm.c
index 61a4341..d11b10b 100644
--- a/tpm.c
+++ b/tpm.c
@@ -11,8 +11,10 @@
*
* Based on net.c
*/
+
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "sysemu/tpm_backend.h"
#include "sysemu/tpm.h"
diff --git a/trace/qmp.c b/trace/qmp.c
index ac777d1..ccd35cd 100644
--- a/trace/qmp.c
+++ b/trace/qmp.c
@@ -8,6 +8,7 @@
*/
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "qmp-commands.h"
#include "trace/control.h"
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 6be9848..51db47c 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -31,6 +31,7 @@
#include "ui/console.h"
#include "ui/input.h"
#include "sysemu/sysemu.h"
+#include "qapi/error.h"
#include "qmp-commands.h"
#include "sysemu/blockdev.h"
#include "qemu-version.h"
diff --git a/ui/console.c b/ui/console.c
index c4c95ab..f678979 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -21,10 +21,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "ui/console.h"
#include "hw/qdev-core.h"
+#include "qapi/error.h"
#include "qemu/timer.h"
#include "qmp-commands.h"
#include "chardev/char-fe.h"
diff --git a/ui/gtk.c b/ui/gtk.c
index f0ad63e..1537751 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -36,6 +36,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
+#include "qapi/error.h"
#include "qemu/cutils.h"
#include "ui/console.h"
diff --git a/ui/input.c b/ui/input.c
index ab22c84..a5f1cbb 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -1,5 +1,6 @@
#include "qemu/osdep.h"
#include "sysemu/sysemu.h"
+#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qmp-commands.h"
#include "trace.h"
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 2baf0c7..7a53db0 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -30,6 +30,7 @@
#include "qemu-x509.h"
#include "qemu/sockets.h"
#include "qmp-commands.h"
+#include "qapi/error.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qstring.h"
#include "qapi/qmp/qjson.h"
diff --git a/ui/vnc.c b/ui/vnc.c
index 93731ac..b1388f0 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -34,6 +34,7 @@
#include "qemu/timer.h"
#include "qemu/acl.h"
#include "qemu/config-file.h"
+#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/types.h"
#include "qmp-commands.h"
diff --git a/util/qemu-config.c b/util/qemu-config.c
index 029fec5..26ea248 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -1,4 +1,5 @@
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "qemu-common.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
diff --git a/vl.c b/vl.c
index e4c2421..5570f1d 100644
--- a/vl.c
+++ b/vl.c
@@ -21,7 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "qemu-version.h"
#include "qemu/cutils.h"
#include "qemu/help_option.h"