diff mbox

[15/15] all: Clean up includes

Message ID 1454089805-5470-16-git-send-email-peter.maydell@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Maydell Jan. 29, 2016, 5:50 p.m. UTC
Clean up includes so that osdep.h is included first and headers
which it implies are not included manually.

This commit was created with scripts/clean-includes.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
This catches everything except:
 * our external code (roms, dtc, pixman, libdecnumber)
 * tests
---
 accel.c                  |  1 +
 aio-posix.c              |  1 +
 aio-win32.c              |  1 +
 arch_init.c              |  2 +-
 async.c                  |  1 +
 balloon.c                |  1 +
 block.c                  |  4 +---
 blockdev-nbd.c           |  1 +
 blockdev.c               |  1 +
 blockjob.c               |  2 +-
 bootdevice.c             |  1 +
 bt-host.c                |  2 +-
 bt-vhci.c                |  1 +
 device-hotplug.c         |  1 +
 device_tree.c            |  7 +------
 disas.c                  |  3 +--
 dma-helpers.c            |  1 +
 dump.c                   |  2 +-
 fpu/softfloat.c          |  3 +--
 gdbstub.c                |  9 +--------
 hmp.c                    |  1 +
 iohandler.c              |  2 +-
 ioport.c                 |  1 +
 iothread.c               |  1 +
 kvm-all.c                |  3 +--
 kvm-stub.c               |  1 +
 main-loop.c              |  1 +
 memory.c                 |  2 +-
 memory_mapping.c         |  1 +
 module-common.c          |  2 +-
 monitor.c                |  2 +-
 nbd/client.c             |  1 +
 nbd/common.c             |  1 +
 nbd/server.c             |  1 +
 numa.c                   |  1 +
 os-posix.c               |  6 +-----
 os-win32.c               |  7 +------
 page_cache.c             |  8 +-------
 qdev-monitor.c           |  1 +
 qemu-bridge-helper.c     | 13 ++-----------
 qemu-char.c              |  8 +-------
 qemu-log.c               |  1 +
 qemu-nbd.c               |  5 +----
 qemu-seccomp.c           |  2 +-
 qemu-timer.c             |  1 +
 qjson.c                  |  2 +-
 qmp.c                    |  1 +
 qtest.c                  |  1 +
 replay/replay-events.c   |  1 +
 replay/replay-input.c    |  1 +
 replay/replay-internal.c |  1 +
 replay/replay-time.c     |  1 +
 replay/replay.c          |  1 +
 spice-qemu-char.c        |  3 +--
 tcg-runtime.c            |  2 +-
 tci.c                    |  2 +-
 thread-pool.c            |  2 +-
 thunk.c                  |  4 +---
 tpm.c                    |  2 +-
 trace/control.c          |  1 +
 trace/ftrace.c           |  5 +----
 trace/qmp.c              |  1 +
 trace/simple.c           |  6 +-----
 user-exec.c              |  3 +--
 vl.c                     |  9 +--------
 65 files changed, 66 insertions(+), 101 deletions(-)
diff mbox

Patch

diff --git a/accel.c b/accel.c
index 74e41da..0510b90 100644
--- a/accel.c
+++ b/accel.c
@@ -23,6 +23,7 @@ 
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/accel.h"
 #include "hw/boards.h"
 #include "qemu-common.h"
diff --git a/aio-posix.c b/aio-posix.c
index 482b316..fa7f8ab 100644
--- a/aio-posix.c
+++ b/aio-posix.c
@@ -13,6 +13,7 @@ 
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block.h"
 #include "qemu/queue.h"
diff --git a/aio-win32.c b/aio-win32.c
index cdc4456..6aaa32a 100644
--- a/aio-win32.c
+++ b/aio-win32.c
@@ -15,6 +15,7 @@ 
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block.h"
 #include "qemu/queue.h"
diff --git a/arch_init.c b/arch_init.c
index d1383b3..f6aba02 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -21,7 +21,7 @@ 
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include <stdint.h>
+#include "qemu/osdep.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/arch_init.h"
 #include "hw/pci/pci.h"
diff --git a/async.c b/async.c
index e106072..d4dd2cc 100644
--- a/async.c
+++ b/async.c
@@ -22,6 +22,7 @@ 
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/aio.h"
 #include "block/thread-pool.h"
