From da34e65cb4025728566d6504a99916f6e7e1dd6a Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 14 Mar 2016 09:01:28 +0100 Subject: 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 [Fix compilation without the spice devel packages. - Paolo] Signed-off-by: Paolo Bonzini --- io/channel-command.c | 1 + io/channel-file.c | 1 + io/channel-socket.c | 1 + io/channel-tls.c | 1 + io/channel-websock.c | 1 + io/channel.c | 1 + io/task.c | 1 + 7 files changed, 7 insertions(+) (limited to 'io') diff --git a/io/channel-command.c b/io/channel-command.c index 604514adfc..ad25313be1 100644 --- a/io/channel-command.c +++ b/io/channel-command.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "io/channel-command.h" #include "io/channel-watch.h" +#include "qapi/error.h" #include "qemu/sockets.h" #include "trace.h" diff --git a/io/channel-file.c b/io/channel-file.c index f28e2b0a5c..e1da2435e6 100644 --- a/io/channel-file.c +++ b/io/channel-file.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "io/channel-file.h" #include "io/channel-watch.h" +#include "qapi/error.h" #include "qemu/sockets.h" #include "trace.h" diff --git a/io/channel-socket.c b/io/channel-socket.c index d005070584..ca8bc20b17 100644 --- a/io/channel-socket.c +++ b/io/channel-socket.c @@ -19,6 +19,7 @@ */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "io/channel-socket.h" #include "io/channel-watch.h" #include "trace.h" diff --git a/io/channel-tls.c b/io/channel-tls.c index 7608fd9de0..9a8525c816 100644 --- a/io/channel-tls.c +++ b/io/channel-tls.c @@ -19,6 +19,7 @@ */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "io/channel-tls.h" #include "trace.h" diff --git a/io/channel-websock.c b/io/channel-websock.c index 35860a2738..708178779e 100644 --- a/io/channel-websock.c +++ b/io/channel-websock.c @@ -19,6 +19,7 @@ */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "io/channel-websock.h" #include "crypto/hash.h" #include "trace.h" diff --git a/io/channel.c b/io/channel.c index dd6fc0eb28..692eb179b3 100644 --- a/io/channel.c +++ b/io/channel.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "io/channel.h" +#include "qapi/error.h" #include "qemu/coroutine.h" bool qio_channel_has_feature(QIOChannel *ioc, diff --git a/io/task.c b/io/task.c index bf1a3339b2..c7f97a9b16 100644 --- a/io/task.c +++ b/io/task.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "io/task.h" +#include "qapi/error.h" #include "qemu/thread.h" #include "trace.h" -- cgit v1.2.1