qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/15] clean includes, part 2
@ 2016-01-29 17:49 Peter Maydell
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 01/15] ui: Clean up includes Peter Maydell
                   ` (15 more replies)
  0 siblings, 16 replies; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

This patchset runs clean-includes on a bunch more files.
With this (plus one or two patches I sent earlier) every
file in the tree except for those in tests/ has been
updated. (I skipped tests/ for now because at least some
of the files in tests/tcg seem to be totally standalone.
I'll look at those next week but I thought I'd send out
this set first.)

One or two files might have slipped through the net if
they were newly added since I did the scan; we can pick
those up later though.

thanks
-- PMM


Peter Maydell (15):
  ui: Clean up includes
  stubs: Clean up includes
  bsd-user: Clean up includes
  backends: Clean up includes
  util: Clean up includes
  disas: Clean up includes
  qapi: Clean up includes
  qga: Clean up includes
  slirp: Clean up includes
  net: Clean up includes
  qobject: Clean up includes
  qom: Clean up includes
  io: Clean up includes
  contrib: Clean up includes
  all: Clean up includes

 accel.c                                 |  1 +
 aio-posix.c                             |  1 +
 aio-win32.c                             |  1 +
 arch_init.c                             |  2 +-
 async.c                                 |  1 +
 backends/baum.c                         |  1 +
 backends/hostmem-file.c                 |  1 +
 backends/hostmem-ram.c                  |  1 +
 backends/hostmem.c                      |  1 +
 backends/msmouse.c                      |  2 +-
 backends/rng-egd.c                      |  1 +
 backends/rng-random.c                   |  1 +
 backends/rng.c                          |  1 +
 backends/testdev.c                      |  1 +
 backends/tpm.c                          |  1 +
 balloon.c                               |  1 +
 block.c                                 |  4 +---
 blockdev-nbd.c                          |  1 +
 blockdev.c                              |  1 +
 blockjob.c                              |  2 +-
 bootdevice.c                            |  1 +
 bsd-user/bsdload.c                      |  8 +-------
 bsd-user/elfload.c                      |  8 +-------
 bsd-user/main.c                         |  8 +-------
 bsd-user/mmap.c                         |  7 +------
 bsd-user/signal.c                       |  7 +------
 bsd-user/strace.c                       |  6 +-----
 bsd-user/syscall.c                      | 12 +-----------
 bsd-user/uaccess.c                      |  3 +--
 bt-host.c                               |  2 +-
 bt-vhci.c                               |  1 +
 contrib/ivshmem-client/ivshmem-client.c |  2 +-
 contrib/ivshmem-client/main.c           |  1 +
 contrib/ivshmem-server/ivshmem-server.c |  2 +-
 contrib/ivshmem-server/main.c           |  1 +
 device-hotplug.c                        |  1 +
 device_tree.c                           |  7 +------
 disas.c                                 |  3 +--
 disas/hppa.c                            |  1 +
 disas/i386.c                            |  2 +-
 disas/ia64.c                            |  3 +--
 disas/m68k.c                            |  3 +--
 disas/s390.c                            |  1 +
 disas/sparc.c                           |  2 +-
 disas/tci.c                             |  1 +
 dma-helpers.c                           |  1 +
 dump.c                                  |  2 +-
 fpu/softfloat.c                         |  3 +--
 gdbstub.c                               |  9 +--------
 hmp.c                                   |  1 +
 io/channel-buffer.c                     |  1 +
 io/channel-command.c                    |  1 +
 io/channel-file.c                       |  1 +
 io/channel-socket.c                     |  1 +
 io/channel-tls.c                        |  1 +
 io/channel-watch.c                      |  1 +
 io/channel-websock.c                    |  1 +
 io/channel.c                            |  1 +
 io/task.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 +
 net/checksum.c                          |  1 +
 net/dump.c                              |  1 +
 net/eth.c                               |  1 +
 net/filter-buffer.c                     |  1 +
 net/filter.c                            |  1 +
 net/hub.c                               |  1 +
 net/l2tpv3.c                            |  2 +-
 net/net.c                               |  2 +-
 net/netmap.c                            |  3 +--
 net/queue.c                             |  1 +
 net/slirp.c                             |  2 +-
 net/socket.c                            |  2 +-
 net/tap-aix.c                           |  2 +-
 net/tap-bsd.c                           |  1 +
 net/tap-haiku.c                         |  2 +-
 net/tap-linux.c                         |  1 +
 net/tap-solaris.c                       |  2 +-
 net/tap-win32.c                         |  2 +-
 net/tap.c                               |  3 +--
 net/util.c                              |  3 +--
 net/vde.c                               |  2 +-
 net/vhost-user.c                        |  1 +
 numa.c                                  |  1 +
 os-posix.c                              |  6 +-----
 os-win32.c                              |  7 +------
 page_cache.c                            |  8 +-------
 qapi/opts-visitor.c                     |  1 +
 qapi/qapi-dealloc-visitor.c             |  1 +
 qapi/qapi-util.c                        |  2 +-
 qapi/qapi-visit-core.c                  |  1 +
 qapi/qmp-dispatch.c                     |  2 +-
 qapi/qmp-event.c                        |  2 +-
 qapi/qmp-input-visitor.c                |  1 +
 qapi/qmp-output-visitor.c               |  1 +
 qapi/qmp-registry.c                     |  2 +-
 qapi/string-input-visitor.c             |  1 +
 qapi/string-output-visitor.c            |  1 +
 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 +
 qga/channel-posix.c                     |  7 +------
 qga/channel-win32.c                     |  5 +----
 qga/commands-posix.c                    |  9 +--------
 qga/commands-win32.c                    |  3 +--
 qga/commands.c                          |  1 +
 qga/guest-agent-command-state.c         |  1 +
 qga/main.c                              |  5 +----
 qga/service-win32.c                     |  3 +--
 qga/vss-win32.c                         |  2 +-
 qjson.c                                 |  2 +-
 qmp.c                                   |  1 +
 qobject/json-lexer.c                    |  2 +-
 qobject/json-parser.c                   |  2 +-
 qobject/json-streamer.c                 |  1 +
 qobject/qbool.c                         |  1 +
 qobject/qdict.c                         |  1 +
 qobject/qfloat.c                        |  1 +
 qobject/qint.c                          |  1 +
 qobject/qjson.c                         |  1 +
 qobject/qlist.c                         |  1 +
 qobject/qnull.c                         |  1 +
 qobject/qobject.c                       |  1 +
 qobject/qstring.c                       |  1 +
 qom/container.c                         |  2 +-
 qom/object.c                            |  1 +
 qom/object_interfaces.c                 |  1 +
 qom/qom-qobject.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 +
 slirp/arp_table.c                       |  1 +
 slirp/bootp.c                           |  1 +
 slirp/cksum.c                           |  1 +
 slirp/dnssearch.c                       |  4 +---
 slirp/if.c                              |  1 +
 slirp/ip_icmp.c                         |  1 +
 slirp/ip_input.c                        |  1 +
 slirp/ip_output.c                       |  1 +
 slirp/mbuf.c                            |  1 +
 slirp/misc.c                            |  1 +
 slirp/sbuf.c                            |  1 +
 slirp/slirp.c                           |  1 +
 slirp/socket.c                          |  1 +
 slirp/tcp_input.c                       |  1 +
 slirp/tcp_output.c                      |  1 +
 slirp/tcp_subr.c                        |  1 +
 slirp/tcp_timer.c                       |  1 +
 slirp/tftp.c                            |  1 +
 slirp/udp.c                             |  1 +
 spice-qemu-char.c                       |  3 +--
 stubs/arch-query-cpu-def.c              |  1 +
 stubs/bdrv-commit-all.c                 |  1 +
 stubs/clock-warp.c                      |  1 +
 stubs/cpu-get-clock.c                   |  1 +
 stubs/cpu-get-icount.c                  |  1 +
 stubs/cpus.c                            |  1 +
 stubs/dump.c                            |  1 +
 stubs/fd-register.c                     |  1 +
 stubs/fdset-add-fd.c                    |  1 +
 stubs/fdset-find-fd.c                   |  1 +
 stubs/fdset-get-fd.c                    |  1 +
 stubs/fdset-remove-fd.c                 |  1 +
 stubs/gdbstub.c                         |  1 +
 stubs/get-fd.c                          |  1 +
 stubs/get-next-serial.c                 |  1 +
 stubs/get-vm-name.c                     |  1 +
 stubs/iothread-lock.c                   |  1 +
 stubs/is-daemonized.c                   |  1 +
 stubs/kvm.c                             |  1 +
 stubs/machine-init-done.c               |  1 +
 stubs/migr-blocker.c                    |  1 +
 stubs/mon-is-qmp.c                      |  1 +
 stubs/mon-printf.c                      |  1 +
 stubs/monitor-init.c                    |  1 +
 stubs/notify-event.c                    |  1 +
 stubs/qmp_pc_dimm_device_list.c         |  1 +
 stubs/qtest.c                           |  1 +
 stubs/replay-user.c                     |  1 +
 stubs/replay.c                          |  2 +-
 stubs/reset.c                           |  1 +
 stubs/runstate-check.c                  |  1 +
 stubs/set-fd-handler.c                  |  1 +
 stubs/slirp.c                           |  1 +
 stubs/sysbus.c                          |  1 +
 stubs/target-get-monitor-def.c          |  1 +
 stubs/target-monitor-defs.c             |  1 +
 stubs/uuid.c                            |  1 +
 stubs/vhost.c                           |  1 +
 stubs/vm-stop.c                         |  1 +
 stubs/vmstate.c                         |  1 +
 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 +-----
 ui/console-gl.c                         |  1 +
 ui/console.c                            |  1 +
 ui/curses.c                             |  1 +
 ui/cursor.c                             |  1 +
 ui/egl-context.c                        |  1 +
 ui/egl-helpers.c                        |  9 +--------
 ui/gtk-egl.c                            |  1 +
 ui/gtk-gl-area.c                        |  1 +
 ui/gtk.c                                |  1 +
 ui/input-keymap.c                       |  1 +
 ui/input-legacy.c                       |  2 +-
 ui/input.c                              |  1 +
 ui/keymaps.c                            |  1 +
 ui/qemu-pixman.c                        |  1 +
 ui/sdl.c                                |  1 +
 ui/sdl2-2d.c                            |  1 +
 ui/sdl2-gl.c                            |  1 +
 ui/sdl2-input.c                         |  1 +
 ui/sdl2.c                               |  1 +
 ui/sdl_zoom.c                           |  4 +---
 ui/shader.c                             |  1 +
 ui/spice-core.c                         |  1 +
 ui/spice-display.c                      |  1 +
 ui/spice-input.c                        |  5 +----
 ui/vnc-auth-sasl.c                      |  1 +
 ui/vnc-auth-vencrypt.c                  |  1 +
 ui/vnc-enc-hextile.c                    |  1 +
 ui/vnc-enc-tight.c                      |  3 +--
 ui/vnc-enc-zlib.c                       |  1 +
 ui/vnc-enc-zrle-template.c              |  2 +-
 ui/vnc-enc-zrle.c                       |  1 +
 ui/vnc-enc-zywrle-template.c            |  1 +
 ui/vnc-jobs.c                           |  1 +
 ui/vnc-palette.c                        |  2 +-
 ui/vnc-ws.c                             |  1 +
 ui/vnc.c                                |  2 +-
 ui/x_keymap.c                           |  1 +
 user-exec.c                             |  3 +--
 util/acl.c                              |  1 +
 util/base64.c                           |  1 +
 util/bitmap.c                           |  1 +
 util/bitops.c                           |  1 +
 util/buffer.c                           |  1 +
 util/compatfd.c                         |  1 +
 util/coroutine-gthread.c                |  1 +
 util/coroutine-sigaltstack.c            |  4 +---
 util/coroutine-ucontext.c               |  3 +--
 util/coroutine-win32.c                  |  1 +
 util/crc32c.c                           |  1 +
 util/cutils.c                           |  3 +--
 util/envlist.c                          |  1 +
 util/error.c                            |  2 +-
 util/event_notifier-posix.c             |  1 +
 util/event_notifier-win32.c             |  1 +
 util/fifo8.c                            |  1 +
 util/getauxval.c                        |  2 +-
 util/hbitmap.c                          |  4 +---
 util/hexdump.c                          |  1 +
 util/host-utils.c                       |  3 +--
 util/id.c                               |  1 +
 util/iov.c                              |  1 +
 util/mmap-alloc.c                       |  3 +--
 util/module.c                           |  2 +-
 util/notify.c                           |  1 +
 util/osdep.c                            | 11 +----------
 util/oslib-posix.c                      |  4 +---
 util/oslib-win32.c                      |  3 +--
 util/path.c                             |  7 +------
 util/qemu-config.c                      |  2 +-
 util/qemu-coroutine-io.c                |  1 +
 util/qemu-coroutine-lock.c              |  1 +
 util/qemu-coroutine-sleep.c             |  1 +
 util/qemu-coroutine.c                   |  1 +
 util/qemu-error.c                       |  2 +-
 util/qemu-openpty.c                     |  2 +-
 util/qemu-option.c                      |  4 +---
 util/qemu-progress.c                    |  3 +--
 util/qemu-sockets.c                     |  7 +------
 util/qemu-thread-posix.c                | 11 +----------
 util/qemu-thread-win32.c                |  3 +--
 util/qemu-timer-common.c                |  1 +
 util/rcu.c                              |  6 +-----
 util/readline.c                         |  1 +
 util/rfifolock.c                        |  2 +-
 util/throttle.c                         |  1 +
 util/timed-average.c                    |  2 +-
 util/unicode.c                          |  1 +
 util/uri.c                              |  3 +--
 vl.c                                    |  9 +--------
 307 files changed, 308 insertions(+), 308 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 01/15] ui: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
@ 2016-01-29 17:49 ` Peter Maydell
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 02/15] stubs: " Peter Maydell
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 ui/console-gl.c              | 1 +
 ui/console.c                 | 1 +
 ui/curses.c                  | 1 +
 ui/cursor.c                  | 1 +
 ui/egl-context.c             | 1 +
 ui/egl-helpers.c             | 9 +--------
 ui/gtk-egl.c                 | 1 +
 ui/gtk-gl-area.c             | 1 +
 ui/gtk.c                     | 1 +
 ui/input-keymap.c            | 1 +
 ui/input-legacy.c            | 2 +-
 ui/input.c                   | 1 +
 ui/keymaps.c                 | 1 +
 ui/qemu-pixman.c             | 1 +
 ui/sdl.c                     | 1 +
 ui/sdl2-2d.c                 | 1 +
 ui/sdl2-gl.c                 | 1 +
 ui/sdl2-input.c              | 1 +
 ui/sdl2.c                    | 1 +
 ui/sdl_zoom.c                | 4 +---
 ui/shader.c                  | 1 +
 ui/spice-core.c              | 1 +
 ui/spice-display.c           | 1 +
 ui/spice-input.c             | 5 +----
 ui/vnc-auth-sasl.c           | 1 +
 ui/vnc-auth-vencrypt.c       | 1 +
 ui/vnc-enc-hextile.c         | 1 +
 ui/vnc-enc-tight.c           | 3 +--
 ui/vnc-enc-zlib.c            | 1 +
 ui/vnc-enc-zrle-template.c   | 2 +-
 ui/vnc-enc-zrle.c            | 1 +
 ui/vnc-enc-zywrle-template.c | 1 +
 ui/vnc-jobs.c                | 1 +
 ui/vnc-palette.c             | 2 +-
 ui/vnc-ws.c                  | 1 +
 ui/vnc.c                     | 2 +-
 ui/x_keymap.c                | 1 +
 37 files changed, 37 insertions(+), 21 deletions(-)