diff --git a/balloon.c b/balloon.c
index 0f45d1b..f2ef50c 100644
--- a/balloon.c
+++ b/balloon.c
@@ -24,6 +24,7 @@ 
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "exec/cpu-common.h"
 #include "sysemu/kvm.h"
diff --git a/block.c b/block.c
index 5709d3d..ddb8c31 100644
--- a/block.c
+++ b/block.c
@@ -21,7 +21,7 @@ 
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include "config-host.h"
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "trace.h"
 #include "block/block_int.h"
@@ -42,8 +42,6 @@ 
 #include "block/throttle-groups.h"
 
 #ifdef CONFIG_BSD
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <sys/queue.h>
 #ifndef __DragonFly__
diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index 4a758ac..f5760c4 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -9,6 +9,7 @@ 
  * later.  See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/block-backend.h"
 #include "hw/block/block.h"
diff --git a/blockdev.c b/blockdev.c
index 07cfe25..d5c4576 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -30,6 +30,7 @@ 
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "hw/block/block.h"
diff --git a/blockjob.c b/blockjob.c
index 80adb9d..c681264 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -23,7 +23,7 @@ 
  * THE SOFTWARE.
  */
 
-#include "config-host.h"
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "trace.h"
 #include "block/block.h"
diff --git a/bootdevice.c b/bootdevice.c
index 3cdc0d7..1ee7b11 100644
--- a/bootdevice.c
+++ b/bootdevice.c
@@ -22,6 +22,7 @@ 
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/sysemu.h"
 #include "qapi/visitor.h"
 #include "qemu/error-report.h"
diff --git a/bt-host.c b/bt-host.c
index 49205bf..2f8f631 100644
--- a/bt-host.c
+++ b/bt-host.c
@@ -17,12 +17,12 @@ 
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/bt.h"
 #include "qemu/main-loop.h"
 
 #ifndef _WIN32
-# include <errno.h>
 # include <sys/ioctl.h>
 # include <sys/uio.h>
 # ifdef CONFIG_BLUEZ
diff --git a/bt-vhci.c b/bt-vhci.c
index e267c8a..9d277c3 100644
--- a/bt-vhci.c
+++ b/bt-vhci.c
@@ -17,6 +17,7 @@ 
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/bt.h"
 #include "hw/bt.h"
diff --git a/device-hotplug.c b/device-hotplug.c
index 68b9496..9a7cd66 100644
--- a/device-hotplug.c
+++ b/device-hotplug.c
@@ -22,6 +22,7 @@ 
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "sysemu/block-backend.h"
diff --git a/device_tree.c b/device_tree.c
index a9f5f8e..b1ad836 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -11,12 +11,7 @@ 
  *
  */
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
+#include "qemu/osdep.h"
 
 #include "qemu-common.h"
 #include "qemu/error-report.h"
diff --git a/disas.c b/disas.c
index 4e11944..05a7a12 100644
--- a/disas.c
+++ b/disas.c
@@ -1,9 +1,8 @@ 
 /* General "disassemble this chunk" code.  Used for debugging. */
-#include "config.h"
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "disas/bfd.h"
 #include "elf.h"
-#include <errno.h>
 
 #include "cpu.h"
 #include "disas/disas.h"
diff --git a/dma-helpers.c b/dma-helpers.c
index 4faec5d..4ad0bca 100644
--- a/dma-helpers.c
+++ b/dma-helpers.c
@@ -7,6 +7,7 @@ 
  * (GNU GPL), version 2 or later.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/dma.h"
 #include "trace.h"
diff --git a/dump.c b/dump.c
index 2d4892b..96e1fc1 100644
--- a/dump.c
+++ b/dump.c
@@ -11,6 +11,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "elf.h"
 #include "cpu.h"
@@ -22,7 +23,6 @@ 
 #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"
 
diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 162c211..cfa9787 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -82,12 +82,11 @@  this code that are retained.
 /* softfloat (and in particular the code in softfloat-specialize.h) is
  * target-dependent and needs the TARGET_* macros.
  */
-#include "config.h"
+#include "qemu/osdep.h"
 
 #include "fpu/softfloat.h"
 
 /* We only need stdlib for abort() */
