include/qemu/osdep.h: Don't include qapi/error.h

Commit 57cb38b included qapi/error.h into qemu/osdep.h to get the
Error typedef.  Since then, we've moved to include qemu/osdep.h
everywhere.  Its file comment explains: "To avoid getting into
possible circular include dependencies, this file should not include
any other QEMU headers, with the exceptions of config-host.h,
compiler.h, os-posix.h and os-win32.h, all of which are doing a
similar job to this file and are under similar constraints."
qapi/error.h doesn't do a similar job, and it doesn't adhere to
similar constraints: it includes qapi-types.h.  That's in excess of
100KiB of crap most .c files don't actually need.

Add the typedef to qemu/typedefs.h, and include that instead of
qapi/error.h.  Include qapi/error.h in .c files that need it and don't
get it now.  Include qapi-types.h in qom/object.h for uint16List.

Update scripts/clean-includes accordingly.  Update it further to match
reality: replace config.h by config-target.h, add sysemu/os-posix.h,
sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
comment quoted above similarly.

This reduces the number of objects depending on qapi/error.h from "all
of them" to less than a third.  Unfortunately, the number depending on
qapi-types.h shrinks only a little.  More work is needed for that one.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
[Fix compilation without the spice devel packages. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Markus Armbruster
2016-03-22 22:20:15 +01:00
committed by Paolo Bonzini
parent 4829e0378d
commit da34e65cb4
392 changed files with 399 additions and 15 deletions
+1
View File
@@ -23,6 +23,7 @@
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h" #include "qemu-common.h"
#include "block/aio.h" #include "block/aio.h"
#include "block/thread-pool.h" #include "block/thread-pool.h"
+1
View File
@@ -22,6 +22,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h" #include "qemu-common.h"
#include "sysemu/char.h" #include "sysemu/char.h"
#include "qemu/timer.h" #include "qemu/timer.h"
+1
View File
@@ -10,6 +10,7 @@
* See the COPYING file in the top-level directory. * See the COPYING file in the top-level directory.
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h" #include "qemu-common.h"
#include "sysemu/hostmem.h" #include "sysemu/hostmem.h"
#include "sysemu/sysemu.h" #include "sysemu/sysemu.h"
+1
View File
@@ -11,6 +11,7 @@
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "sysemu/hostmem.h" #include "sysemu/hostmem.h"
#include "qapi/error.h"
#include "qom/object_interfaces.h" #include "qom/object_interfaces.h"
#define TYPE_MEMORY_BACKEND_RAM "memory-backend-ram" #define TYPE_MEMORY_BACKEND_RAM "memory-backend-ram"
+1
View File
@@ -12,6 +12,7 @@
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "sysemu/hostmem.h" #include "sysemu/hostmem.h"
#include "hw/boards.h" #include "hw/boards.h"
#include "qapi/error.h"
#include "qapi/visitor.h" #include "qapi/visitor.h"
#include "qapi-types.h" #include "qapi-types.h"
#include "qapi-visit.h" #include "qapi-visit.h"
+1
View File
@@ -13,6 +13,7 @@
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "sysemu/rng.h" #include "sysemu/rng.h"
#include "sysemu/char.h" #include "sysemu/char.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h" #include "qapi/qmp/qerror.h"
#include "hw/qdev.h" /* just for DEFINE_PROP_CHR */ #include "hw/qdev.h" /* just for DEFINE_PROP_CHR */
+1
View File
@@ -13,6 +13,7 @@
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "sysemu/rng-random.h" #include "sysemu/rng-random.h"
#include "sysemu/rng.h" #include "sysemu/rng.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h" #include "qapi/qmp/qerror.h"
#include "qemu/main-loop.h" #include "qemu/main-loop.h"
+1
View File
@@ -12,6 +12,7 @@
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "sysemu/rng.h" #include "sysemu/rng.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h" #include "qapi/qmp/qerror.h"
#include "qom/object_interfaces.h" #include "qom/object_interfaces.h"
+1
View File
@@ -14,6 +14,7 @@
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "sysemu/tpm_backend.h" #include "sysemu/tpm_backend.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h" #include "qapi/qmp/qerror.h"
#include "sysemu/tpm.h" #include "sysemu/tpm.h"
#include "qemu/thread.h" #include "qemu/thread.h"
+1
View File
@@ -17,6 +17,7 @@
#include "block/block.h" #include "block/block.h"
#include "block/block_int.h" #include "block/block_int.h"
#include "block/blockjob.h" #include "block/blockjob.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h" #include "qapi/qmp/qerror.h"
#include "qemu/ratelimit.h" #include "qemu/ratelimit.h"
#include "sysemu/block-backend.h" #include "sysemu/block-backend.h"
+1
View File
@@ -23,6 +23,7 @@
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h" #include "qemu-common.h"
#include "qemu/config-file.h" #include "qemu/config-file.h"
#include "block/block_int.h" #include "block/block_int.h"
+1
View File
@@ -8,6 +8,7 @@
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/sockets.h" /* for EINPROGRESS on Windows */ #include "qemu/sockets.h" /* for EINPROGRESS on Windows */
#include "block/block_int.h" #include "block/block_int.h"
#include "qapi/qmp/qdict.h" #include "qapi/qmp/qdict.h"
+1
View File
@@ -23,6 +23,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h" #include "qemu-common.h"
#include "block/block_int.h" #include "block/block_int.h"
#include "qemu/module.h" #include "qemu/module.h"
+1
View File
@@ -22,6 +22,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h" #include "qemu-common.h"
#include "block/block_int.h" #include "block/block_int.h"
#include "qemu/module.h" #include "qemu/module.h"
+1
View File
@@ -16,6 +16,7 @@
#include "trace.h" #include "trace.h"
#include "block/block_int.h" #include "block/block_int.h"
#include "block/blockjob.h" #include "block/blockjob.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h" #include "qapi/qmp/qerror.h"
#include "qemu/ratelimit.h" #include "qemu/ratelimit.h"
#include "sysemu/block-backend.h" #include "sysemu/block-backend.h"
+1
View File
@@ -22,6 +22,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h" #include "qemu-common.h"
#include "qemu/error-report.h" #include "qemu/error-report.h"
#include "block/block_int.h" #include "block/block_int.h"
+1 -1
View File
@@ -22,7 +22,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "config-host.h" #include "qapi/error.h"
#include "qemu-common.h" #include "qemu-common.h"
#include "trace.h" #include "trace.h"
#include "block/block_int.h" #include "block/block_int.h"
+1
View File
@@ -22,6 +22,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu-common.h" #include "qemu-common.h"
#include "block/block_int.h" #include "block/block_int.h"
#include "qemu/bswap.h" #include "qemu/bswap.h"
+1
View File
@@ -10,6 +10,7 @@
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include <glusterfs/api/glfs.h> #include <glusterfs/api/glfs.h>
#include "block/block_int.h" #include "block/block_int.h"
#include "qapi/error.h"
#include "qemu/uri.h" #include "qemu/uri.h"
typedef struct GlusterAIOCB { typedef struct GlusterAIOCB {
+1
View File
@@ -28,6 +28,7 @@
#include "block/blockjob.h" #include "block/blockjob.h"
#include "block/block_int.h" #include "block/block_int.h"
#include "block/throttle-groups.h" #include "block/throttle-groups.h"
#include "qapi/error.h"
#include "qemu/error-report.h" #include "qemu/error-report.h"
#define NOT_DONE 0x7fffffff /* used while emulated sync operation in progress */ #define NOT_DONE 0x7fffffff /* used while emulated sync operation in progress */

Some files were not shown because too many files have changed in this diff Show More