diff --git a/ui/console-gl.c b/ui/console-gl.c
index baf397b..74b1bed 100644
--- a/ui/console-gl.c
+++ b/ui/console-gl.c
@@ -24,6 +24,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 "ui/console.h"
 #include "ui/shader.h"
diff --git a/ui/console.c b/ui/console.c
index fe950c6..309e10a 100644
--- a/ui/console.c
+++ b/ui/console.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 "ui/console.h"
 #include "hw/qdev-core.h"
diff --git a/ui/curses.c b/ui/curses.c
index 274e09b..b475589 100644
--- a/ui/curses.c
+++ b/ui/curses.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 <curses.h>
 
 #ifndef _WIN32
diff --git a/ui/cursor.c b/ui/cursor.c
index 2b8dd3f..a276e01 100644
--- a/ui/cursor.c
+++ b/ui/cursor.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "ui/console.h"
 
diff --git a/ui/egl-context.c b/ui/egl-context.c
index 40102e3..3a02b68 100644
--- a/ui/egl-context.c
+++ b/ui/egl-context.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "ui/egl-context.h"
 
diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c
index 87d77af..4c83834 100644
--- a/ui/egl-helpers.c
+++ b/ui/egl-helpers.c
@@ -1,11 +1,4 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
+#include "qemu/osdep.h"
 #include <glob.h>
 
 #include "ui/egl-helpers.h"
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 500c42c..431457c 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -11,6 +11,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 #include "trace.h"
diff --git a/ui/gtk-gl-area.c b/ui/gtk-gl-area.c
index dec3edb..b86ff3c 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -7,6 +7,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 #include "trace.h"
diff --git a/ui/gtk.c b/ui/gtk.c
index ce7018e..a4f5399 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -34,6 +34,7 @@
 #define GETTEXT_PACKAGE "qemu"
 #define LOCALEDIR "po"
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 #include "ui/console.h"
diff --git a/ui/input-keymap.c b/ui/input-keymap.c
index 63d71d2..fd2c09d 100644
--- a/ui/input-keymap.c
+++ b/ui/input-keymap.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "sysemu/sysemu.h"
 #include "ui/keymaps.h"
 #include "ui/input.h"
diff --git a/ui/input-legacy.c b/ui/input-legacy.c
index 35dfc27..093f3d1 100644
--- a/ui/input-legacy.c
+++ b/ui/input-legacy.c
@@ -22,9 +22,9 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/sysemu.h"
 #include "ui/console.h"
-#include "qapi/error.h"
 #include "qmp-commands.h"
 #include "qapi-types.h"
 #include "ui/keymaps.h"
diff --git a/ui/input.c b/ui/input.c
index 006667b..bdcb974 100644
--- a/ui/input.c
+++ b/ui/input.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "hw/qdev.h"
 #include "sysemu/sysemu.h"
 #include "qapi-types.h"
diff --git a/ui/keymaps.c b/ui/keymaps.c
index 1b9ba3f..8899a0b 100644
--- a/ui/keymaps.c
+++ b/ui/keymaps.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "keymaps.h"
 #include "sysemu/sysemu.h"
 
diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c
index 4116e15..c9f8dce 100644
--- a/ui/qemu-pixman.c
+++ b/ui/qemu-pixman.c
@@ -3,6 +3,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "ui/console.h"
 
diff --git a/ui/sdl.c b/ui/sdl.c
index c837436..72d6250 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -25,6 +25,7 @@
 /* Avoid compiler warning because macro is redefined in SDL_syswm.h. */
 #undef WIN32_LEAN_AND_MEAN
 
+#include "qemu/osdep.h"
 #include <SDL.h>
 #include <SDL_syswm.h>
 
diff --git a/ui/sdl2-2d.c b/ui/sdl2-2d.c
index 191ee3b..9593006 100644
--- a/ui/sdl2-2d.c
+++ b/ui/sdl2-2d.c
@@ -23,6 +23,7 @@
  */
 /* Ported SDL 1.2 code to 2.0 by Dave Airlie. */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "ui/console.h"
 #include "ui/input.h"
diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c
index 2bb3d06..a324eca 100644
--- a/ui/sdl2-gl.c
+++ b/ui/sdl2-gl.c
@@ -25,6 +25,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "ui/console.h"
 #include "ui/input.h"
diff --git a/ui/sdl2-input.c b/ui/sdl2-input.c
index ac5dc94..6e315ae 100644
--- a/ui/sdl2-input.c
+++ b/ui/sdl2-input.c
@@ -23,6 +23,7 @@
  */
 /* Ported SDL 1.2 code to 2.0 by Dave Airlie. */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "ui/console.h"
 #include "ui/input.h"
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 46270f4..fa09a4c 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -23,6 +23,7 @@
  */
 /* Ported SDL 1.2 code to 2.0 by Dave Airlie. */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "ui/console.h"
 #include "ui/input.h"
diff --git a/ui/sdl_zoom.c b/ui/sdl_zoom.c
index 2625c45..72622c2 100644
--- a/ui/sdl_zoom.c
+++ b/ui/sdl_zoom.c
@@ -11,11 +11,9 @@
  *
  */
 
-#include "sdl_zoom.h"
 #include "qemu/osdep.h"
+#include "sdl_zoom.h"
 #include <glib.h>
-#include <stdint.h>
-#include <stdio.h>
 
 static void sdl_zoom_rgb16(SDL_Surface *src, SDL_Surface *dst, int smooth,
                            SDL_Rect *dst_rect);
diff --git a/ui/shader.c b/ui/shader.c
index 0588655..9264009 100644
--- a/ui/shader.c
+++ b/ui/shader.c
@@ -24,6 +24,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 "ui/shader.h"
 
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 8f27768..4dbd99a 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -15,6 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include <spice.h>
 
 #include <netdb.h>
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 0489131..8a5b325 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -15,6 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "ui/qemu-spice.h"
 #include "qemu/timer.h"
diff --git a/ui/spice-input.c b/ui/spice-input.c
index 2b3b9ed..72e4063 100644
--- a/ui/spice-input.c
+++ b/ui/spice-input.c
@@ -15,10 +15,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdbool.h>
-#include <string.h>
+#include "qemu/osdep.h"
 
 #include <spice.h>
 #include <spice/enums.h>
diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c
index de8abc9..13a59f5 100644
--- a/ui/vnc-auth-sasl.c
+++ b/ui/vnc-auth-sasl.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "vnc.h"
 
 /* Max amount of data we send/recv for SASL steps to prevent DOS */
diff --git a/ui/vnc-auth-vencrypt.c b/ui/vnc-auth-vencrypt.c
index 093dd2f..8f3bb11 100644
--- a/ui/vnc-auth-vencrypt.c
+++ b/ui/vnc-auth-vencrypt.c
@@ -24,6 +24,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "vnc.h"
 #include "qemu/main-loop.h"
 
diff --git a/ui/vnc-enc-hextile.c b/ui/vnc-enc-hextile.c
index 2e768fd..4215bd7 100644
--- a/ui/vnc-enc-hextile.c
+++ b/ui/vnc-enc-hextile.c
@@ -24,6 +24,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "vnc.h"
 
 static void hextile_enc_cord(uint8_t *ptr, int x, int y, int w, int h)
diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
index 9a9ddf2..e5cba0e 100644
--- a/ui/vnc-enc-tight.c
+++ b/ui/vnc-enc-tight.c
@@ -26,7 +26,7 @@
  * THE SOFTWARE.
  */
 
-#include "config-host.h"
+#include "qemu/osdep.h"
 
 /* This needs to be before jpeglib.h line because of conflict with
    INT32 definitions between jmorecfg.h (included by jpeglib.h) and
@@ -40,7 +40,6 @@
 #include <png.h>
 #endif
 #ifdef CONFIG_VNC_JPEG
-#include <stdio.h>
 #include <jpeglib.h>
 #endif
 
diff --git a/ui/vnc-enc-zlib.c b/ui/vnc-enc-zlib.c
index d1b97f2..33e9df2 100644
--- a/ui/vnc-enc-zlib.c
+++ b/ui/vnc-enc-zlib.c
@@ -24,6 +24,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "vnc.h"
 
 #define ZALLOC_ALIGNMENT 16
diff --git a/ui/vnc-enc-zrle-template.c b/ui/vnc-enc-zrle-template.c
index 70ae624..abf6b86 100644
--- a/ui/vnc-enc-zrle-template.c
+++ b/ui/vnc-enc-zrle-template.c
@@ -22,7 +22,7 @@
  */
 
 
-#include <assert.h>
+#include "qemu/osdep.h"
 
 #undef ZRLE_ENDIAN_SUFFIX
 
diff --git a/ui/vnc-enc-zrle.c b/ui/vnc-enc-zrle.c
index ed3b484..5489870 100644
--- a/ui/vnc-enc-zrle.c
+++ b/ui/vnc-enc-zrle.c
@@ -26,6 +26,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "vnc.h"
 #include "vnc-enc-zrle.h"
 
diff --git a/ui/vnc-enc-zywrle-template.c b/ui/vnc-enc-zywrle-template.c
index 561f7bf..b446380 100644
--- a/ui/vnc-enc-zywrle-template.c
+++ b/ui/vnc-enc-zywrle-template.c
@@ -100,6 +100,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #endif
 
 #define ZYWRLE_QUANTIZE
+#include "qemu/osdep.h"
 #include "vnc-enc-zywrle.h"
 
 #ifndef ZRLE_COMPACT_PIXEL
diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c
index 546635a..98ca978 100644
--- a/ui/vnc-jobs.c
+++ b/ui/vnc-jobs.c
@@ -26,6 +26,7 @@
  */
 
 
+#include "qemu/osdep.h"
 #include "vnc.h"
 #include "vnc-jobs.h"
 #include "qemu/sockets.h"
diff --git a/ui/vnc-palette.c b/ui/vnc-palette.c
index c130dee..3b89d1a 100644
--- a/ui/vnc-palette.c
+++ b/ui/vnc-palette.c
@@ -26,9 +26,9 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "vnc-palette.h"
 #include <glib.h>
-#include <string.h>
 
 static VncPaletteEntry *palette_find(const VncPalette *palette,
                                      uint32_t color, unsigned int hash)
diff --git a/ui/vnc-ws.c b/ui/vnc-ws.c
index 8018233..1d3ecc2 100644
--- a/ui/vnc-ws.c
+++ b/ui/vnc-ws.c
@@ -18,6 +18,7 @@
  * along with this software; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "vnc.h"
 #include "io/channel-websock.h"
 
diff --git a/ui/vnc.c b/ui/vnc.c
index 339f8c3..b6bbea5 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -24,6 +24,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "vnc.h"
 #include "vnc-jobs.h"
 #include "trace.h"
@@ -37,7 +38,6 @@
 #include "qapi/qmp/qerror.h"
 #include "qapi/qmp/types.h"
 #include "qmp-commands.h"
-#include "qemu/osdep.h"
 #include "ui/input.h"
 #include "qapi-event.h"
 #include "crypto/hash.h"