-#include <stdlib.h>
 
 /*----------------------------------------------------------------------------
 | Primitive arithmetic functions, including multi-word arithmetic, and
diff --git a/gdbstub.c b/gdbstub.c
index 59d1650..61c12b1 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -16,16 +16,9 @@ 
  * 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 "config.h"
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #ifdef CONFIG_USER_ONLY
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
 
 #include "qemu.h"
 #else
diff --git a/hmp.c b/hmp.c
index 54f2620..3867232 100644
--- a/hmp.c
+++ b/hmp.c
@@ -13,6 +13,7 @@ 
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
+#include "qemu/osdep.h"
 #include "hmp.h"
 #include "net/net.h"
 #include "net/eth.h"
diff --git a/iohandler.c b/iohandler.c
index eb68083..0abb4a7 100644
--- a/iohandler.c
+++ b/iohandler.c
@@ -22,7 +22,7 @@ 
  * THE SOFTWARE.
  */
 
-#include "config-host.h"
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/queue.h"
 #include "block/aio.h"
diff --git a/ioport.c b/ioport.c
index 193ef76..7a84d54 100644
--- a/ioport.c
+++ b/ioport.c
@@ -25,6 +25,7 @@ 
  * splitted out ioport related stuffs from vl.c.
  */
 
+#include "qemu/osdep.h"
 #include "exec/ioport.h"
 #include "trace.h"
 #include "exec/memory.h"
diff --git a/iothread.c b/iothread.c
index 1b8c2bb..f183d38 100644
--- a/iothread.c
+++ b/iothread.c
@@ -11,6 +11,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qom/object.h"
 #include "qom/object_interfaces.h"
 #include "qemu/module.h"
diff --git a/kvm-all.c b/kvm-all.c
index 9148889..9cc9ba6 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -13,10 +13,9 @@ 
  *
  */
 
-#include <sys/types.h>
+#include "qemu/osdep.h"
 #include <sys/ioctl.h>
 #include <sys/mman.h>
-#include <stdarg.h>
 
 #include <linux/kvm.h>
 
diff --git a/kvm-stub.c b/kvm-stub.c
index dc97a5e..b962b24 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -10,6 +10,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "hw/hw.h"
 #include "cpu.h"
diff --git a/main-loop.c b/main-loop.c
index 5877615..19beae7 100644
--- a/main-loop.c
+++ b/main-loop.c
@@ -22,6 +22,7 @@ 
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/timer.h"
 #include "qemu/sockets.h"	// struct in_addr needed for libslirp.h
diff --git a/memory.c b/memory.c
index d2d0a92..39c539c 100644
--- a/memory.c
+++ b/memory.c
@@ -13,6 +13,7 @@ 
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
+#include "qemu/osdep.h"
 #include "exec/memory.h"
 #include "exec/address-spaces.h"
 #include "exec/ioport.h"
@@ -21,7 +22,6 @@ 
 #include "qemu/error-report.h"
 #include "qom/object.h"
 #include "trace.h"
-#include <assert.h>
 
 #include "exec/memory-internal.h"
 #include "exec/ram_addr.h"
diff --git a/memory_mapping.c b/memory_mapping.c
index 36d6b26..04db3ac 100644
--- a/memory_mapping.c
+++ b/memory_mapping.c
@@ -11,6 +11,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include <glib.h>
 
 #include "qemu-common.h"
diff --git a/module-common.c b/module-common.c
index 50c6750..0a3cb8a 100644
--- a/module-common.c
+++ b/module-common.c
@@ -1,4 +1,4 @@ 
-#include "config-host.h"
+#include "qemu/osdep.h"
 #include "qemu/module.h"
 
 void qemu_module_dummy(void)
diff --git a/monitor.c b/monitor.c
index c53a453..73eac17 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 "hw/hw.h"
 #include "monitor/qdev.h"
@@ -59,7 +60,6 @@ 
 #include "qapi/qmp/json-streamer.h"
 #include "qapi/qmp/json-parser.h"
 #include <qom/object_interfaces.h>
-#include "qemu/osdep.h"
 #include "cpu.h"
 #include "trace.h"
 #include "trace/control.h"