diff --git a/ui/x_keymap.c b/ui/x_keymap.c
index 1a77317..2788485 100644
--- a/ui/x_keymap.c
+++ b/ui/x_keymap.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 "x_keymap.h"
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 02/15] stubs: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 01/15] ui: Clean up includes Peter Maydell
@ 2016-01-29 17:49 ` Peter Maydell
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 03/15] bsd-user: " Peter Maydell
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 stubs/arch-query-cpu-def.c      | 1 +
 stubs/bdrv-commit-all.c         | 1 +
 stubs/clock-warp.c              | 1 +
 stubs/cpu-get-clock.c           | 1 +
 stubs/cpu-get-icount.c          | 1 +
 stubs/cpus.c                    | 1 +
 stubs/dump.c                    | 1 +
 stubs/fd-register.c             | 1 +
 stubs/fdset-add-fd.c            | 1 +
 stubs/fdset-find-fd.c           | 1 +
 stubs/fdset-get-fd.c            | 1 +
 stubs/fdset-remove-fd.c         | 1 +
 stubs/gdbstub.c                 | 1 +
 stubs/get-fd.c                  | 1 +
 stubs/get-next-serial.c         | 1 +
 stubs/get-vm-name.c             | 1 +
 stubs/iothread-lock.c           | 1 +
 stubs/is-daemonized.c           | 1 +
 stubs/kvm.c                     | 1 +
 stubs/machine-init-done.c       | 1 +
 stubs/migr-blocker.c            | 1 +
 stubs/mon-is-qmp.c              | 1 +
 stubs/mon-printf.c              | 1 +
 stubs/monitor-init.c            | 1 +
 stubs/notify-event.c            | 1 +
 stubs/qmp_pc_dimm_device_list.c | 1 +
 stubs/qtest.c                   | 1 +
 stubs/replay-user.c             | 1 +
 stubs/replay.c                  | 2 +-
 stubs/reset.c                   | 1 +
 stubs/runstate-check.c          | 1 +
 stubs/set-fd-handler.c          | 1 +
 stubs/slirp.c                   | 1 +
 stubs/sysbus.c                  | 1 +
 stubs/target-get-monitor-def.c  | 1 +
 stubs/target-monitor-defs.c     | 1 +
 stubs/uuid.c                    | 1 +
 stubs/vhost.c                   | 1 +
 stubs/vm-stop.c                 | 1 +
 stubs/vmstate.c                 | 1 +
 40 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/stubs/arch-query-cpu-def.c b/stubs/arch-query-cpu-def.c
index a975ab4..cefe4be 100644
--- a/stubs/arch-query-cpu-def.c
+++ b/stubs/arch-query-cpu-def.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/arch_init.h"
 #include "qapi/qmp/qerror.h"
diff --git a/stubs/bdrv-commit-all.c b/stubs/bdrv-commit-all.c
index a8e0a95..bf84a1d 100644
--- a/stubs/bdrv-commit-all.c
+++ b/stubs/bdrv-commit-all.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "block/block.h"
 
diff --git a/stubs/clock-warp.c b/stubs/clock-warp.c
index 5565118..5ae32b9 100644
--- a/stubs/clock-warp.c
+++ b/stubs/clock-warp.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/timer.h"
 
diff --git a/stubs/cpu-get-clock.c b/stubs/cpu-get-clock.c
index 5b34c97..1d07523 100644
--- a/stubs/cpu-get-clock.c
+++ b/stubs/cpu-get-clock.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/timer.h"
 
diff --git a/stubs/cpu-get-icount.c b/stubs/cpu-get-icount.c
index d685859..3a6f2ab 100644
--- a/stubs/cpu-get-icount.c
+++ b/stubs/cpu-get-icount.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/timer.h"
 
diff --git a/stubs/cpus.c b/stubs/cpus.c
index 8e6f06b..e192722 100644
--- a/stubs/cpus.c
+++ b/stubs/cpus.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qom/cpu.h"
 
diff --git a/stubs/dump.c b/stubs/dump.c
index 8c24eda..d9ee23f 100644
--- a/stubs/dump.c
+++ b/stubs/dump.c
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/dump-arch.h"
 #include "qmp-commands.h"
diff --git a/stubs/fd-register.c b/stubs/fd-register.c
index d0c34fd..f91aa34 100644
--- a/stubs/fd-register.c
+++ b/stubs/fd-register.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/main-loop.h"
 
diff --git a/stubs/fdset-add-fd.c b/stubs/fdset-add-fd.c
index ee16437..bf9e60a 100644
--- a/stubs/fdset-add-fd.c
+++ b/stubs/fdset-add-fd.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "monitor/monitor.h"
 
diff --git a/stubs/fdset-find-fd.c b/stubs/fdset-find-fd.c
index 4f18344..1d9caf3 100644
--- a/stubs/fdset-find-fd.c
+++ b/stubs/fdset-find-fd.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "monitor/monitor.h"
 
diff --git a/stubs/fdset-get-fd.c b/stubs/fdset-get-fd.c
index 7112c15..5325044 100644
--- a/stubs/fdset-get-fd.c
+++ b/stubs/fdset-get-fd.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "monitor/monitor.h"
 
diff --git a/stubs/fdset-remove-fd.c b/stubs/fdset-remove-fd.c
index 7f6d61e..47ea297 100644
--- a/stubs/fdset-remove-fd.c
+++ b/stubs/fdset-remove-fd.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "monitor/monitor.h"
 
diff --git a/stubs/gdbstub.c b/stubs/gdbstub.c
index f6a4553..359c289 100644
--- a/stubs/gdbstub.c
+++ b/stubs/gdbstub.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "stdbool.h"            /* bool (in exec/gdbstub.h) */
 #include "stddef.h"             /* NULL */
 #include "exec/gdbstub.h"       /* xml_builtin */
diff --git a/stubs/get-fd.c b/stubs/get-fd.c
index 9f2c65c..85881fb 100644
--- a/stubs/get-fd.c
+++ b/stubs/get-fd.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "monitor/monitor.h"
 
diff --git a/stubs/get-next-serial.c b/stubs/get-next-serial.c
index 40c56d1..6ff6a6d 100644
--- a/stubs/get-next-serial.c
+++ b/stubs/get-next-serial.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 CharDriverState *serial_hds[0];
diff --git a/stubs/get-vm-name.c b/stubs/get-vm-name.c
index e5f619f..fa99013 100644
--- a/stubs/get-vm-name.c
+++ b/stubs/get-vm-name.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 const char *qemu_get_vm_name(void)
diff --git a/stubs/iothread-lock.c b/stubs/iothread-lock.c
index dda6f6b..9b6db2e 100644
--- a/stubs/iothread-lock.c
+++ b/stubs/iothread-lock.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/main-loop.h"
 
diff --git a/stubs/is-daemonized.c b/stubs/is-daemonized.c
index c0ee917..d5cd1dc 100644
--- a/stubs/is-daemonized.c
+++ b/stubs/is-daemonized.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 /* Win32 has its own inline stub */
diff --git a/stubs/kvm.c b/stubs/kvm.c
index 828b824..ddd6204 100644
--- a/stubs/kvm.c
+++ b/stubs/kvm.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/kvm.h"
 
diff --git a/stubs/machine-init-done.c b/stubs/machine-init-done.c
index 28a9255..9a0d625 100644
--- a/stubs/machine-init-done.c
+++ b/stubs/machine-init-done.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/sysemu.h"
 
diff --git a/stubs/migr-blocker.c b/stubs/migr-blocker.c
index 300df6e..8ab3604 100644
--- a/stubs/migr-blocker.c
+++ b/stubs/migr-blocker.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "migration/migration.h"
 
diff --git a/stubs/mon-is-qmp.c b/stubs/mon-is-qmp.c
index dd26f19..a8344ce 100644
--- a/stubs/mon-is-qmp.c
+++ b/stubs/mon-is-qmp.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "monitor/monitor.h"
 
diff --git a/stubs/mon-printf.c b/stubs/mon-printf.c
index 0ce2ca6..e7c1e0c 100644
--- a/stubs/mon-printf.c
+++ b/stubs/mon-printf.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "monitor/monitor.h"
 
diff --git a/stubs/monitor-init.c b/stubs/monitor-init.c
index 563902b..de1bc7c 100644
--- a/stubs/monitor-init.c
+++ b/stubs/monitor-init.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "monitor/monitor.h"
 
diff --git a/stubs/notify-event.c b/stubs/notify-event.c
index 32f7289..14e5226 100644
--- a/stubs/notify-event.c
+++ b/stubs/notify-event.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/main-loop.h"
 
diff --git a/stubs/qmp_pc_dimm_device_list.c b/stubs/qmp_pc_dimm_device_list.c
index b584bd8..a4af7fe 100644
--- a/stubs/qmp_pc_dimm_device_list.c
+++ b/stubs/qmp_pc_dimm_device_list.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qom/object.h"
 #include "hw/mem/pc-dimm.h"
 
diff --git a/stubs/qtest.c b/stubs/qtest.c
index 4dfde61..891eb95 100644
--- a/stubs/qtest.c
+++ b/stubs/qtest.c
@@ -8,6 +8,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/qtest.h"
 
 /* Needed for qtest_allowed() */
diff --git a/stubs/replay-user.c b/stubs/replay-user.c
index cf33072..b29e7eb 100644
--- a/stubs/replay-user.c
+++ b/stubs/replay-user.c
@@ -9,6 +9,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/replay.h"
 
 bool replay_exception(void)
diff --git a/stubs/replay.c b/stubs/replay.c
index 8f98790..00ca01f 100644
--- a/stubs/replay.c
+++ b/stubs/replay.c
@@ -1,5 +1,5 @@
+#include "qemu/osdep.h"
 #include "sysemu/replay.h"
-#include <stdlib.h>
 #include "sysemu/sysemu.h"
 
 ReplayMode replay_mode;
diff --git a/stubs/reset.c b/stubs/reset.c
index ad28725..5d47711 100644
--- a/stubs/reset.c
+++ b/stubs/reset.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "hw/hw.h"
 
 /* Stub functions for binaries that never call qemu_devices_reset(),
diff --git a/stubs/runstate-check.c b/stubs/runstate-check.c
index bd2e375..7c5227e 100644
--- a/stubs/runstate-check.c
+++ b/stubs/runstate-check.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "sysemu/sysemu.h"
 
 bool runstate_check(RunState state)
diff --git a/stubs/set-fd-handler.c b/stubs/set-fd-handler.c
index a8481bc..26965de 100644
--- a/stubs/set-fd-handler.c
+++ b/stubs/set-fd-handler.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/main-loop.h"
 
diff --git a/stubs/slirp.c b/stubs/slirp.c
index bd0ac7f..dcae51f 100644
--- a/stubs/slirp.c
+++ b/stubs/slirp.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "slirp/slirp.h"
 
diff --git a/stubs/sysbus.c b/stubs/sysbus.c
index e134965..d8da90c 100644
--- a/stubs/sysbus.c
+++ b/stubs/sysbus.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "hw/qdev-core.h"
 
 BusState *sysbus_get_default(void)
diff --git a/stubs/target-get-monitor-def.c b/stubs/target-get-monitor-def.c
index 711a9ae..013e657 100644
--- a/stubs/target-get-monitor-def.c
+++ b/stubs/target-get-monitor-def.c
@@ -19,6 +19,7 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "stdint.h"
 
 typedef struct CPUState CPUState;
diff --git a/stubs/target-monitor-defs.c b/stubs/target-monitor-defs.c
index 7d8d182..203ebb0 100644
--- a/stubs/target-monitor-defs.c
+++ b/stubs/target-monitor-defs.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "stddef.h"
 #include "qemu/typedefs.h"
 
diff --git a/stubs/uuid.c b/stubs/uuid.c
index ffc0ed4..92ad717 100644
--- a/stubs/uuid.c
+++ b/stubs/uuid.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/sysemu.h"
 #include "qmp-commands.h"
diff --git a/stubs/vhost.c b/stubs/vhost.c
index d346b85..2d76cde 100644
--- a/stubs/vhost.c
+++ b/stubs/vhost.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "hw/virtio/vhost.h"
 
 bool vhost_has_free_slot(void)
diff --git a/stubs/vm-stop.c b/stubs/vm-stop.c
index 69fd86b..8271cad 100644
--- a/stubs/vm-stop.c
+++ b/stubs/vm-stop.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/sysemu.h"
 
diff --git a/stubs/vmstate.c b/stubs/vmstate.c
index 778bc3f..6590627 100644
--- a/stubs/vmstate.c
+++ b/stubs/vmstate.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "migration/vmstate.h"
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 03/15] bsd-user: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 01/15] ui: Clean up includes Peter Maydell
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 02/15] stubs: " Peter Maydell
@ 2016-01-29 17:49 ` Peter Maydell
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 04/15] backends: " Peter Maydell
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 bsd-user/bsdload.c |  8 +-------
 bsd-user/elfload.c |  8 +-------
 bsd-user/main.c    |  8 +-------
 bsd-user/mmap.c    |  7 +------
 bsd-user/signal.c  |  7 +------
 bsd-user/strace.c  |  6 +-----
 bsd-user/syscall.c | 12 +-----------
 bsd-user/uaccess.c |  3 +--
 8 files changed, 8 insertions(+), 51 deletions(-)

diff --git a/bsd-user/bsdload.c b/bsd-user/bsdload.c
index 2abc713..94eec36 100644
--- a/bsd-user/bsdload.c
+++ b/bsd-user/bsdload.c
@@ -1,12 +1,6 @@
 /* Code for loading BSD executables.  Mostly linux kernel code.  */
 
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include "qemu/osdep.h"
 
 #include "qemu.h"
 
diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
index 59a7bdf..0a6092b 100644
--- a/bsd-user/elfload.c
+++ b/bsd-user/elfload.c
@@ -1,13 +1,7 @@
 /* This is the Linux kernel elf-loading code, ported into user space */
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
+#include "qemu/osdep.h"
 #include <sys/mman.h>
-#include <stdlib.h>
-#include <string.h>
 
 #include "qemu.h"
 #include "disas/disas.h"
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 1ecaeb5..1f3575d 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -16,14 +16,8 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
+#include "qemu/osdep.h"
 #include <machine/trap.h>
-#include <sys/types.h>
 #include <sys/mman.h>
 
 #include "qemu.h"
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index 092bf7f..6ab5334 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -16,12 +16,7 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
+#include "qemu/osdep.h"
 #include <sys/mman.h>
 
 #include "qemu.h"
diff --git a/bsd-user/signal.c b/bsd-user/signal.c
index 4887ecc..f6f7aa2 100644
--- a/bsd-user/signal.c
+++ b/bsd-user/signal.c
@@ -16,12 +16,7 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <errno.h>
+#include "qemu/osdep.h"
 
 #include "qemu.h"
 #include "target_signal.h"
diff --git a/bsd-user/strace.c b/bsd-user/strace.c
index e33dd4d..fa66fe1 100644
--- a/bsd-user/strace.c
+++ b/bsd-user/strace.c
@@ -16,14 +16,10 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <stdio.h>
-#include <errno.h>
+#include "qemu/osdep.h"
 #include <sys/select.h>
-#include <sys/types.h>
-#include <unistd.h>
 #include <sys/syscall.h>
 #include <sys/ioccom.h>
-#include <ctype.h>
 
 #include "qemu.h"
 
diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c
index a4d1583..35f784c 100644
--- a/bsd-user/syscall.c
+++ b/bsd-user/syscall.c
@@ -16,17 +16,7 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdarg.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <time.h>
-#include <limits.h>
-#include <sys/types.h>
+#include "qemu/osdep.h"
 #include <sys/mman.h>
 #include <sys/syscall.h>
 #include <sys/param.h>
diff --git a/bsd-user/uaccess.c b/bsd-user/uaccess.c
index 677f19c..7cb6d17 100644
--- a/bsd-user/uaccess.c
+++ b/bsd-user/uaccess.c
@@ -1,6 +1,5 @@
 /* User memory access */
-#include <stdio.h>
-#include <string.h>
+#include "qemu/osdep.h"
 
 #include "qemu.h"
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 04/15] backends: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
                   ` (2 preceding siblings ...)
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 03/15] bsd-user: " Peter Maydell
@ 2016-01-29 17:49 ` Peter Maydell
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 05/15] util: " Peter Maydell
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 backends/baum.c         | 1 +
 backends/hostmem-file.c | 1 +
 backends/hostmem-ram.c  | 1 +
 backends/hostmem.c      | 1 +
 backends/msmouse.c      | 2 +-
 backends/rng-egd.c      | 1 +
 backends/rng-random.c   | 1 +
 backends/rng.c          | 1 +
 backends/testdev.c      | 1 +
 backends/tpm.c          | 1 +
 10 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/backends/baum.c b/backends/baum.c
index ba32b61..374562a 100644
--- a/backends/baum.c
+++ b/backends/baum.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 "sysemu/char.h"
 #include "qemu/timer.h"
diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c
index e9b6d21..fd59482 100644
--- a/backends/hostmem-file.c
+++ b/backends/hostmem-file.c
@@ -9,6 +9,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 "qemu-common.h"
 #include "sysemu/hostmem.h"
 #include "sysemu/sysemu.h"
diff --git a/backends/hostmem-ram.c b/backends/hostmem-ram.c
index a67a134..44fb390 100644
--- a/backends/hostmem-ram.c
+++ b/backends/hostmem-ram.c
@@ -9,6 +9,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 "sysemu/hostmem.h"
 #include "qom/object_interfaces.h"
 
diff --git a/backends/hostmem.c b/backends/hostmem.c
index 1b4eb45..60e882c 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -9,6 +9,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 "sysemu/hostmem.h"
 #include "hw/boards.h"
 #include "qapi/visitor.h"
diff --git a/backends/msmouse.c b/backends/msmouse.c
index 476dab5..9a82efd 100644
--- a/backends/msmouse.c
+++ b/backends/msmouse.c
@@ -21,7 +21,7 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include <stdlib.h>
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "sysemu/char.h"
 #include "ui/console.h"
diff --git a/backends/rng-egd.c b/backends/rng-egd.c
index 6c13409..2de5cd5 100644
--- a/backends/rng-egd.c
+++ b/backends/rng-egd.c
@@ -10,6 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/rng.h"
 #include "sysemu/char.h"
 #include "qapi/qmp/qerror.h"
diff --git a/backends/rng-random.c b/backends/rng-random.c
index 4e51f46..8cdad6a 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -10,6 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/rng-random.h"
 #include "sysemu/rng.h"
 #include "qapi/qmp/qerror.h"
diff --git a/backends/rng.c b/backends/rng.c
index 5065fdc..b7820ef 100644
--- a/backends/rng.c
+++ b/backends/rng.c
@@ -10,6 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/rng.h"
 #include "qapi/qmp/qerror.h"
 #include "qom/object_interfaces.h"
diff --git a/backends/testdev.c b/backends/testdev.c
index 26d5c73..3ab1c90 100644
--- a/backends/testdev.c
+++ b/backends/testdev.c
@@ -23,6 +23,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 "sysemu/char.h"
 
diff --git a/backends/tpm.c b/backends/tpm.c
index a512693..d53da18 100644
--- a/backends/tpm.c
+++ b/backends/tpm.c
@@ -12,6 +12,7 @@
  * Based on backends/rng.c by Anthony Liguori
  */
 