diff --git a/nbd/client.c b/nbd/client.c
index 83df7ba..f07cb48 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -16,6 +16,7 @@ 
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "nbd-internal.h"
 
 static int nbd_errno_to_system_errno(int err)
diff --git a/nbd/common.c b/nbd/common.c
index 7b089b0..178d4a7 100644
--- a/nbd/common.c
+++ b/nbd/common.c
@@ -16,6 +16,7 @@ 
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "nbd-internal.h"
 
 ssize_t nbd_wr_sync(int fd, void *buffer, size_t size, bool do_read)
diff --git a/nbd/server.c b/nbd/server.c
index 256feaf..d3131033 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -16,6 +16,7 @@ 
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "nbd-internal.h"
 
 static int system_errno_to_nbd_errno(int err)
diff --git a/numa.c b/numa.c
index 23a5d83..e1a0569 100644
--- a/numa.c
+++ b/numa.c
@@ -22,6 +22,7 @@ 
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/numa.h"
 #include "exec/cpu-common.h"
 #include "qemu/bitmap.h"
diff --git a/os-posix.c b/os-posix.c
index e4da406..e9eebce 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -23,10 +23,7 @@ 
  * THE SOFTWARE.
  */
 
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/types.h>
+#include "qemu/osdep.h"
 #include <sys/wait.h>
 /*needed for MAP_POPULATE before including qemu-options.h */
 #include <sys/mman.h>
@@ -35,7 +32,6 @@ 
 #include <libgen.h>
 
 /* Needed early for CONFIG_BSD etc. */
-#include "config-host.h"
 #include "sysemu/sysemu.h"
 #include "net/slirp.h"
 #include "qemu-options.h"
diff --git a/os-win32.c b/os-win32.c
index cc09196..ae98574 100644
--- a/os-win32.c
+++ b/os-win32.c
@@ -22,14 +22,9 @@ 
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include <windows.h>
 #include <mmsystem.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <time.h>
-#include <errno.h>
-#include <sys/time.h>
-#include "config-host.h"
 #include "sysemu/sysemu.h"
 #include "qemu-options.h"
 
diff --git a/page_cache.c b/page_cache.c
index a9eb076..cb8a69e 100644
--- a/page_cache.c
+++ b/page_cache.c
@@ -12,13 +12,7 @@ 
  *
  */
 
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <stdbool.h>
+#include "qemu/osdep.h"
 #include <glib.h>
 
 #include "qemu-common.h"
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 3ce4710..81e3ff3 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -17,6 +17,7 @@ 
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "hw/qdev.h"
 #include "hw/sysbus.h"
 #include "monitor/monitor.h"
diff --git a/qemu-bridge-helper.c b/qemu-bridge-helper.c
index 36eb3bc..830fb9e 100644
--- a/qemu-bridge-helper.c
+++ b/qemu-bridge-helper.c
@@ -13,19 +13,10 @@ 
  *
  */
 
-#include "config-host.h"
-
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdbool.h>
-#include <ctype.h>
+#include "qemu/osdep.h"
+
 #include <glib.h>
 
-#include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <sys/un.h>
diff --git a/qemu-char.c b/qemu-char.c
index ca53e8c..d0cb52e 100644
--- a/qemu-char.c
+++ b/qemu-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-common.h"
 #include "monitor/monitor.h"
 #include "sysemu/sysemu.h"
@@ -37,11 +38,6 @@ 
 #include "io/channel-file.h"
 #include "io/channel-tls.h"
 
-#include <unistd.h>
-#include <fcntl.h>
-#include <time.h>
-#include <errno.h>
-#include <sys/time.h>
 #include <zlib.h>
 
 #ifndef _WIN32
@@ -58,7 +54,6 @@ 
 #include <netdb.h>
 #include <sys/select.h>
 #ifdef CONFIG_BSD
-#include <sys/stat.h>
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <dev/ppbus/ppi.h>
 #include <dev/ppbus/ppbconf.h>
@@ -72,7 +67,6 @@ 
 #include <linux/parport.h>
 #endif
 #ifdef __sun__
-#include <sys/stat.h>
 #include <sys/ethernet.h>
 #include <sys/sockio.h>
 #include <netinet/arp.h>
diff --git a/qemu-log.c b/qemu-log.c
index 901b930..3b02632 100644
--- a/qemu-log.c
+++ b/qemu-log.c
@@ -17,6 +17,7 @@ 
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/log.h"
 