+#include "qemu/osdep.h"
 #include "sysemu/tpm_backend.h"
 #include "qapi/qmp/qerror.h"
 #include "sysemu/tpm.h"
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 05/15] util: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
                   ` (3 preceding siblings ...)
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 04/15] backends: " Peter Maydell
@ 2016-01-29 17:49 ` Peter Maydell
  2016-02-04 17:38   ` Peter Maydell
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 06/15] disas: " Peter Maydell
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 util/acl.c                   |  1 +
 util/base64.c                |  1 +
 util/bitmap.c                |  1 +
 util/bitops.c                |  1 +
 util/buffer.c                |  1 +
 util/compatfd.c              |  1 +
 util/coroutine-gthread.c     |  1 +
 util/coroutine-sigaltstack.c |  4 +---
 util/coroutine-ucontext.c    |  3 +--
 util/coroutine-win32.c       |  1 +
 util/crc32c.c                |  1 +
 util/cutils.c                |  3 +--
 util/envlist.c               |  1 +
 util/error.c                 |  2 +-
 util/event_notifier-posix.c  |  1 +
 util/event_notifier-win32.c  |  1 +
 util/fifo8.c                 |  1 +
 util/getauxval.c             |  2 +-
 util/hbitmap.c               |  4 +---
 util/hexdump.c               |  1 +
 util/host-utils.c            |  3 +--
 util/id.c                    |  1 +
 util/iov.c                   |  1 +
 util/mmap-alloc.c            |  3 +--
 util/module.c                |  2 +-
 util/notify.c                |  1 +
 util/osdep.c                 | 11 +----------
 util/oslib-posix.c           |  4 +---
 util/oslib-win32.c           |  3 +--
 util/path.c                  |  7 +------
 util/qemu-config.c           |  2 +-
 util/qemu-coroutine-io.c     |  1 +
 util/qemu-coroutine-lock.c   |  1 +
 util/qemu-coroutine-sleep.c  |  1 +
 util/qemu-coroutine.c        |  1 +
 util/qemu-error.c            |  2 +-
 util/qemu-openpty.c          |  2 +-
 util/qemu-option.c           |  4 +---
 util/qemu-progress.c         |  3 +--
 util/qemu-sockets.c          |  7 +------
 util/qemu-thread-posix.c     | 11 +----------
 util/qemu-thread-win32.c     |  3 +--
 util/qemu-timer-common.c     |  1 +
 util/rcu.c                   |  6 +-----
 util/readline.c              |  1 +
 util/rfifolock.c             |  2 +-
 util/throttle.c              |  1 +
 util/timed-average.c         |  2 +-
 util/unicode.c               |  1 +
 util/uri.c                   |  3 +--
 50 files changed, 50 insertions(+), 73 deletions(-)

diff --git a/util/acl.c b/util/acl.c
index 571d686..723b6a8 100644
--- a/util/acl.c
+++ b/util/acl.c
@@ -23,6 +23,7 @@
  */
 
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/acl.h"
 
diff --git a/util/base64.c b/util/base64.c
index f82caa7..8aa2a5b 100644
--- a/util/base64.c
+++ b/util/base64.c
@@ -18,6 +18,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include <config-host.h>
 
 #include "qemu/base64.h"
diff --git a/util/bitmap.c b/util/bitmap.c
index 44f0f48..40aadfb 100644
--- a/util/bitmap.c
+++ b/util/bitmap.c
@@ -9,6 +9,7 @@
  * Version 2.
  */
 
+#include "qemu/osdep.h"
 #include "qemu/bitops.h"
 #include "qemu/bitmap.h"
 #include "qemu/atomic.h"
diff --git a/util/bitops.c b/util/bitops.c
index 227c38b..b0c35dd 100644
--- a/util/bitops.c
+++ b/util/bitops.c
@@ -11,6 +11,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
+#include "qemu/osdep.h"
 #include "qemu/bitops.h"
 
 #define BITOP_WORD(nr)		((nr) / BITS_PER_LONG)
diff --git a/util/buffer.c b/util/buffer.c
index 8b27c08..a6118bf 100644
--- a/util/buffer.c
+++ b/util/buffer.c
@@ -18,6 +18,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu/buffer.h"
 #include "trace.h"
 
diff --git a/util/compatfd.c b/util/compatfd.c
index e857150..9a43042 100644
--- a/util/compatfd.c
+++ b/util/compatfd.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 "qemu/compatfd.h"
 #include "qemu/thread.h"
diff --git a/util/coroutine-gthread.c b/util/coroutine-gthread.c
index 0bcd778..fb697eb 100644
--- a/util/coroutine-gthread.c
+++ b/util/coroutine-gthread.c
@@ -18,6 +18,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include <glib.h>
 #include "qemu-common.h"
 #include "qemu/coroutine_int.h"
diff --git a/util/coroutine-sigaltstack.c b/util/coroutine-sigaltstack.c
index 39842a4..6b8aee7 100644
--- a/util/coroutine-sigaltstack.c
+++ b/util/coroutine-sigaltstack.c
@@ -25,11 +25,9 @@
 #ifdef _FORTIFY_SOURCE
 #undef _FORTIFY_SOURCE
 #endif
-#include <stdlib.h>
+#include "qemu/osdep.h"
 #include <setjmp.h>
-#include <stdint.h>
 #include <pthread.h>
-#include <signal.h>
 #include "qemu-common.h"
 #include "qemu/coroutine_int.h"
 
diff --git a/util/coroutine-ucontext.c b/util/coroutine-ucontext.c
index 26cbebb..4914f60 100644
--- a/util/coroutine-ucontext.c
+++ b/util/coroutine-ucontext.c
@@ -22,9 +22,8 @@
 #ifdef _FORTIFY_SOURCE
 #undef _FORTIFY_SOURCE
 #endif
-#include <stdlib.h>
+#include "qemu/osdep.h"
 #include <setjmp.h>
-#include <stdint.h>
 #include <ucontext.h>
 #include "qemu-common.h"
 #include "qemu/coroutine_int.h"
diff --git a/util/coroutine-win32.c b/util/coroutine-win32.c
index 4f922c5..02e28e8 100644
--- a/util/coroutine-win32.c
+++ b/util/coroutine-win32.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/coroutine_int.h"
 
diff --git a/util/crc32c.c b/util/crc32c.c
index 8866327..7e99555 100644
--- a/util/crc32c.c
+++ b/util/crc32c.c
@@ -25,6 +25,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/crc32c.h"
 
diff --git a/util/cutils.c b/util/cutils.c
index cfeb848..59e1f70 100644
--- a/util/cutils.c
+++ b/util/cutils.c
@@ -21,11 +21,10 @@
  * 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 "qemu/host-utils.h"
 #include <math.h>
-#include <limits.h>
-#include <errno.h>
 
 #include "qemu/sockets.h"
 #include "qemu/iov.h"
diff --git a/util/envlist.c b/util/envlist.c
index 099a544..e86857e 100644
--- a/util/envlist.c
+++ b/util/envlist.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/queue.h"
 #include "qemu/envlist.h"
diff --git a/util/error.c b/util/error.c
index 57303fd..471b8b3 100644
--- a/util/error.c
+++ b/util/error.c
@@ -12,8 +12,8 @@
  * the COPYING.LIB file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "qapi/error.h"
 #include "qemu/error-report.h"
 
 struct Error
diff --git a/util/event_notifier-posix.c b/util/event_notifier-posix.c
index d4a0c63..2e30e74 100644
--- a/util/event_notifier-posix.c
+++ b/util/event_notifier-posix.c
@@ -10,6 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/event_notifier.h"
 #include "sysemu/char.h"
diff --git a/util/event_notifier-win32.c b/util/event_notifier-win32.c
index 6dbb530..14b4f7d 100644
--- a/util/event_notifier-win32.c
+++ b/util/event_notifier-win32.c
@@ -10,6 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/event_notifier.h"
 #include "qemu/main-loop.h"
diff --git a/util/fifo8.c b/util/fifo8.c
index 0ea5ad9..5c64101 100644
--- a/util/fifo8.c
+++ b/util/fifo8.c
@@ -12,6 +12,7 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/fifo8.h"
 
diff --git a/util/getauxval.c b/util/getauxval.c
index 1732ace..0b3bae2 100644
--- a/util/getauxval.c
+++ b/util/getauxval.c
@@ -22,8 +22,8 @@
  * THE SOFTWARE.
  */
 
-#include "qemu-common.h"
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 
 #ifdef CONFIG_GETAUXVAL
 /* Don't inline this in qemu/osdep.h, because pulling in <sys/auxv.h> for
diff --git a/util/hbitmap.c b/util/hbitmap.c
index 50b888f..b22b87d 100644
--- a/util/hbitmap.c
+++ b/util/hbitmap.c
@@ -9,10 +9,8 @@
  * later.  See the COPYING file in the top-level directory.
  */
 
-#include <string.h>
-#include <glib.h>
-#include <assert.h>
 #include "qemu/osdep.h"
+#include <glib.h>
 #include "qemu/hbitmap.h"
 #include "qemu/host-utils.h"
 #include "trace.h"
diff --git a/util/hexdump.c b/util/hexdump.c
index 969b340..1d9c129 100644
--- a/util/hexdump.c
+++ b/util/hexdump.c
@@ -13,6 +13,7 @@
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size)
diff --git a/util/host-utils.c b/util/host-utils.c
index 102e5bf..b166e57 100644
--- a/util/host-utils.c
+++ b/util/host-utils.c
@@ -23,8 +23,7 @@
  * THE SOFTWARE.
  */
 
-#include <stdlib.h>
-#include <stdint.h>
+#include "qemu/osdep.h"
 #include "qemu/host-utils.h"
 
 /* Long integer helpers */
diff --git a/util/id.c b/util/id.c
index 7883fbe..bbbadcc 100644
--- a/util/id.c
+++ b/util/id.c
@@ -10,6 +10,7 @@
  * or later.  See the COPYING.LIB file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 bool id_wellformed(const char *id)
diff --git a/util/iov.c b/util/iov.c
index a0d5934..e802ee1 100644
--- a/util/iov.c
+++ b/util/iov.c
@@ -16,6 +16,7 @@
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
+#include "qemu/osdep.h"
 #include "qemu/iov.h"
 #include "qemu/sockets.h"
 
diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
index 5cd7f71..0b4cc7f 100644
--- a/util/mmap-alloc.c
+++ b/util/mmap-alloc.c
@@ -9,10 +9,9 @@
  * 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 <qemu/mmap-alloc.h>
-#include <sys/types.h>
 #include <sys/mman.h>
-#include <assert.h>
 
 #define HUGETLBFS_MAGIC       0x958458f6
 
diff --git a/util/module.c b/util/module.c
index 4bd4a94..ce058ae 100644
--- a/util/module.c
+++ b/util/module.c
@@ -13,7 +13,7 @@
  * GNU GPL, version 2 or (at your option) any later version.
  */
 
-#include <stdlib.h>
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #ifdef CONFIG_MODULES
 #include <gmodule.h>
diff --git a/util/notify.c b/util/notify.c
index f215dfc..06de63a 100644
--- a/util/notify.c
+++ b/util/notify.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 "qemu/notify.h"
 
diff --git a/util/osdep.c b/util/osdep.c
index 534b511..8356bdd 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -21,24 +21,15 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdbool.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
+#include "qemu/osdep.h"
 
 /* Needed early for CONFIG_BSD etc. */
-#include "config-host.h"
 
 #if defined(CONFIG_MADVISE) || defined(CONFIG_POSIX_MADVISE)
 #include <sys/mman.h>
 #endif
 
 #ifdef CONFIG_SOLARIS
-#include <sys/types.h>
 #include <sys/statvfs.h>
 /* See MySQL bug #7156 (http://bugs.mysql.com/bug.php?id=7156) for
    discussion about Solaris header problems */
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index d25f671..b2b5e12 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -30,7 +30,6 @@
    compiler does not see the warning associated with it in stdlib.h on OSX */
 #ifdef __APPLE__
 #define daemon qemu_fake_daemon_function
-#include <stdlib.h>
 #undef daemon
 extern int daemon(int, int);
 #endif
@@ -47,13 +46,12 @@ extern int daemon(int, int);
 #  define QEMU_VMALLOC_ALIGN getpagesize()
 #endif
 
+#include "qemu/osdep.h"
 #include <termios.h>
-#include <unistd.h>
 #include <termios.h>
 
 #include <glib/gprintf.h>
 
-#include "config-host.h"
 #include "sysemu/sysemu.h"
 #include "trace.h"
 #include "qemu/sockets.h"
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 6a47019..438cfa4 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -29,10 +29,9 @@
  * this file are based on code from GNOME glib-2 and use a different license,
  * see the license comment there.
  */
+#include "qemu/osdep.h"
 #include <windows.h>
 #include <glib.h>
-#include <stdlib.h>
-#include "config-host.h"
 #include "sysemu/sysemu.h"
 #include "qemu/main-loop.h"
 #include "trace.h"
diff --git a/util/path.c b/util/path.c
index 4e4877e..d09e8c5 100644
--- a/util/path.c
+++ b/util/path.c
@@ -3,14 +3,9 @@
 
    The assumption is that this area does not change.
 */
-#include <sys/types.h>
+#include "qemu/osdep.h"
 #include <sys/param.h>
 #include <dirent.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
 #include "qemu-common.h"
 
 struct pathelem
diff --git a/util/qemu-config.c b/util/qemu-config.c
index 687fd34..fb97307 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -1,8 +1,8 @@
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/option.h"
 #include "qemu/config-file.h"
-#include "qapi/error.h"
 #include "qmp-commands.h"
 
 static QemuOptsList *vm_config_groups[48];
diff --git a/util/qemu-coroutine-io.c b/util/qemu-coroutine-io.c
index e1eae73..0d5041c 100644
--- a/util/qemu-coroutine-io.c
+++ b/util/qemu-coroutine-io.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 "qemu-common.h"
 #include "qemu/sockets.h"
 #include "qemu/coroutine.h"
diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c
index 130ee19..da37ca7 100644
--- a/util/qemu-coroutine-lock.c
+++ b/util/qemu-coroutine-lock.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/coroutine.h"
 #include "qemu/coroutine_int.h"
diff --git a/util/qemu-coroutine-sleep.c b/util/qemu-coroutine-sleep.c
index b35db56..6966831 100644
--- a/util/qemu-coroutine-sleep.c
+++ b/util/qemu-coroutine-sleep.c
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu/coroutine.h"
 #include "qemu/timer.h"
 #include "block/aio.h"
diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c
index 8953560..5816702 100644
--- a/util/qemu-coroutine.c
+++ b/util/qemu-coroutine.c
@@ -12,6 +12,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "trace.h"
 #include "qemu-common.h"
 #include "qemu/thread.h"
diff --git a/util/qemu-error.c b/util/qemu-error.c
index ecf5708..1ef3566 100644
--- a/util/qemu-error.c
+++ b/util/qemu-error.c
@@ -10,7 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <stdio.h>
+#include "qemu/osdep.h"
 #include "monitor/monitor.h"
 #include "qemu/error-report.h"
 
diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c
index 4c53211..2e8b43b 100644
--- a/util/qemu-openpty.c
+++ b/util/qemu-openpty.c
@@ -32,7 +32,7 @@
  * linked with -lutil.
  */
 
-#include "config-host.h"
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 #if defined(__GLIBC__)
diff --git a/util/qemu-option.c b/util/qemu-option.c
index a2d593a..e7aa43f 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -23,13 +23,11 @@
  * THE SOFTWARE.
  */
 
-#include <stdio.h>
-#include <string.h>
+#include "qemu/osdep.h"
 
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qapi/qmp/types.h"
-#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/option_int.h"
 
diff --git a/util/qemu-progress.c b/util/qemu-progress.c
index 532333e..f745233 100644
--- a/util/qemu-progress.c
+++ b/util/qemu-progress.c
@@ -22,9 +22,8 @@
  * THE SOFTWARE.
  */
 
-#include "qemu-common.h"
 #include "qemu/osdep.h"
-#include <stdio.h>
+#include "qemu-common.h"
 
 struct progress_state {
     float current;
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index f455a17..51354df 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -15,12 +15,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 <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <unistd.h>
+#include "qemu/osdep.h"
 
 #include "monitor/monitor.h"
 #include "qemu/sockets.h"
diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c
index dbd8094..74a3023 100644
--- a/util/qemu-thread-posix.c
+++ b/util/qemu-thread-posix.c
@@ -10,16 +10,7 @@
  * See the COPYING file in the top-level directory.
  *
  */
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <time.h>
-#include <signal.h>
-#include <stdint.h>
-#include <string.h>
-#include <limits.h>
-#include <unistd.h>
-#include <sys/time.h>
+#include "qemu/osdep.h"
 #ifdef __linux__
 #include <sys/syscall.h>
 #include <linux/futex.h>
diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c
index 6cdd553..98a5ddf 100644
--- a/util/qemu-thread-win32.c
+++ b/util/qemu-thread-win32.c
@@ -10,12 +10,11 @@
  * See the COPYING file in the top-level directory.
  *
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/thread.h"
 #include "qemu/notify.h"
 #include <process.h>
-#include <assert.h>
-#include <limits.h>
 
 static bool name_threads;
 
diff --git a/util/qemu-timer-common.c b/util/qemu-timer-common.c
index 95e0847..06d084d 100644
--- a/util/qemu-timer-common.c
+++ b/util/qemu-timer-common.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/timer.h"
 
 /***********************************************************/
diff --git a/util/rcu.c b/util/rcu.c
index 8ba304d..bceb3e4 100644
--- a/util/rcu.c
+++ b/util/rcu.c
@@ -26,12 +26,8 @@
  * IBM's contributions to this file may be relicensed under LGPLv2 or later.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
-#include <stdio.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <errno.h>
 #include "qemu/rcu.h"
 #include "qemu/atomic.h"
 #include "qemu/thread.h"
diff --git a/util/readline.c b/util/readline.c
index cc1302a..e94c975 100644
--- a/util/readline.c
+++ b/util/readline.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/readline.h"
 
diff --git a/util/rfifolock.c b/util/rfifolock.c
index afbf748..c22f5fe 100644
--- a/util/rfifolock.c
+++ b/util/rfifolock.c
@@ -11,7 +11,7 @@
  *
  */
 
-#include <assert.h>
+#include "qemu/osdep.h"
 #include "qemu/rfifolock.h"
 
 void rfifolock_init(RFifoLock *r, void (*cb)(void *), void *opaque)
diff --git a/util/throttle.c b/util/throttle.c
index af4bc95..2f9b23d 100644
--- a/util/throttle.c
+++ b/util/throttle.c
@@ -22,6 +22,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "qemu/throttle.h"
 #include "qemu/timer.h"
 #include "block/aio.h"
diff --git a/util/timed-average.c b/util/timed-average.c
index a2dfb48..2eef9cb 100644
--- a/util/timed-average.c
+++ b/util/timed-average.c
@@ -22,7 +22,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <string.h>
+#include "qemu/osdep.h"
 
 #include "qemu/timed-average.h"
 
diff --git a/util/unicode.c b/util/unicode.c
index d1c8658..524dca8 100644
--- a/util/unicode.c
+++ b/util/unicode.c
@@ -10,6 +10,7 @@
  * later.  See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 /**
diff --git a/util/uri.c b/util/uri.c
index 550b984..d109d6c 100644
--- a/util/uri.c
+++ b/util/uri.c
@@ -51,9 +51,8 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include <glib.h>
-#include <string.h>
-#include <stdio.h>
 
 #include "qemu/uri.h"
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 06/15] disas: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
                   ` (4 preceding siblings ...)
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 05/15] util: " Peter Maydell
@ 2016-01-29 17:49 ` Peter Maydell
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 07/15] qapi: " Peter Maydell
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 disas/hppa.c  | 1 +
 disas/i386.c  | 2 +-
 disas/ia64.c  | 3 +--
 disas/m68k.c  | 3 +--
 disas/s390.c  | 1 +
 disas/sparc.c | 2 +-
 disas/tci.c   | 1 +
 7 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/disas/hppa.c b/disas/hppa.c
index c7c8be6..43facdc 100644
--- a/disas/hppa.c
+++ b/disas/hppa.c
@@ -18,6 +18,7 @@
    You should have received a copy of the GNU General Public License
    along with this program; if not, see <http://www.gnu.org/licenses/>. */
 
+#include "qemu/osdep.h"
 #include "disas/bfd.h"
 
 /* HP PA-RISC SOM object file format:  definitions internal to BFD.
diff --git a/disas/i386.c b/disas/i386.c
index c63d4a0..d40b72a 100644
--- a/disas/i386.c
+++ b/disas/i386.c
@@ -31,7 +31,7 @@
    and the small letter tells about the operand size.  Refer to
    the Intel manual for details.  */
 
-#include <stdlib.h>
+#include "qemu/osdep.h"
 #include "disas/bfd.h"
 /* include/opcode/i386.h r1.78 */
 
diff --git a/disas/ia64.c b/disas/ia64.c
index d7c7bdf..140754c 100644
--- a/disas/ia64.c
+++ b/disas/ia64.c
@@ -18,7 +18,7 @@
    along with this file; see the file COPYING.  If not, see
    <http://www.gnu.org/licenses/>. */
 
-#include <string.h>
+#include "qemu/osdep.h"
 
 #include "disas/bfd.h"
 
@@ -27,7 +27,6 @@
    Free Software Foundation, Inc.
    Contributed by David Mosberger-Tang <davidm@hpl.hp.com> */
 
-#include <sys/types.h>
 
 typedef uint64_t ia64_insn;
 
diff --git a/disas/m68k.c b/disas/m68k.c
index cc0db96..0412ecd 100644
--- a/disas/m68k.c
+++ b/disas/m68k.c
@@ -1,9 +1,8 @@
 /* This file is composed of several different files from the upstream
    sourceware.org CVS.  Original file boundaries marked with **** */
 
-#include <string.h>
+#include "qemu/osdep.h"
 #include <math.h>
-#include <stdio.h>
 
 #include "disas/bfd.h"
 
diff --git a/disas/s390.c b/disas/s390.c
index c29bc4e..1f167d2 100644
--- a/disas/s390.c
+++ b/disas/s390.c
@@ -20,6 +20,7 @@
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "disas/bfd.h"
 
diff --git a/disas/sparc.c b/disas/sparc.c
index 59a1e36..64bba8d 100644
--- a/disas/sparc.c
+++ b/disas/sparc.c
@@ -26,7 +26,7 @@
    along with GAS or GDB; see the file COPYING. If not,
    see <http://www.gnu.org/licenses/>.  */
 
-#include <stdlib.h>
+#include "qemu/osdep.h"
 #include "disas/bfd.h"
 
 /* The SPARC opcode table (and other related data) is defined in
diff --git a/disas/tci.c b/disas/tci.c
index d7b954e..1cdf5ee 100644
--- a/disas/tci.c
+++ b/disas/tci.c
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "disas/bfd.h"
 #include "tcg/tcg.h"
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 07/15] qapi: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
                   ` (5 preceding siblings ...)
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 06/15] disas: " Peter Maydell
@ 2016-01-29 17:49 ` Peter Maydell
  2016-01-29 18:31   ` Eric Blake
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 08/15] qga: " Peter Maydell
                   ` (8 subsequent siblings)
  15 siblings, 1 reply; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 qapi/opts-visitor.c          | 1 +
 qapi/qapi-dealloc-visitor.c  | 1 +
 qapi/qapi-util.c             | 2 +-
 qapi/qapi-visit-core.c       | 1 +
 qapi/qmp-dispatch.c          | 2 +-
 qapi/qmp-event.c             | 2 +-
 qapi/qmp-input-visitor.c     | 1 +
 qapi/qmp-output-visitor.c    | 1 +
 qapi/qmp-registry.c          | 2 +-
 qapi/string-input-visitor.c  | 1 +
 qapi/string-output-visitor.c | 1 +
 11 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
index ef5fb8b..eb7d85b 100644
--- a/qapi/opts-visitor.c
+++ b/qapi/opts-visitor.c
@@ -10,6 +10,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/qmp/qerror.h"
 #include "qapi/opts-visitor.h"
diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
index 737deab..9340446 100644
--- a/qapi/qapi-dealloc-visitor.c
+++ b/qapi/qapi-dealloc-visitor.c
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qapi/dealloc-visitor.h"
 #include "qemu/queue.h"
 #include "qemu-common.h"
diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c
index bcdc94d..8afb12e 100644
--- a/qapi/qapi-util.c
+++ b/qapi/qapi-util.c
@@ -10,8 +10,8 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "qapi/error.h"
 #include "qapi/util.h"
 
 int qapi_enum_parse(const char * const lookup[], const char *buf,
diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c
index 6d63e40..8473d3c 100644
--- a/qapi/qapi-visit-core.c
+++ b/qapi/qapi-visit-core.c
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/qmp/qobject.h"
 #include "qapi/qmp/qerror.h"
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index f36933d..8f27c34 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -11,11 +11,11 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qapi/qmp/types.h"
 #include "qapi/qmp/dispatch.h"
 #include "qapi/qmp/json-parser.h"
 #include "qapi-types.h"
-#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 
 static QDict *qmp_dispatch_check_obj(const QObject *request, Error **errp)
diff --git a/qapi/qmp-event.c b/qapi/qmp-event.c
index c0e435f..8bba165 100644
--- a/qapi/qmp-event.c
+++ b/qapi/qmp-event.c
@@ -11,7 +11,7 @@
  *
  */
 
-#include <inttypes.h>
+#include "qemu/osdep.h"
 
 #include "qemu-common.h"
 #include "qapi/qmp-event.h"
diff --git a/qapi/qmp-input-visitor.c b/qapi/qmp-input-visitor.c
index 932b5f3..edb8bd2 100644
--- a/qapi/qmp-input-visitor.c
+++ b/qapi/qmp-input-visitor.c
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qapi/qmp-input-visitor.h"
 #include "qapi/visitor-impl.h"
 #include "qemu/queue.h"
diff --git a/qapi/qmp-output-visitor.c b/qapi/qmp-output-visitor.c
index 29899ac..b064fb5 100644
--- a/qapi/qmp-output-visitor.c
+++ b/qapi/qmp-output-visitor.c
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qapi/qmp-output-visitor.h"
 #include "qapi/visitor-impl.h"
 #include "qemu/queue.h"
diff --git a/qapi/qmp-registry.c b/qapi/qmp-registry.c
index 3e4498a..4ebfbcc 100644
--- a/qapi/qmp-registry.c
+++ b/qapi/qmp-registry.c
@@ -12,8 +12,8 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include <glib.h>
-#include <string.h>
 #include "qapi/qmp/dispatch.h"
 
 static QTAILQ_HEAD(QmpCommandList, QmpCommand) qmp_commands =
diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c
index dee780a..8c5ff7e 100644
--- a/qapi/string-input-visitor.c
+++ b/qapi/string-input-visitor.c
@@ -10,6 +10,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/string-input-visitor.h"
 #include "qapi/visitor-impl.h"
diff --git a/qapi/string-output-visitor.c b/qapi/string-output-visitor.c
index b86ce2c..b04cec4 100644
--- a/qapi/string-output-visitor.c
+++ b/qapi/string-output-visitor.c
@@ -10,6 +10,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/string-output-visitor.h"
 #include "qapi/visitor-impl.h"
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 08/15] qga: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
                   ` (6 preceding siblings ...)
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 07/15] qapi: " Peter Maydell
@ 2016-01-29 17:49 ` Peter Maydell
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 09/15] slirp: " Peter Maydell
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 qga/channel-posix.c             | 7 +------
 qga/channel-win32.c             | 5 +----
 qga/commands-posix.c            | 9 +--------
 qga/commands-win32.c            | 3 +--
 qga/commands.c                  | 1 +
 qga/guest-agent-command-state.c | 1 +
 qga/main.c                      | 5 +----
 qga/service-win32.c             | 3 +--
 qga/vss-win32.c                 | 2 +-
 9 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/qga/channel-posix.c b/qga/channel-posix.c
index 50d9dd3..7ad3c00 100644
--- a/qga/channel-posix.c
+++ b/qga/channel-posix.c
@@ -1,11 +1,6 @@
+#include "qemu/osdep.h"
 #include <glib.h>
 #include <termios.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include "qemu/osdep.h"
 #include "qemu/sockets.h"
 #include "qga/channel.h"
 
diff --git a/qga/channel-win32.c b/qga/channel-win32.c
index 0452b9f..bb59661 100644
--- a/qga/channel-win32.c
+++ b/qga/channel-win32.c
@@ -1,9 +1,6 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdbool.h>
+#include "qemu/osdep.h"
 #include <glib.h>
 #include <windows.h>
-#include <errno.h>
 #include <io.h>
 #include "qga/guest-agent-core.h"
 #include "qga/channel.h"
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 5f91275..9589b2d634 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -11,18 +11,11 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include <glib.h>
-#include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/wait.h>
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
 #include <dirent.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <inttypes.h>
 #include "qga/guest-agent-core.h"
 #include "qga-qmp-commands.h"
 #include "qapi/qmp/qerror.h"
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 61ffbdf..cf0757c 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -11,11 +11,10 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include <glib.h>
 #include <wtypes.h>
 #include <powrprof.h>
-#include <stdio.h>
-#include <string.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #include <iptypes.h>
diff --git a/qga/commands.c b/qga/commands.c
index 58568d8..5b56786 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -10,6 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include <glib.h>
 #include "qga/guest-agent-core.h"
 #include "qga-qmp-commands.h"
diff --git a/qga/guest-agent-command-state.c b/qga/guest-agent-command-state.c
index 128c549..20b9b22 100644
--- a/qga/guest-agent-command-state.c
+++ b/qga/guest-agent-command-state.c
@@ -9,6 +9,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 <glib.h>
 #include "qga/guest-agent-core.h"
 
diff --git a/qga/main.c b/qga/main.c
index f83a97d..0a168e2 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -10,16 +10,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 <stdlib.h>
-#include <stdio.h>
-#include <stdbool.h>
+#include "qemu/osdep.h"
 #include <glib.h>
 #include <getopt.h>
 #include <glib/gstdio.h>
 #ifndef _WIN32
 #include <syslog.h>
 #include <sys/wait.h>
-#include <sys/stat.h>
 #endif
 #include "qapi/qmp/json-streamer.h"
 #include "qapi/qmp/json-parser.h"
diff --git a/qga/service-win32.c b/qga/service-win32.c
index aef41f0..7243758 100644
--- a/qga/service-win32.c
+++ b/qga/service-win32.c
@@ -10,8 +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 <stdlib.h>
-#include <stdio.h>
+#include "qemu/osdep.h"
 #include <glib.h>
 #include <windows.h>
 #include "qga/service-win32.h"
diff --git a/qga/vss-win32.c b/qga/vss-win32.c
index 2142b49..5182e3b 100644
--- a/qga/vss-win32.c
+++ b/qga/vss-win32.c
@@ -10,7 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 
-#include <stdio.h>
+#include "qemu/osdep.h"
 #include <windows.h>
 #include "qga/guest-agent-core.h"
 #include "qga/vss-win32.h"
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 09/15] slirp: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
                   ` (7 preceding siblings ...)
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 08/15] qga: " Peter Maydell
@ 2016-01-29 17:49 ` Peter Maydell
  2016-01-29 17:50 ` [Qemu-devel] [PATCH 10/15] net: " Peter Maydell
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 slirp/arp_table.c  | 1 +
 slirp/bootp.c      | 1 +
 slirp/cksum.c      | 1 +
 slirp/dnssearch.c  | 4 +---
 slirp/if.c         | 1 +
 slirp/ip_icmp.c    | 1 +
 slirp/ip_input.c   | 1 +
 slirp/ip_output.c  | 1 +
 slirp/mbuf.c       | 1 +
 slirp/misc.c       | 1 +
 slirp/sbuf.c       | 1 +
 slirp/slirp.c      | 1 +
 slirp/socket.c     | 1 +
 slirp/tcp_input.c  | 1 +
 slirp/tcp_output.c | 1 +
 slirp/tcp_subr.c   | 1 +
 slirp/tcp_timer.c  | 1 +
 slirp/tftp.c       | 1 +
 slirp/udp.c        | 1 +
 19 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/slirp/arp_table.c b/slirp/arp_table.c
index bcaeb44..3547043 100644
--- a/slirp/arp_table.c
+++ b/slirp/arp_table.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "slirp.h"
 
 void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN])
diff --git a/slirp/bootp.c b/slirp/bootp.c
index 1baaab1..ba953ae 100644
--- a/slirp/bootp.c
+++ b/slirp/bootp.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 <slirp.h>
 
 #if defined(_WIN32)
diff --git a/slirp/cksum.c b/slirp/cksum.c
index 6328660..bc0d017 100644
--- a/slirp/cksum.c
+++ b/slirp/cksum.c
@@ -30,6 +30,7 @@
  * in_cksum.c,v 1.2 1994/08/02 07:48:16 davidg Exp
  */
 
+#include "qemu/osdep.h"
 #include <slirp.h>
 
 /*
diff --git a/slirp/dnssearch.c b/slirp/dnssearch.c
index 4c9064e..aed2f13 100644
--- a/slirp/dnssearch.c
+++ b/slirp/dnssearch.c
@@ -22,9 +22,7 @@
  * THE SOFTWARE.
  */
 
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
+#include "qemu/osdep.h"
 #include <glib.h>
 #include "slirp.h"
 
diff --git a/slirp/if.c b/slirp/if.c
index 8325a2a..93d7cc0 100644
--- a/slirp/if.c
+++ b/slirp/if.c
@@ -5,6 +5,7 @@
  * terms and conditions of the copyright.
  */
 
+#include "qemu/osdep.h"
 #include <slirp.h>
 #include "qemu/timer.h"
 
diff --git a/slirp/ip_icmp.c b/slirp/ip_icmp.c
index 23b9f0f..92b04d7 100644
--- a/slirp/ip_icmp.c
+++ b/slirp/ip_icmp.c
@@ -30,6 +30,7 @@
  * ip_icmp.c,v 1.7 1995/05/30 08:09:42 rgrimes Exp
  */
 
+#include "qemu/osdep.h"
 #include "slirp.h"
 #include "ip_icmp.h"
 
diff --git a/slirp/ip_input.c b/slirp/ip_input.c
index 7d436e6..e4855ae 100644
--- a/slirp/ip_input.c
+++ b/slirp/ip_input.c
@@ -38,6 +38,7 @@
  * terms and conditions of the copyright.
  */
 
+#include "qemu/osdep.h"
 #include <slirp.h>
 #include <qemu/osdep.h>
 #include "ip_icmp.h"
diff --git a/slirp/ip_output.c b/slirp/ip_output.c
index 1254d0d..0d6b3b8 100644
--- a/slirp/ip_output.c
+++ b/slirp/ip_output.c
@@ -38,6 +38,7 @@
  * terms and conditions of the copyright.
  */
 
+#include "qemu/osdep.h"
 #include <slirp.h>
 
 /* Number of packets queued before we start sending
diff --git a/slirp/mbuf.c b/slirp/mbuf.c
index 795fc29..8b99a28 100644
--- a/slirp/mbuf.c
+++ b/slirp/mbuf.c
@@ -15,6 +15,7 @@
  * the flags
  */
 
+#include "qemu/osdep.h"
 #include <slirp.h>
 
 #define MBUF_THRESH 30
diff --git a/slirp/misc.c b/slirp/misc.c
index 5497161..e2eea2e 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -5,6 +5,7 @@
  * terms and conditions of the copyright.
  */
 
+#include "qemu/osdep.h"
 #include <slirp.h>
 #include <libslirp.h>
 
diff --git a/slirp/sbuf.c b/slirp/sbuf.c
index b8c3db7..dd4cb8c 100644
--- a/slirp/sbuf.c
+++ b/slirp/sbuf.c
@@ -5,6 +5,7 @@
  * terms and conditions of the copyright.
  */
 
+#include "qemu/osdep.h"
 #include <slirp.h>
 #include <qemu/main-loop.h>
 
diff --git a/slirp/slirp.c b/slirp/slirp.c
index 35f819a..d3dc609 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.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 "qemu/timer.h"
 #include "sysemu/char.h"
diff --git a/slirp/socket.c b/slirp/socket.c
index 1673e3a..634b532 100644
--- a/slirp/socket.c
+++ b/slirp/socket.c
@@ -5,6 +5,7 @@
  * terms and conditions of the copyright.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include <slirp.h>
 #include "ip_icmp.h"
diff --git a/slirp/tcp_input.c b/slirp/tcp_input.c
index 6b096ec..de610e3 100644
--- a/slirp/tcp_input.c
+++ b/slirp/tcp_input.c
@@ -38,6 +38,7 @@
  * terms and conditions of the copyright.
  */
 
+#include "qemu/osdep.h"
 #include <slirp.h>
 #include "ip_icmp.h"
 
diff --git a/slirp/tcp_output.c b/slirp/tcp_output.c
index fafca58..34e4d2e 100644
--- a/slirp/tcp_output.c
+++ b/slirp/tcp_output.c
@@ -38,6 +38,7 @@
  * terms and conditions of the copyright.
  */
 