diff --git a/qemu-nbd.c b/qemu-nbd.c
index ede4a54..d374015 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -16,6 +16,7 @@ 
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/block-backend.h"
 #include "block/block_int.h"
@@ -27,15 +28,11 @@ 
 #include "qapi/util.h"
 #include "qapi/qmp/qstring.h"
 
-#include <stdarg.h>
-#include <stdio.h>
 #include <getopt.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <arpa/inet.h>
-#include <signal.h>
 #include <libgen.h>
 #include <pthread.h>
 
diff --git a/qemu-seccomp.c b/qemu-seccomp.c
index c831fe8..2866e3c 100644
--- a/qemu-seccomp.c
+++ b/qemu-seccomp.c
@@ -12,7 +12,7 @@ 
  * Contributions after 2012-01-13 are licensed under the terms of the
  * GNU GPL, version 2 or (at your option) any later version.
  */
-#include <stdio.h>
+#include "qemu/osdep.h"
 #include <seccomp.h>
 #include "sysemu/seccomp.h"
 
diff --git a/qemu-timer.c b/qemu-timer.c
index f16e422..e98ecc9 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -22,6 +22,7 @@ 
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu/main-loop.h"
 #include "qemu/timer.h"
 #include "sysemu/replay.h"
diff --git a/qjson.c b/qjson.c
index e478802..b65ca6e 100644
--- a/qjson.c
+++ b/qjson.c
@@ -11,8 +11,8 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include <qapi/qmp/qstring.h>
-#include <stdbool.h>
 #include <glib.h>
 #include <qjson.h>
 #include <qemu/module.h>
diff --git a/qmp.c b/qmp.c
index 53affe2..6ae7230 100644
--- a/qmp.c
+++ b/qmp.c
@@ -13,6 +13,7 @@ 
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "monitor/monitor.h"
 #include "sysemu/sysemu.h"
diff --git a/qtest.c b/qtest.c
index 05cefd2..58a7732 100644
--- a/qtest.c
+++ b/qtest.c
@@ -11,6 +11,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/qtest.h"
 #include "hw/qdev.h"
 #include "sysemu/char.h"
diff --git a/replay/replay-events.c b/replay/replay-events.c
index 402f644..2628109 100644
--- a/replay/replay-events.c
+++ b/replay/replay-events.c
@@ -9,6 +9,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "sysemu/replay.h"
diff --git a/replay/replay-input.c b/replay/replay-input.c
index bc15f59..4270ca1 100644
--- a/replay/replay-input.c
+++ b/replay/replay-input.c
@@ -9,6 +9,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/replay.h"
 #include "replay-internal.h"
diff --git a/replay/replay-internal.c b/replay/replay-internal.c
index 35cff44..5835e8d 100644
--- a/replay/replay-internal.c
+++ b/replay/replay-internal.c
@@ -9,6 +9,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/replay.h"
 #include "replay-internal.h"
diff --git a/replay/replay-time.c b/replay/replay-time.c
index 6d06951..fffe072 100644
--- a/replay/replay-time.c
+++ b/replay/replay-time.c
@@ -9,6 +9,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/replay.h"
 #include "replay-internal.h"
diff --git a/replay/replay.c b/replay/replay.c
index e4673b3..9cac178 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -9,6 +9,7 @@ 
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/replay.h"
 #include "replay-internal.h"
diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index 8951d7c..7c1f438 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -1,11 +1,10 @@ 
-#include "config-host.h"
+#include "qemu/osdep.h"
 #include "trace.h"
 #include "ui/qemu-spice.h"
 #include "sysemu/char.h"
 #include <spice.h>
 #include <spice/protocol.h>
 