+#include "qemu/osdep.h"
 #include <slirp.h>
 
 static const u_char  tcp_outflags[TCP_NSTATES] = {
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
index e161ed2..499eec3 100644
--- a/slirp/tcp_subr.c
+++ b/slirp/tcp_subr.c
@@ -38,6 +38,7 @@
  * terms and conditions of the copyright.
  */
 
+#include "qemu/osdep.h"
 #include <slirp.h>
 
 /* patchable/settable parameters for tcp */
diff --git a/slirp/tcp_timer.c b/slirp/tcp_timer.c
index 6c5bb11..1214c2e 100644
--- a/slirp/tcp_timer.c
+++ b/slirp/tcp_timer.c
@@ -30,6 +30,7 @@
  * tcp_timer.c,v 1.2 1994/08/02 07:49:10 davidg Exp
  */
 
+#include "qemu/osdep.h"
 #include <slirp.h>
 
 static struct tcpcb *tcp_timers(register struct tcpcb *tp, int timer);
diff --git a/slirp/tftp.c b/slirp/tftp.c
index a329fb2..b7b5e21 100644
--- a/slirp/tftp.c
+++ b/slirp/tftp.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include <slirp.h>
 #include "qemu-common.h"
 
diff --git a/slirp/udp.c b/slirp/udp.c
index fee13b4..6dfd83d 100644
--- a/slirp/udp.c
+++ b/slirp/udp.c
@@ -38,6 +38,7 @@
  * terms and conditions of the copyright.
  */
 
+#include "qemu/osdep.h"
 #include <slirp.h>
 #include "ip_icmp.h"
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 10/15] net: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
                   ` (8 preceding siblings ...)
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 09/15] slirp: " Peter Maydell
@ 2016-01-29 17:50 ` Peter Maydell
  2016-01-29 17:50 ` [Qemu-devel] [PATCH 11/15] qobject: " Peter Maydell
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 net/checksum.c      | 1 +
 net/dump.c          | 1 +
 net/eth.c           | 1 +
 net/filter-buffer.c | 1 +
 net/filter.c        | 1 +
 net/hub.c           | 1 +
 net/l2tpv3.c        | 2 +-
 net/net.c           | 2 +-
 net/netmap.c        | 3 +--
 net/queue.c         | 1 +
 net/slirp.c         | 2 +-
 net/socket.c        | 2 +-
 net/tap-aix.c       | 2 +-
 net/tap-bsd.c       | 1 +
 net/tap-haiku.c     | 2 +-
 net/tap-linux.c     | 1 +
 net/tap-solaris.c   | 2 +-
 net/tap-win32.c     | 2 +-
 net/tap.c           | 3 +--
 net/util.c          | 3 +--
 net/vde.c           | 2 +-
 net/vhost-user.c    | 1 +
 22 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/net/checksum.c b/net/checksum.c
index 14c0855..b5016ab 100644
--- a/net/checksum.c
+++ b/net/checksum.c
@@ -15,6 +15,7 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "net/checksum.h"
 
diff --git a/net/dump.c b/net/dump.c
index 88d9582..dc0f339 100644
--- a/net/dump.c
+++ b/net/dump.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "clients.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
diff --git a/net/eth.c b/net/eth.c
index 7c61132..7e32d27 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -15,6 +15,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "net/eth.h"
 #include "net/checksum.h"
 #include "qemu-common.h"
diff --git a/net/filter-buffer.c b/net/filter-buffer.c
index 57be149..2353d5b 100644
--- a/net/filter-buffer.c
+++ b/net/filter-buffer.c
@@ -6,6 +6,7 @@
  * later.  See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "net/filter.h"
 #include "net/queue.h"
 #include "qemu-common.h"
diff --git a/net/filter.c b/net/filter.c
index 5d90f83..19f0f61 100644
--- a/net/filter.c
+++ b/net/filter.c
@@ -6,6 +6,7 @@
  * later.  See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/error-report.h"
diff --git a/net/hub.c b/net/hub.c
index 9ae9f01..b6d44fd 100644
--- a/net/hub.c
+++ b/net/hub.c
@@ -12,6 +12,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "monitor/monitor.h"
 #include "net/net.h"
 #include "clients.h"
diff --git a/net/l2tpv3.c b/net/l2tpv3.c
index 21d6119..824161c 100644
--- a/net/l2tpv3.c
+++ b/net/l2tpv3.c
@@ -23,9 +23,9 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include <linux/ip.h>
 #include <netdb.h>
-#include "config-host.h"
 #include "net/net.h"
 #include "clients.h"
 #include "qemu-common.h"
diff --git a/net/net.c b/net/net.c
index 87dd356..01ba117 100644
--- a/net/net.c
+++ b/net/net.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 "net/net.h"
 #include "clients.h"
diff --git a/net/netmap.c b/net/netmap.c
index 5558368..a39ca4b 100644
--- a/net/netmap.c
+++ b/net/netmap.c
@@ -23,11 +23,10 @@
  */
 
 
+#include "qemu/osdep.h"
 #include <sys/ioctl.h>
 #include <net/if.h>
 #include <sys/mman.h>
-#include <stdint.h>
-#include <stdio.h>
 #define NETMAP_WITH_LIBS
 #include <net/netmap.h>
 #include <net/netmap_user.h>
diff --git a/net/queue.c b/net/queue.c
index de8b9d3..9c32abd 100644
--- a/net/queue.c
+++ b/net/queue.c
@@ -21,6 +21,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "net/queue.h"
 #include "qemu/queue.h"
 #include "net/net.h"
diff --git a/net/slirp.c b/net/slirp.c
index f505570..e2b500b 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -21,9 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+#include "qemu/osdep.h"
 #include "net/slirp.h"
 
-#include "config-host.h"
 
 #ifndef _WIN32
 #include <pwd.h>
diff --git a/net/socket.c b/net/socket.c
index e8605d4..e32e3cb 100644
--- a/net/socket.c
+++ b/net/socket.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 "net/net.h"
 #include "clients.h"
diff --git a/net/tap-aix.c b/net/tap-aix.c
index e84fc39..9d830b7 100644
--- a/net/tap-aix.c
+++ b/net/tap-aix.c
@@ -22,8 +22,8 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "tap_int.h"
-#include <stdio.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/tap-bsd.c b/net/tap-bsd.c
index 0103a97..83de19a 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "tap_int.h"
 #include "qemu-common.h"
 #include "sysemu/sysemu.h"
diff --git a/net/tap-haiku.c b/net/tap-haiku.c
index 2e738ec..397e532 100644
--- a/net/tap-haiku.c
+++ b/net/tap-haiku.c
@@ -22,8 +22,8 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "tap_int.h"
-#include <stdio.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/tap-linux.c b/net/tap-linux.c
index 5bd9d21..0929cf7 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "tap_int.h"
 #include "tap-linux.h"
 #include "net/tap.h"
diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index 0f60f78..e3907a8 100644
--- a/net/tap-solaris.c
+++ b/net/tap-solaris.c
@@ -22,10 +22,10 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "tap_int.h"
 #include "sysemu/sysemu.h"
 
-#include <sys/stat.h>
 #include <sys/ethernet.h>
 #include <sys/sockio.h>
 #include <netinet/arp.h>
diff --git a/net/tap-win32.c b/net/tap-win32.c
index 7fddb20..38bbac0 100644
--- a/net/tap-win32.c
+++ b/net/tap-win32.c
@@ -26,6 +26,7 @@
  *  distribution); if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "tap_int.h"
 
 #include "qemu-common.h"
@@ -34,7 +35,6 @@
 #include "net/tap.h"            /* tap_has_ufo, ... */
 #include "sysemu/sysemu.h"
 #include "qemu/error-report.h"
-#include <stdio.h>
 #include <windows.h>
 #include <winioctl.h>
 
diff --git a/net/tap.c b/net/tap.c
index 85c4142..cfb6831 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -23,12 +23,11 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "tap_int.h"
 
-#include "config-host.h"
 
 #include <sys/ioctl.h>
-#include <sys/stat.h>
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <net/if.h>
diff --git a/net/util.c b/net/util.c
index 7e95076..0b3dbfe 100644
--- a/net/util.c
+++ b/net/util.c
@@ -22,9 +22,8 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "util.h"
-#include <errno.h>
-#include <stdlib.h>
 
 int net_parse_macaddr(uint8_t *macaddr, const char *p)
 {
diff --git a/net/vde.c b/net/vde.c
index 4475d92..973faf5 100644
--- a/net/vde.c
+++ b/net/vde.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 <libvdeplug.h>
 
diff --git a/net/vhost-user.c b/net/vhost-user.c
index e4dd089..451dbbf 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -8,6 +8,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "clients.h"
 #include "net/vhost_net.h"
 #include "net/vhost-user.h"
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 11/15] qobject: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
                   ` (9 preceding siblings ...)
  2016-01-29 17:50 ` [Qemu-devel] [PATCH 10/15] net: " Peter Maydell
@ 2016-01-29 17:50 ` Peter Maydell
  2016-01-29 18:35   ` Eric Blake
  2016-01-29 17:50 ` [Qemu-devel] [PATCH 12/15] qom: " Peter Maydell
                   ` (4 subsequent siblings)
  15 siblings, 1 reply; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 qobject/json-lexer.c    | 2 +-
 qobject/json-parser.c   | 2 +-
 qobject/json-streamer.c | 1 +
 qobject/qbool.c         | 1 +
 qobject/qdict.c         | 1 +
 qobject/qfloat.c        | 1 +
 qobject/qint.c          | 1 +
 qobject/qjson.c         | 1 +
 qobject/qlist.c         | 1 +
 qobject/qnull.c         | 1 +
 qobject/qobject.c       | 1 +
 qobject/qstring.c       | 1 +
 12 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/qobject/json-lexer.c b/qobject/json-lexer.c
index 92798ae..496374d9 100644
--- a/qobject/json-lexer.c
+++ b/qobject/json-lexer.c
@@ -11,9 +11,9 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/qmp/json-lexer.h"
-#include <stdint.h>
 
 #define MAX_TOKEN_SIZE (64ULL << 20)
 
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index 3c5d35d..77c9382 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -11,7 +11,7 @@
  *
  */
 
-#include <stdarg.h>
+#include "qemu/osdep.h"
 
 #include "qemu-common.h"
 #include "qapi/qmp/qstring.h"
diff --git a/qobject/json-streamer.c b/qobject/json-streamer.c
index a4db4b8..0251685 100644
--- a/qobject/json-streamer.c
+++ b/qobject/json-streamer.c
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/qmp/json-lexer.h"
 #include "qapi/qmp/json-streamer.h"
diff --git a/qobject/qbool.c b/qobject/qbool.c
index 856c743..0606bbd 100644
--- a/qobject/qbool.c
+++ b/qobject/qbool.c
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qapi/qmp/qbool.h"
 #include "qapi/qmp/qobject.h"
 #include "qemu-common.h"
diff --git a/qobject/qdict.c b/qobject/qdict.c
index 19df837..9833bd0 100644
--- a/qobject/qdict.c
+++ b/qobject/qdict.c
@@ -10,6 +10,7 @@
  * See the COPYING.LIB file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qapi/qmp/qint.h"
 #include "qapi/qmp/qfloat.h"
 #include "qapi/qmp/qdict.h"
diff --git a/qobject/qfloat.c b/qobject/qfloat.c
index 87d89a7..d5da847 100644
--- a/qobject/qfloat.c
+++ b/qobject/qfloat.c
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qapi/qmp/qfloat.h"
 #include "qapi/qmp/qobject.h"
 #include "qemu-common.h"
diff --git a/qobject/qint.c b/qobject/qint.c
index 7cba9ad..d7d1b30 100644
--- a/qobject/qint.c
+++ b/qobject/qint.c
@@ -10,6 +10,7 @@
  * See the COPYING.LIB file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qapi/qmp/qint.h"
 #include "qapi/qmp/qobject.h"
 #include "qemu-common.h"
diff --git a/qobject/qjson.c b/qobject/qjson.c
index a3e6a7c..b8cc4ca 100644
--- a/qobject/qjson.c
+++ b/qobject/qjson.c
@@ -11,6 +11,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "qapi/qmp/json-lexer.h"
 #include "qapi/qmp/json-parser.h"
 #include "qapi/qmp/json-streamer.h"
diff --git a/qobject/qlist.c b/qobject/qlist.c
index 3c045ae..1ec74de 100644
--- a/qobject/qlist.c
+++ b/qobject/qlist.c
@@ -10,6 +10,7 @@
  * See the COPYING.LIB file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qapi/qmp/qlist.h"
 #include "qapi/qmp/qobject.h"
 #include "qemu/queue.h"
diff --git a/qobject/qnull.c b/qobject/qnull.c
index 5f7ba4d..c124d05 100644
--- a/qobject/qnull.c
+++ b/qobject/qnull.c
@@ -10,6 +10,7 @@
  * or later.  See the COPYING.LIB file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/qmp/qobject.h"
 
diff --git a/qobject/qobject.c b/qobject/qobject.c
index a3ef14e..cd41fb9 100644
--- a/qobject/qobject.c
+++ b/qobject/qobject.c
@@ -7,6 +7,7 @@
  * or later.  See the COPYING.LIB file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qapi/qmp/qbool.h"
 #include "qapi/qmp/qdict.h"
diff --git a/qobject/qstring.c b/qobject/qstring.c
index f44c5c4..5da7b5f 100644
--- a/qobject/qstring.c
+++ b/qobject/qstring.c
@@ -10,6 +10,7 @@
  * See the COPYING.LIB file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qapi/qmp/qobject.h"
 #include "qapi/qmp/qstring.h"
 #include "qemu-common.h"
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 12/15] qom: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
                   ` (10 preceding siblings ...)
  2016-01-29 17:50 ` [Qemu-devel] [PATCH 11/15] qobject: " Peter Maydell
@ 2016-01-29 17:50 ` Peter Maydell
  2016-01-29 17:50 ` [Qemu-devel] [PATCH 13/15] io: " Peter Maydell
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 qom/container.c         | 2 +-
 qom/object.c            | 1 +
 qom/object_interfaces.c | 1 +
 qom/qom-qobject.c       | 1 +
 4 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/qom/container.c b/qom/container.c
index 62b1648..c9eb49b 100644
--- a/qom/container.c
+++ b/qom/container.c
@@ -10,9 +10,9 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qom/object.h"
 #include "qemu/module.h"
-#include <assert.h>
 
 static const TypeInfo container_info = {
     .name          = "container",
diff --git a/qom/object.c b/qom/object.c
index 5ff97ab..5904081 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -10,6 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qom/object.h"
 #include "qom/object_interfaces.h"
 #include "qemu-common.h"
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index a66cd60..f1218f0 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
 #include "qom/object_interfaces.h"
 #include "qemu/module.h"
 
diff --git a/qom/qom-qobject.c b/qom/qom-qobject.c
index 9649890..9cbc4c6 100644
--- a/qom/qom-qobject.c
+++ b/qom/qom-qobject.c
@@ -9,6 +9,7 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qom/object.h"
 #include "qom/qom-qobject.h"
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 13/15] io: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
                   ` (11 preceding siblings ...)
  2016-01-29 17:50 ` [Qemu-devel] [PATCH 12/15] qom: " Peter Maydell
@ 2016-01-29 17:50 ` Peter Maydell
  2016-01-29 17:50 ` [Qemu-devel] [PATCH 14/15] contrib: " Peter Maydell
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 io/channel-buffer.c  | 1 +
 io/channel-command.c | 1 +
 io/channel-file.c    | 1 +
 io/channel-socket.c  | 1 +
 io/channel-tls.c     | 1 +
 io/channel-watch.c   | 1 +
 io/channel-websock.c | 1 +
 io/channel.c         | 1 +
 io/task.c            | 1 +
 9 files changed, 9 insertions(+)

diff --git a/io/channel-buffer.c b/io/channel-buffer.c
index daebc92..0f7c567 100644
--- a/io/channel-buffer.c
+++ b/io/channel-buffer.c
@@ -18,6 +18,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "io/channel-buffer.h"
 #include "io/channel-watch.h"
 #include "qemu/sockets.h"
diff --git a/io/channel-command.c b/io/channel-command.c
index a9c67aa..f53ce0f 100644
--- a/io/channel-command.c
+++ b/io/channel-command.c
@@ -18,6 +18,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "io/channel-command.h"
 #include "io/channel-watch.h"
 #include "qemu/sockets.h"
diff --git a/io/channel-file.c b/io/channel-file.c
index 1360900..19a4325 100644
--- a/io/channel-file.c
+++ b/io/channel-file.c
@@ -18,6 +18,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "io/channel-file.h"
 #include "io/channel-watch.h"
 #include "qemu/sockets.h"
diff --git a/io/channel-socket.c b/io/channel-socket.c
index bc117b1..22d2fd6 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -18,6 +18,7 @@
  *
  */
 
+#include "qemu/osdep.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 8ac4f76..7608fd9 100644
--- a/io/channel-tls.c
+++ b/io/channel-tls.c
@@ -18,6 +18,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "io/channel-tls.h"
 #include "trace.h"
 
diff --git a/io/channel-watch.c b/io/channel-watch.c
index 2f745f1..931fa4d 100644
--- a/io/channel-watch.c
+++ b/io/channel-watch.c
@@ -18,6 +18,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "io/channel-watch.h"
 
 typedef struct QIOChannelFDSource QIOChannelFDSource;
diff --git a/io/channel-websock.c b/io/channel-websock.c
index 9273a8b..35860a2 100644
--- a/io/channel-websock.c
+++ b/io/channel-websock.c
@@ -18,6 +18,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "io/channel-websock.h"
 #include "crypto/hash.h"
 #include "trace.h"
diff --git a/io/channel.c b/io/channel.c
index 5e94469..3fc09f8 100644
--- a/io/channel.c
+++ b/io/channel.c
@@ -18,6 +18,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "io/channel.h"
 #include "qemu/coroutine.h"
 
diff --git a/io/task.c b/io/task.c
index 3127fca..bf1a333 100644
--- a/io/task.c
+++ b/io/task.c
@@ -18,6 +18,7 @@
  *
  */
 
+#include "qemu/osdep.h"
 #include "io/task.h"
 #include "qemu/thread.h"
 #include "trace.h"
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 14/15] contrib: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
                   ` (12 preceding siblings ...)
  2016-01-29 17:50 ` [Qemu-devel] [PATCH 13/15] io: " Peter Maydell
@ 2016-01-29 17:50 ` Peter Maydell
  2016-01-29 17:50 ` [Qemu-devel] [PATCH 15/15] all: " Peter Maydell
  2016-02-04 18:23 ` [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
  15 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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>
---
 contrib/ivshmem-client/ivshmem-client.c | 2 +-
 contrib/ivshmem-client/main.c           | 1 +
 contrib/ivshmem-server/ivshmem-server.c | 2 +-
 contrib/ivshmem-server/main.c           | 1 +
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/contrib/ivshmem-client/ivshmem-client.c b/contrib/ivshmem-client/ivshmem-client.c
index 31619d8..44ae364 100644
--- a/contrib/ivshmem-client/ivshmem-client.c
+++ b/contrib/ivshmem-client/ivshmem-client.c
@@ -6,7 +6,7 @@
  * top-level directory.
  */
 
-#include <sys/types.h>
+#include "qemu/osdep.h"
 #include <sys/socket.h>
 #include <sys/un.h>
 
diff --git a/contrib/ivshmem-client/main.c b/contrib/ivshmem-client/main.c
index c004870..33ae1da 100644
--- a/contrib/ivshmem-client/main.c
+++ b/contrib/ivshmem-client/main.c
@@ -6,6 +6,7 @@
  * top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 #include "ivshmem-client.h"
diff --git a/contrib/ivshmem-server/ivshmem-server.c b/contrib/ivshmem-server/ivshmem-server.c
index d9e26b0..bfd0fad 100644
--- a/contrib/ivshmem-server/ivshmem-server.c
+++ b/contrib/ivshmem-server/ivshmem-server.c
@@ -5,11 +5,11 @@
  * (at your option) any later version.  See the COPYING file in the
  * top-level directory.
  */
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/sockets.h"
 
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #ifdef CONFIG_LINUX
diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c
index 9b0d6e2..cca1061 100644
--- a/contrib/ivshmem-server/main.c
+++ b/contrib/ivshmem-server/main.c
@@ -6,6 +6,7 @@
  * top-level directory.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 
 #include "ivshmem-server.h"
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [Qemu-devel] [PATCH 15/15] all: Clean up includes
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
                   ` (13 preceding siblings ...)
  2016-01-29 17:50 ` [Qemu-devel] [PATCH 14/15] contrib: " Peter Maydell
@ 2016-01-29 17:50 ` Peter Maydell
  2016-02-04 18:23 ` [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
  15 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-01-29 17:50 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

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 --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"
-- 
1.9.1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] [PATCH 07/15] qapi: Clean up includes
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 07/15] qapi: " Peter Maydell
@ 2016-01-29 18:31   ` Eric Blake
  2016-02-08 12:30     ` Peter Maydell
  0 siblings, 1 reply; 22+ messages in thread
From: Eric Blake @ 2016-01-29 18:31 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: patches

[-- Attachment #1: Type: text/plain, Size: 1096 bytes --]

On 01/29/2016 10:49 AM, Peter Maydell wrote:
> 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>
> ---
>  qapi/opts-visitor.c          | 1 +
>  qapi/qapi-dealloc-visitor.c  | 1 +
>  qapi/qapi-util.c             | 2 +-
>  qapi/qapi-visit-core.c       | 1 +
>  qapi/qmp-dispatch.c          | 2 +-
>  qapi/qmp-event.c             | 2 +-
>  qapi/qmp-input-visitor.c     | 1 +
>  qapi/qmp-output-visitor.c    | 1 +
>  qapi/qmp-registry.c          | 2 +-
>  qapi/string-input-visitor.c  | 1 +
>  qapi/string-output-visitor.c | 1 +
>  11 files changed, 11 insertions(+), 4 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

Hmm - we also have generated qapi files, where the scripts/qapi*.py
files will need to output correct header information.  I'll take a look
at doing that.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] [PATCH 11/15] qobject: Clean up includes
  2016-01-29 17:50 ` [Qemu-devel] [PATCH 11/15] qobject: " Peter Maydell
@ 2016-01-29 18:35   ` Eric Blake
  0 siblings, 0 replies; 22+ messages in thread
From: Eric Blake @ 2016-01-29 18:35 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: patches

[-- Attachment #1: Type: text/plain, Size: 913 bytes --]

On 01/29/2016 10:50 AM, Peter Maydell wrote:
> 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>
> ---
>  qobject/json-lexer.c    | 2 +-
>  qobject/json-parser.c   | 2 +-
>  qobject/json-streamer.c | 1 +
>  qobject/qbool.c         | 1 +
>  qobject/qdict.c         | 1 +
>  qobject/qfloat.c        | 1 +
>  qobject/qint.c          | 1 +
>  qobject/qjson.c         | 1 +
>  qobject/qlist.c         | 1 +
>  qobject/qnull.c         | 1 +
>  qobject/qobject.c       | 1 +
>  qobject/qstring.c       | 1 +
>  12 files changed, 12 insertions(+), 2 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] [PATCH 05/15] util: Clean up includes
  2016-01-29 17:49 ` [Qemu-devel] [PATCH 05/15] util: " Peter Maydell
@ 2016-02-04 17:38   ` Peter Maydell
  0 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-02-04 17:38 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Patch Tracking

On 29 January 2016 at 17:49, Peter Maydell <peter.maydell@linaro.org> wrote:
> 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>
> diff --git a/util/oslib-posix.c b/util/oslib-posix.c
> index d25f671..b2b5e12 100644
> --- a/util/oslib-posix.c
> +++ b/util/oslib-posix.c
> @@ -30,7 +30,6 @@
>     compiler does not see the warning associated with it in stdlib.h on OSX */
>  #ifdef __APPLE__
>  #define daemon qemu_fake_daemon_function
> -#include <stdlib.h>
>  #undef daemon
>  extern int daemon(int, int);
>  #endif
> @@ -47,13 +46,12 @@ extern int daemon(int, int);
>  #  define QEMU_VMALLOC_ALIGN getpagesize()
>  #endif
>
> +#include "qemu/osdep.h"
>  #include <termios.h>
> -#include <unistd.h>
>  #include <termios.h>
>
>  #include <glib/gprintf.h>
>
> -#include "config-host.h"
>  #include "sysemu/sysemu.h"
>  #include "trace.h"
>  #include "qemu/sockets.h"

This bit isn't quite right, because it breaks the "suppress the OSX
warning about daemon()". I'm going to drop this hunk but otherwise apply.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] [PATCH 00/15] clean includes, part 2
  2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
                   ` (14 preceding siblings ...)
  2016-01-29 17:50 ` [Qemu-devel] [PATCH 15/15] all: " Peter Maydell
@ 2016-02-04 18:23 ` Peter Maydell
  15 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2016-02-04 18:23 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Patch Tracking

On 29 January 2016 at 17:49, Peter Maydell <peter.maydell@linaro.org> wrote:
> This patchset runs clean-includes on a bunch more files.
> With this (plus one or two patches I sent earlier) every
> file in the tree except for those in tests/ has been
> updated. (I skipped tests/ for now because at least some
> of the files in tests/tcg seem to be totally standalone.
> I'll look at those next week but I thought I'd send out
> this set first.)
>
> One or two files might have slipped through the net if
> they were newly added since I did the scan; we can pick
> those up later though.

Applied to master with tweak to oslib-posix.c as indicated.
(We probably want to move the fixup for daemon() to osdep.h;
I'll send a patch for that.)

thanks
-- PMM

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] [PATCH 07/15] qapi: Clean up includes
  2016-01-29 18:31   ` Eric Blake
@ 2016-02-08 12:30     ` Peter Maydell
  2016-02-08 15:38       ` Eric Blake
  0 siblings, 1 reply; 22+ messages in thread
From: Peter Maydell @ 2016-02-08 12:30 UTC (permalink / raw)
  To: Eric Blake; +Cc: QEMU Developers, Patch Tracking

On 29 January 2016 at 18:31, Eric Blake <eblake@redhat.com> wrote:
> Hmm - we also have generated qapi files, where the scripts/qapi*.py
> files will need to output correct header information.  I'll take a look
> at doing that.

Hi Eric; did you get time to look at updating these scripts? I
started working on the "remove unnecessary #includes from .h files"
part of this cleanup, but at the moment that causes all the generated
qapi .c files to fail to build because they don't include osdep.h yet.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Qemu-devel] [PATCH 07/15] qapi: Clean up includes
  2016-02-08 12:30     ` Peter Maydell
@ 2016-02-08 15:38       ` Eric Blake
  0 siblings, 0 replies; 22+ messages in thread
From: Eric Blake @ 2016-02-08 15:38 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers, Patch Tracking

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

On 02/08/2016 05:30 AM, Peter Maydell wrote:
> On 29 January 2016 at 18:31, Eric Blake <eblake@redhat.com> wrote:
>> Hmm - we also have generated qapi files, where the scripts/qapi*.py
>> files will need to output correct header information.  I'll take a look
>> at doing that.
> 
> Hi Eric; did you get time to look at updating these scripts? I
> started working on the "remove unnecessary #includes from .h files"
> part of this cleanup, but at the moment that causes all the generated
> qapi .c files to fail to build because they don't include osdep.h yet.

Sent now, but I based it on Markus' qapi-next tree. I didn't test if it
would apply directly to master.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-02-08 15:38 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-29 17:49 [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell
2016-01-29 17:49 ` [Qemu-devel] [PATCH 01/15] ui: Clean up includes Peter Maydell
2016-01-29 17:49 ` [Qemu-devel] [PATCH 02/15] stubs: " Peter Maydell
2016-01-29 17:49 ` [Qemu-devel] [PATCH 03/15] bsd-user: " Peter Maydell
2016-01-29 17:49 ` [Qemu-devel] [PATCH 04/15] backends: " Peter Maydell
2016-01-29 17:49 ` [Qemu-devel] [PATCH 05/15] util: " Peter Maydell
2016-02-04 17:38   ` Peter Maydell
2016-01-29 17:49 ` [Qemu-devel] [PATCH 06/15] disas: " Peter Maydell
2016-01-29 17:49 ` [Qemu-devel] [PATCH 07/15] qapi: " Peter Maydell
2016-01-29 18:31   ` Eric Blake
2016-02-08 12:30     ` Peter Maydell
2016-02-08 15:38       ` Eric Blake
2016-01-29 17:49 ` [Qemu-devel] [PATCH 08/15] qga: " Peter Maydell
2016-01-29 17:49 ` [Qemu-devel] [PATCH 09/15] slirp: " Peter Maydell
2016-01-29 17:50 ` [Qemu-devel] [PATCH 10/15] net: " Peter Maydell
2016-01-29 17:50 ` [Qemu-devel] [PATCH 11/15] qobject: " Peter Maydell
2016-01-29 18:35   ` Eric Blake
2016-01-29 17:50 ` [Qemu-devel] [PATCH 12/15] qom: " Peter Maydell
2016-01-29 17:50 ` [Qemu-devel] [PATCH 13/15] io: " Peter Maydell
2016-01-29 17:50 ` [Qemu-devel] [PATCH 14/15] contrib: " Peter Maydell
2016-01-29 17:50 ` [Qemu-devel] [PATCH 15/15] all: " Peter Maydell
2016-02-04 18:23 ` [Qemu-devel] [PATCH 00/15] clean includes, part 2 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).