-#include "qemu/osdep.h"
 
 typedef struct SpiceCharDriver {
     CharDriverState*      chr;
diff --git a/tcg-runtime.c b/tcg-runtime.c
index 9daba69..ea2ad64 100644
--- a/tcg-runtime.c
+++ b/tcg-runtime.c
@@ -21,7 +21,7 @@ 
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include <stdint.h>
+#include "qemu/osdep.h"
 #include "qemu/host-utils.h"
 
 /* This file is compiled once, and thus we can't include the standard
diff --git a/tci.c b/tci.c
index b5ed7b1..7cbb39e 100644
--- a/tci.c
+++ b/tci.c
@@ -17,7 +17,7 @@ 
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "config.h"
+#include "qemu/osdep.h"
 
 /* Defining NDEBUG disables assertions (which makes the code faster). */
 #if !defined(CONFIG_DEBUG_TCG) && !defined(NDEBUG)
diff --git a/thread-pool.c b/thread-pool.c
index 402c778..03ba0b0 100644
--- a/thread-pool.c
+++ b/thread-pool.c
@@ -14,10 +14,10 @@ 
  * 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 "qemu-common.h"
 #include "qemu/queue.h"
 #include "qemu/thread.h"
-#include "qemu/osdep.h"
 #include "qemu/coroutine.h"
 #include "trace.h"
 #include "block/thread-pool.h"
diff --git a/thunk.c b/thunk.c
index f501fd7..f057d86 100644
--- a/thunk.c
+++ b/thunk.c
@@ -16,9 +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 <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
+#include "qemu/osdep.h"
 
 #include "qemu.h"
 #include "exec/user/thunk.h"
diff --git a/tpm.c b/tpm.c
index 0a3e3d5..9ed708e 100644
--- a/tpm.c
+++ b/tpm.c
@@ -11,7 +11,7 @@ 
  *
  * Based on net.c
  */
-#include "config-host.h"
+#include "qemu/osdep.h"
 
 #include "qapi/qmp/qerror.h"
 #include "sysemu/tpm_backend.h"
diff --git a/trace/control.c b/trace/control.c
index 995beb3..3ee5e8e 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -7,6 +7,7 @@ 
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "trace/control.h"
 #ifdef CONFIG_TRACE_SIMPLE
 #include "trace/simple.h"
diff --git a/trace/ftrace.c b/trace/ftrace.c
index a7ae371..e953922 100644
--- a/trace/ftrace.c
+++ b/trace/ftrace.c
@@ -9,10 +9,7 @@ 
  *
  */
 
-#include <stdio.h>
-#include <string.h>
-#include <fcntl.h>
-#include <limits.h>
+#include "qemu/osdep.h"
 #include "trace.h"
 #include "trace/control.h"
 
diff --git a/trace/qmp.c b/trace/qmp.c
index 0b19489..6320b4b 100644
--- a/trace/qmp.c
+++ b/trace/qmp.c
@@ -7,6 +7,7 @@ 
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu/typedefs.h"
 #include "qmp-commands.h"
 #include "trace/control.h"
diff --git a/trace/simple.c b/trace/simple.c
index 56a624c..8a07006 100644
--- a/trace/simple.c
+++ b/trace/simple.c
@@ -8,12 +8,8 @@ 
  *
  */
 
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <time.h>
+#include "qemu/osdep.h"
 #ifndef _WIN32
-#include <signal.h>
 #include <pthread.h>
 #endif
 #include "qemu/timer.h"
diff --git a/user-exec.c b/user-exec.c
index 8ad89a4..d8d597b 100644
--- a/user-exec.c
+++ b/user-exec.c
@@ -16,7 +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 "config.h"
+#include "qemu/osdep.h"
 #include "cpu.h"
 #include "disas/disas.h"
 #include "tcg.h"
@@ -33,7 +33,6 @@ 
 #undef ESI
 #undef EDI
 #undef EIP
-#include <signal.h>
 #ifdef __linux__
 #include <sys/ucontext.h>
 #endif
diff --git a/vl.c b/vl.c
index f043009..d5308f1 100644
--- a/vl.c
+++ b/vl.c
@@ -21,14 +21,8 @@ 
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <time.h>
-#include <errno.h>
-#include <sys/time.h>
+#include "qemu/osdep.h"
 
-#include "config-host.h"
 
 #ifdef CONFIG_SECCOMP
 #include "sysemu/seccomp.h"
@@ -113,7 +107,6 @@  int main(int argc, char **argv)
 #include "qemu/queue.h"
 #include "sysemu/cpus.h"
 #include "sysemu/arch_init.h"
-#include "qemu/osdep.h"
 
 #include "ui/qemu-spice.h"
 #include "qapi/string-input-visitor.h"