All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h
@ 2016-03-15 15:03 Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 01/15] include/qemu/osdep.h: Don't include qapi/error.h Markus Armbruster
                   ` (15 more replies)
  0 siblings, 16 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

This series tackles two issues:

* qapi/error.h and therefore qapi-types.h get included into every file
  via qemu/osdep.h.  Touch the QAPI schema, recompile the world.  As
  the QAPI maintainer, I get to touch it regularly, so this is an itch
  I need to scratch.  PATCH 01-04 drop qapi/error.h from qemu/osdep.h.
  Unfortunately, the number of .o depending on qapi-types.h barely
  changes, because it gets included by so many other headers.  More
  work is needed here.

* qemu-common.h explicitly asks not to be included in headers, but we
  do it anyway.  PATCH 05-15 clean that up.  Cuts the number of .o
  depending on qemu-common.h from ~95% to ~35%.

For additional motivation, see the "Our use of #include is
undisciplined, and what to do about it" thread.

Markus Armbruster (15):
  include/qemu/osdep.h: Don't include qapi/error.h
  Use scripts/clean-includes to drop redundant qemu/typedefs.h
  include/config.h: Unused, remove
  Clean up includes some more
  fw_cfg: Split fw_cfg_keys.h off fw_cfg.h
  include/qemu/iov.h: Don't include qemu-common.h
  include/hw/hw.h: Don't include qemu-common.h
  hw/pci/pci.h: Don't include qemu-common.h
  Move HOST_LONG_BITS from qemu-common.h to qemu/osdep.h
  Move QEMU_ALIGN_*() from qemu-common.h to qemu/osdep.h
  Move ParallelIOArg from qemu-common.h to sysemu/char.h
  isa: Move DMA_transfer_handler from qemu-common.h to hw/isa/isa.h
  include/crypto: Include qapi-types.h instead of qemu-common.h
  Don't include qemu-common.h in headers
  Drop superfluous qemu-common.h inclusions

 aio-posix.c                              |  1 -
 aio-win32.c                              |  1 -
 arch_init.c                              |  2 +
 async.c                                  |  2 +-
 audio/alsaaudio.c                        |  1 -
 audio/audio.c                            |  2 +
 audio/audio_pt_int.c                     |  1 -
 audio/audio_win_int.c                    |  1 -
 audio/coreaudio.c                        |  1 -
 audio/dsoundaudio.c                      |  1 -
 audio/noaudio.c                          |  1 -
 audio/ossaudio.c                         |  1 -
 audio/paaudio.c                          |  1 -
 audio/sdlaudio.c                         |  1 -
 backends/baum.c                          |  2 +-
 backends/hostmem-file.c                  |  1 +
 backends/hostmem-ram.c                   |  3 ++
 backends/hostmem.c                       |  1 +
 backends/rng-egd.c                       |  1 +
 backends/rng-random.c                    |  2 +
 backends/rng.c                           |  2 +
 backends/tpm.c                           |  2 +
 block/archipelago.c                      |  1 -
 block/backup.c                           |  3 +-
 block/blkdebug.c                         |  1 +
 block/blkverify.c                        |  2 +
 block/block-backend.c                    |  1 +
 block/bochs.c                            |  2 +-
 block/cloop.c                            |  2 +-
 block/commit.c                           |  1 +
 block/curl.c                             |  1 +
 block/dmg.c                              |  2 +-
 block/gluster.c                          |  3 ++
 block/io.c                               |  2 +
 block/linux-aio.c                        |  1 -
 block/mirror.c                           |  1 +
 block/nbd-client.h                       |  1 -
 block/nbd.c                              |  2 +
 block/nfs.c                              |  1 -
 block/null.c                             |  2 +
 block/parallels.c                        |  2 +-
 block/qapi.c                             |  1 +
 block/qcow.c                             |  2 +-
 block/qcow2-cache.c                      |  1 -
 block/qcow2-cluster.c                    |  2 +-
 block/qcow2-refcount.c                   |  2 +-
 block/qcow2-snapshot.c                   |  1 +
 block/qed.c                              |  2 +
 block/quorum.c                           |  1 +
 block/raw-aio.h                          |  2 +
 block/raw-posix.c                        |  1 +
 block/raw-win32.c                        |  1 -
 block/raw_bsd.c                          |  2 +
 block/rbd.c                              |  1 +
 block/sheepdog.c                         |  1 +
 block/snapshot.c                         |  1 +
 block/ssh.c                              |  4 +-
 block/stream.c                           |  1 +
 block/throttle-groups.c                  |  1 +
 block/vdi.c                              |  1 +
 block/vhdx-endian.c                      |  1 -
 block/vhdx-log.c                         |  2 +-
 block/vhdx.c                             |  2 +-
 block/vmdk.c                             |  1 +
 block/vpc.c                              |  2 +-
 block/vvfat.c                            |  1 +
 block/win32-aio.c                        |  1 -
 blockdev.c                               |  1 +
 blockjob.c                               |  1 -
 bootdevice.c                             |  1 +
 bsd-user/main.c                          |  1 -
 bsd-user/mmap.c                          |  1 -
 bsd-user/syscall.c                       |  1 -
 bt-vhci.c                                |  1 -
 contrib/ivshmem-client/ivshmem-client.c  |  1 -
 contrib/ivshmem-client/main.c            |  1 -
 contrib/ivshmem-server/main.c            |  1 +
 cpu-exec.c                               |  1 +
 cpus.c                                   |  3 +-
 cputlb.c                                 |  1 +
 crypto/aes.c                             |  1 -
 crypto/cipher.c                          |  1 +
 crypto/hash.c                            |  1 +
 crypto/init.c                            |  1 +
 crypto/secret.c                          |  2 +
 crypto/tlscreds.c                        |  2 +
 crypto/tlscredsanon.c                    |  2 +
 crypto/tlscredsx509.c                    |  2 +
 crypto/tlssession.c                      |  1 +
 device_tree.c                            |  2 +-
 disas.c                                  |  1 -
 disas/cris.c                             |  1 -
 disas/s390.c                             |  1 -
 disas/tci.c                              |  1 -
 exec.c                                   |  1 +
 fsdev/qemu-fsdev.c                       |  1 -
 fsdev/virtfs-proxy-helper.c              |  1 -
 gdbstub.c                                |  1 +
 hmp.c                                    |  1 +
 hmp.h                                    |  1 -
 hw/9pfs/9p-handle.c                      |  1 +
 hw/9pfs/9p-local.c                       |  1 +
 hw/9pfs/9p-proxy.c                       |  1 +
 hw/9pfs/9p-synth.c                       |  1 +
 hw/9pfs/9p.c                             |  1 +
 hw/9pfs/coth.c                           |  1 -
 hw/acpi/bios-linker-loader.c             |  1 -
 hw/acpi/cpu_hotplug.c                    |  1 +
 hw/acpi/ich9.c                           |  1 +
 hw/acpi/pcihp.c                          |  1 +
 hw/acpi/piix4.c                          |  1 +
 hw/acpi/tco.c                            |  1 -
 hw/alpha/dp264.c                         |  1 +
 hw/alpha/typhoon.c                       |  1 +
 hw/arm/allwinner-a10.c                   |  1 +
 hw/arm/armv7m.c                          |  1 +
 hw/arm/bcm2835_peripherals.c             |  1 +
 hw/arm/bcm2836.c                         |  1 +
 hw/arm/boot.c                            |  2 +
 hw/arm/cubieboard.c                      |  1 +
 hw/arm/digic.c                           |  1 +
 hw/arm/digic_boards.c                    |  2 +
 hw/arm/exynos4210.c                      |  1 +
 hw/arm/fsl-imx25.c                       |  1 +
 hw/arm/fsl-imx31.c                       |  1 +
 hw/arm/highbank.c                        |  2 +
 hw/arm/imx25_pdk.c                       |  1 +
 hw/arm/integratorcp.c                    |  1 +
 hw/arm/kzm.c                             |  1 +
 hw/arm/mainstone.c                       |  1 +
 hw/arm/musicpal.c                        |  1 +
 hw/arm/netduino2.c                       |  1 +
 hw/arm/nseries.c                         |  1 +
 hw/arm/omap1.c                           |  2 +
 hw/arm/omap2.c                           |  1 +
 hw/arm/omap_sx1.c                        |  1 +
 hw/arm/palm.c                            |  1 +
 hw/arm/pxa2xx.c                          |  2 +
 hw/arm/raspi.c                           |  1 +
 hw/arm/realview.c                        |  1 +
 hw/arm/spitz.c                           |  1 +
 hw/arm/stellaris.c                       |  1 +
 hw/arm/stm32f205_soc.c                   |  1 +
 hw/arm/strongarm.c                       |  1 +
 hw/arm/sysbus-fdt.c                      |  2 +-
 hw/arm/tosa.c                            |  1 +
 hw/arm/versatilepb.c                     |  1 +
 hw/arm/vexpress.c                        |  2 +
 hw/arm/virt-acpi-build.c                 |  1 +
 hw/arm/virt.c                            |  2 +
 hw/arm/xilinx_zynq.c                     |  1 +
 hw/arm/xlnx-ep108.c                      |  1 +
 hw/arm/xlnx-zynqmp.c                     |  1 +
 hw/audio/adlib.c                         |  1 +
 hw/audio/gus.c                           |  1 +
 hw/block/block.c                         |  1 +
 hw/block/cdrom.c                         |  1 -
 hw/block/dataplane/virtio-blk.c          |  1 +
 hw/block/fdc.c                           |  1 +
 hw/block/nand.c                          |  1 +
 hw/block/nvme.c                          |  2 +
 hw/block/onenand.c                       |  2 +-
 hw/block/pflash_cfi01.c                  |  1 +
 hw/block/pflash_cfi02.c                  |  1 +
 hw/block/virtio-blk.c                    |  2 +-
 hw/block/xen_disk.c                      |  1 +
 hw/bt/core.c                             |  1 -
 hw/bt/hci-csr.c                          |  1 -
 hw/bt/hci.c                              |  1 +
 hw/bt/hid.c                              |  1 -
 hw/bt/l2cap.c                            |  1 -
 hw/char/debugcon.c                       |  1 +
 hw/char/parallel.c                       |  1 +
 hw/char/serial-isa.c                     |  1 +
 hw/char/serial-pci.c                     |  1 +
 hw/char/serial.c                         |  1 +
 hw/char/spapr_vty.c                      |  1 +
 hw/char/virtio-serial-bus.c              |  1 +
 hw/core/fw-path-provider.c               |  1 +
 hw/core/loader.c                         |  2 +
 hw/core/machine.c                        |  2 +
 hw/core/nmi.c                            |  2 +
 hw/core/null-machine.c                   |  1 -
 hw/core/ptimer.c                         |  2 +
 hw/core/qdev-properties-system.c         |  1 +
 hw/core/qdev-properties.c                |  3 ++
 hw/core/qdev.c                           |  1 +
 hw/core/stream.c                         |  1 +
 hw/cpu/a15mpcore.c                       |  1 +
 hw/cpu/a9mpcore.c                        |  1 +
 hw/cpu/arm11mpcore.c                     |  1 +
 hw/cpu/realview_mpcore.c                 |  1 +
 hw/cris/axis_dev88.c                     |  1 +
 hw/display/blizzard.c                    |  1 -
 hw/display/cg3.c                         |  1 +
 hw/display/cirrus_vga.c                  |  1 +
 hw/display/exynos4210_fimd.c             |  1 -
 hw/display/jazz_led.c                    |  1 -
 hw/display/qxl.c                         |  1 -
 hw/display/qxl.h                         |  2 -
 hw/display/sm501.c                       |  1 +
 hw/display/tc6393xb.c                    |  1 +
 hw/display/tcx.c                         |  1 +
 hw/display/vga.c                         |  1 +
 hw/display/virtio-gpu-3d.c               |  1 -
 hw/display/virtio-gpu.c                  |  1 -
 hw/display/vmware_vga.c                  |  1 +
 hw/dma/etraxfs_dma.c                     |  1 -
 hw/dma/i8257.c                           |  2 +-
 hw/dma/omap_dma.c                        |  1 -
 hw/dma/pl330.c                           |  2 +
 hw/dma/soc_dma.c                         |  1 -
 hw/dma/xilinx_axidma.c                   |  1 +
 hw/i386/acpi-build.c                     |  2 +-
 hw/i386/acpi-build.h                     |  2 -
 hw/i386/kvm/clock.c                      |  1 -
 hw/i386/kvm/i8254.c                      |  1 +
 hw/i386/kvm/pci-assign.c                 |  1 +
 hw/i386/pc.c                             |  2 +
 hw/i386/pc_sysfw.c                       |  2 +
 hw/i386/pci-assign-load-rom.c            |  1 +
 hw/i386/xen/xen_platform.c               |  1 +
 hw/i386/xen/xen_pvdevice.c               |  1 +
 hw/ide/core.c                            |  1 +
 hw/ide/qdev.c                            |  1 +
 hw/input/milkymist-softusb.c             |  1 +
 hw/input/virtio-input-host.c             |  2 +-
 hw/input/virtio-input.c                  |  1 +
 hw/intc/apic_common.c                    |  1 +
 hw/intc/arm_gic.c                        |  1 +
 hw/intc/arm_gic_common.c                 |  1 +
 hw/intc/arm_gicv2m.c                     |  1 +
 hw/intc/arm_gicv3_common.c               |  1 +
 hw/intc/armv7m_nvic.c                    |  1 +
 hw/intc/exynos4210_gic.c                 |  1 -
 hw/intc/ioapic_common.c                  |  1 +
 hw/intc/openpic.c                        |  1 +
 hw/intc/realview_gic.c                   |  1 +
 hw/intc/xics.c                           |  1 +
 hw/ipack/ipack.c                         |  1 +
 hw/ipmi/ipmi_bmc_extern.c                |  1 +
 hw/ipmi/isa_ipmi_bt.c                    |  1 +
 hw/ipmi/isa_ipmi_kcs.c                   |  1 +
 hw/isa/isa-bus.c                         |  1 +
 hw/isa/lpc_ich9.c                        |  1 -
 hw/isa/pc87312.c                         |  1 +
 hw/lm32/lm32_boards.c                    |  1 +
 hw/lm32/lm32_hwsetup.h                   |  1 -
 hw/lm32/milkymist.c                      |  1 +
 hw/m68k/an5206.c                         |  1 +
 hw/m68k/mcf5208.c                        |  1 +
 hw/mem/pc-dimm.c                         |  1 +
 hw/microblaze/petalogix_ml605_mmu.c      |  1 +
 hw/microblaze/petalogix_s3adsp1800_mmu.c |  1 +
 hw/mips/mips_fulong2e.c                  |  2 +
 hw/mips/mips_jazz.c                      |  1 +
 hw/mips/mips_malta.c                     |  1 +
 hw/mips/mips_mipssim.c                   |  3 ++
 hw/mips/mips_r4k.c                       |  3 ++
 hw/misc/bcm2835_mbox.c                   |  1 +
 hw/misc/bcm2835_property.c               |  1 +
 hw/misc/cbus.c                           |  2 +-
 hw/misc/ivshmem.c                        |  3 ++
 hw/misc/macio/cuda.c                     |  1 +
 hw/misc/macio/macio.c                    |  1 +
 hw/misc/tmp105.c                         |  1 +
 hw/moxie/moxiesim.c                      |  1 +
 hw/net/dp8393x.c                         |  1 +
 hw/net/milkymist-minimac2.c              |  1 +
 hw/net/ne2000-isa.c                      |  1 +
 hw/net/rocker/qmp-norocker.c             |  1 -
 hw/net/vmxnet3.c                         |  1 -
 hw/net/vmxnet_rx_pkt.c                   |  1 -
 hw/net/vmxnet_rx_pkt.h                   |  2 -
 hw/net/vmxnet_tx_pkt.c                   |  1 -
 hw/net/vmxnet_tx_pkt.h                   |  2 -
 hw/net/xilinx_axienet.c                  |  1 +
 hw/nvram/fw_cfg.c                        |  1 +
 hw/nvram/mac_nvram.c                     |  2 +
 hw/nvram/spapr_nvram.c                   |  1 +
 hw/openrisc/openrisc_sim.c               |  1 +
 hw/pci-bridge/dec.h                      |  2 -
 hw/pci-bridge/pci_bridge_dev.c           |  1 +
 hw/pci-host/piix.c                       |  1 +
 hw/pci-host/prep.c                       |  2 +
 hw/pci-host/q35.c                        |  1 +
 hw/pci/pci.c                             |  2 +
 hw/pci/pcie.c                            |  2 +-
 hw/pci/shpc.c                            |  2 +-
 hw/pcmcia/pcmcia.c                       |  1 -
 hw/ppc/e500.c                            |  1 +
 hw/ppc/e500plat.c                        |  1 -
 hw/ppc/mac_newworld.c                    |  3 ++
 hw/ppc/mac_oldworld.c                    |  3 ++
 hw/ppc/mpc8544ds.c                       |  1 -
 hw/ppc/ppc405_boards.c                   |  3 ++
 hw/ppc/ppc405_uc.c                       |  1 +
 hw/ppc/spapr.c                           |  1 +
 hw/ppc/spapr_drc.c                       |  2 +
 hw/ppc/spapr_events.c                    |  3 ++
 hw/ppc/spapr_hcall.c                     |  1 +
 hw/ppc/spapr_pci.c                       |  1 +
 hw/ppc/spapr_pci_vfio.c                  |  1 +
 hw/ppc/spapr_rng.c                       |  1 +
 hw/ppc/spapr_rtas.c                      |  2 +
 hw/ppc/spapr_rtc.c                       |  2 +
 hw/ppc/spapr_vio.c                       |  1 +
 hw/ppc/virtex_ml507.c                    |  1 +
 hw/s390x/event-facility.c                |  1 +
 hw/s390x/ipl.c                           |  2 +
 hw/s390x/s390-virtio-ccw.c               |  1 +
 hw/s390x/s390-virtio.c                   |  1 +
 hw/s390x/sclp.c                          |  1 +
 hw/s390x/virtio-ccw.c                    |  1 +
 hw/scsi/esp-pci.c                        |  1 +
 hw/scsi/esp.c                            |  1 +
 hw/scsi/megasas.c                        |  1 +
 hw/scsi/scsi-bus.c                       |  2 +
 hw/scsi/scsi-disk.c                      |  1 +
 hw/scsi/scsi-generic.c                   |  2 +-
 hw/scsi/vhost-scsi.c                     |  2 +
 hw/scsi/virtio-scsi-dataplane.c          |  1 -
 hw/scsi/virtio-scsi.c                    |  1 +
 hw/scsi/vmw_pvscsi.c                     |  1 +
 hw/sd/core.c                             |  1 +
 hw/sd/pxa2xx_mmci.c                      |  1 +
 hw/sd/sd.c                               |  1 +
 hw/sh4/r2d.c                             |  1 +
 hw/sh4/shix.c                            |  1 +
 hw/smbios/smbios.c                       |  2 +
 hw/sparc/leon3.c                         |  3 ++
 hw/sparc/sun4m.c                         |  3 ++
 hw/sparc64/sun4u.c                       |  3 ++
 hw/timer/a9gtimer.c                      |  1 +
 hw/timer/arm_mptimer.c                   |  1 +
 hw/timer/arm_timer.c                     |  1 -
 hw/timer/ds1338.c                        |  1 +
 hw/timer/exynos4210_mct.c                |  1 -
 hw/timer/exynos4210_pwm.c                |  1 -
 hw/timer/hpet.c                          |  1 +
 hw/timer/m48t59.c                        |  2 +
 hw/timer/mc146818rtc.c                   |  2 +
 hw/timer/pl031.c                         |  1 +
 hw/timer/twl92230.c                      |  1 +
 hw/tpm/tpm_passthrough.c                 |  1 -
 hw/tpm/tpm_tis.c                         |  2 +-
 hw/tpm/tpm_tis.h                         |  1 -
 hw/tricore/tricore_testboard.c           |  1 +
 hw/unicore32/puv3.c                      |  2 +-
 hw/usb/bus.c                             |  2 +
 hw/usb/ccid-card-passthru.c              |  1 +
 hw/usb/combined-packet.c                 |  1 -
 hw/usb/core.c                            |  1 -
 hw/usb/dev-audio.c                       |  1 -
 hw/usb/dev-bluetooth.c                   |  1 -
 hw/usb/dev-hid.c                         |  1 +
 hw/usb/dev-hub.c                         |  2 +-
 hw/usb/dev-mtp.c                         |  2 +-
 hw/usb/dev-network.c                     |  1 +
 hw/usb/dev-serial.c                      |  1 +
 hw/usb/dev-smartcard-reader.c            |  1 +
 hw/usb/dev-storage.c                     |  1 +
 hw/usb/dev-uas.c                         |  1 -
 hw/usb/hcd-ehci.c                        |  1 +
 hw/usb/hcd-musb.c                        |  1 -
 hw/usb/hcd-ohci.c                        |  1 +
 hw/usb/hcd-uhci.c                        |  1 +
 hw/usb/host-legacy.c                     |  1 -
 hw/usb/host-libusb.c                     |  2 +-
 hw/usb/host-stub.c                       |  1 -
 hw/usb/libhw.c                           |  1 -
 hw/usb/redirect.c                        |  1 +
 hw/usb/tusb6010.c                        |  1 -
 hw/vfio/pci.h                            |  1 -
 hw/vfio/platform.c                       |  1 +
 hw/virtio/vhost-user.c                   |  2 +
 hw/virtio/vhost.c                        |  1 +
 hw/virtio/virtio-balloon.c               |  1 -
 hw/virtio/virtio-pci.c                   |  1 +
 hw/virtio/virtio-rng.c                   |  1 +
 hw/virtio/virtio.c                       |  1 +
 hw/watchdog/wdt_i6300esb.c               |  1 -
 hw/watchdog/wdt_ib700.c                  |  1 -
 hw/xen/xen-host-pci-device.c             |  1 +
 hw/xen/xen_pt.c                          |  1 +
 hw/xen/xen_pt.h                          |  1 -
 hw/xen/xen_pt_config_init.c              |  1 +
 hw/xen/xen_pt_graphics.c                 |  1 +
 hw/xtensa/sim.c                          |  1 +
 hw/xtensa/xtfpga.c                       |  1 +
 include/block/accounting.h               |  2 -
 include/block/aio.h                      |  2 -
 include/block/block.h                    |  2 +-
 include/block/nbd.h                      |  2 -
 include/block/qapi.h                     |  1 +
 include/block/snapshot.h                 |  1 -
 include/block/write-threshold.h          |  4 --
 include/config.h                         |  1 -
 include/crypto/cipher.h                  |  2 +-
 include/crypto/hash.h                    |  2 +-
 include/crypto/init.h                    |  2 -
 include/crypto/secret.h                  |  1 -
 include/crypto/tlscreds.h                |  1 -
 include/disas/bfd.h                      |  2 +-
 include/disas/disas.h                    |  2 -
 include/exec/cpu-all.h                   |  1 -
 include/exec/cpu-common.h                |  1 -
 include/exec/exec-all.h                  |  2 -
 include/exec/ioport.h                    |  1 -
 include/exec/memory.h                    |  1 -
 include/hw/acpi/acpi.h                   |  1 -
 include/hw/acpi/pcihp.h                  |  1 -
 include/hw/acpi/piix4.h                  |  2 -
 include/hw/acpi/tco.h                    |  2 -
 include/hw/arm/allwinner-a10.h           |  1 -
 include/hw/arm/bcm2835_peripherals.h     |  1 -
 include/hw/arm/exynos4210.h              |  1 -
 include/hw/arm/omap.h                    |  1 +
 include/hw/arm/sysbus-fdt.h              |  1 -
 include/hw/arm/virt-acpi-build.h         |  1 -
 include/hw/arm/virt.h                    |  2 +-
 include/hw/arm/xlnx-zynqmp.h             |  1 -
 include/hw/block/block.h                 |  1 -
 include/hw/boards.h                      |  1 -
 include/hw/char/digic-uart.h             |  1 -
 include/hw/fw-path-provider.h            |  1 -
 include/hw/hotplug.h                     |  1 -
 include/hw/hw.h                          |  5 ++-
 include/hw/i386/apic.h                   |  2 +-
 include/hw/i386/pc.h                     |  2 -
 include/hw/ipmi/ipmi.h                   |  1 -
 include/hw/isa/apm.h                     |  1 -
 include/hw/isa/i8257.h                   |  2 +-
 include/hw/isa/isa.h                     |  5 ++-
 include/hw/lm32/lm32_pic.h               |  1 -
 include/hw/nmi.h                         |  1 -
 include/hw/nvram/fw_cfg.h                | 50 +------------------------
 include/hw/nvram/fw_cfg_keys.h           | 46 +++++++++++++++++++++++
 include/hw/pci-host/apb.h                |  1 -
 include/hw/pci-host/pam.h                |  1 -
 include/hw/pci/msi.h                     |  1 -
 include/hw/pci/msix.h                    |  1 -
 include/hw/pci/pci.h                     | 11 +++++-
 include/hw/pci/shpc.h                    |  1 -
 include/hw/pci/slotid_cap.h              |  1 -
 include/hw/ppc/mac_dbdma.h               |  1 +
 include/hw/ppc/openpic.h                 |  1 -
 include/hw/ptimer.h                      |  1 -
 include/hw/qdev-core.h                   |  1 -
 include/hw/scsi/scsi.h                   |  1 -
 include/hw/sd/sdhci.h                    |  1 -
 include/hw/sh4/sh_intc.h                 |  1 -
 include/hw/sparc/sun4m.h                 |  1 -
 include/hw/stream.h                      |  1 -
 include/hw/timer/digic-timer.h           |  1 -
 include/hw/timer/m48t59.h                |  1 -
 include/hw/usb.h                         |  1 +
 include/hw/vfio/vfio-common.h            |  1 -
 include/hw/vfio/vfio.h                   |  2 -
 include/hw/virtio/vhost-scsi.h           |  1 -
 include/hw/xen/xen.h                     |  2 -
 include/io/channel.h                     |  1 -
 include/io/task.h                        |  1 -
 include/migration/migration.h            |  1 -
 include/monitor/monitor.h                |  1 -
 include/monitor/qdev.h                   |  1 -
 include/net/filter.h                     |  2 -
 include/net/net.h                        |  1 -
 include/net/queue.h                      |  2 -
 include/net/slirp.h                      |  1 -
 include/net/tap.h                        |  1 -
 include/qapi/error.h                     |  5 ---
 include/qapi/qmp/json-parser.h           |  1 -
 include/qapi/visitor.h                   |  1 -
 include/qemu-common.h                    | 64 --------------------------------
 include/qemu-io.h                        |  2 -
 include/qemu/base64.h                    |  3 --
 include/qemu/bswap.h                     |  6 +--
 include/qemu/buffer.h                    |  2 -
 include/qemu/coroutine.h                 |  1 -
 include/qemu/crc32c.h                    |  2 -
 include/qemu/event_notifier.h            |  2 -
 include/qemu/iov.h                       | 30 ++++++++++++++-
 include/qemu/mmap-alloc.h                |  2 -
 include/qemu/option.h                    |  1 -
 include/qemu/osdep.h                     | 24 ++++++++++--
 include/qemu/range.h                     |  1 -
 include/qemu/throttle.h                  |  1 -
 include/qemu/timer.h                     |  2 -
 include/qemu/typedefs.h                  |  2 +
 include/qom/cpu.h                        |  1 -
 include/qom/object.h                     |  2 +-
 include/sysemu/accel.h                   |  1 -
 include/sysemu/block-backend.h           |  2 +-
 include/sysemu/char.h                    |  6 ++-
 include/sysemu/cpus.h                    |  2 +
 include/sysemu/kvm.h                     |  4 ++
 include/sysemu/memory_mapping.h          |  1 -
 include/sysemu/qtest.h                   |  2 -
 include/sysemu/replay.h                  |  1 -
 include/sysemu/rng.h                     |  1 -
 include/sysemu/sysemu.h                  |  1 -
 include/sysemu/tpm_backend.h             |  1 -
 include/ui/console.h                     |  1 -
 include/ui/qemu-pixman.h                 |  2 -
 include/ui/qemu-spice.h                  |  1 +
 io/channel-buffer.c                      |  1 +
 io/channel-command.c                     |  2 +
 io/channel-file.c                        |  2 +
 io/channel-socket.c                      |  2 +
 io/channel-tls.c                         |  2 +
 io/channel-util.c                        |  1 +
 io/channel-websock.c                     |  2 +
 io/channel.c                             |  2 +
 io/task.c                                |  1 +
 iohandler.c                              |  2 +-
 ioport.c                                 |  1 +
 kvm-stub.c                               |  1 -
 linux-user/elfload.c                     |  2 +
 linux-user/mmap.c                        |  1 -
 linux-user/signal.c                      |  1 -
 linux-user/uaccess.c                     |  2 +-
 main-loop.c                              |  1 +
 memory.c                                 |  2 +
 memory_mapping.c                         |  2 +-
 migration/block.c                        |  1 +
 migration/exec.c                         |  2 +-
 migration/fd.c                           |  2 +-
 migration/postcopy-ram.c                 |  1 -
 migration/qemu-file-buf.c                |  1 -
 migration/qemu-file-internal.h           |  1 -
 migration/qemu-file-stdio.c              |  1 -
 migration/qemu-file.c                    |  1 -
 migration/ram.c                          |  1 +
 migration/rdma.c                         |  1 +
 migration/tcp.c                          |  1 -
 migration/unix.c                         |  1 -
 migration/vmstate.c                      |  1 -
 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.h                                |  2 -
 net/l2tpv3.c                             |  1 -
 net/slirp.c                              |  1 +
 net/socket.c                             |  1 +
 net/tap-bsd.c                            |  1 -
 net/tap-linux.c                          |  1 +
 net/tap-win32.c                          |  1 -
 net/tap.c                                |  1 +
 net/tap_int.h                            |  1 -
 net/vde.c                                |  1 -
 os-posix.c                               |  1 +
 pc-bios/optionrom/optionrom.h            |  3 +-
 qapi/opts-visitor.c                      |  1 +
 qapi/qapi-dealloc-visitor.c              |  1 -
 qapi/qapi-util.c                         |  2 +-
 qapi/qapi-visit-core.c                   |  2 +-
 qapi/qmp-dispatch.c                      |  1 +
 qapi/qmp-event.c                         |  1 -
 qapi/qmp-input-visitor.c                 |  2 +-
 qapi/qmp-output-visitor.c                |  1 -
 qapi/string-input-visitor.c              |  2 +-
 qapi/string-output-visitor.c             |  1 -
 qdev-monitor.c                           |  1 +
 qemu-img.c                               |  1 +
 qemu-io-cmds.c                           |  2 +
 qemu-io.c                                |  2 +
 qemu-nbd.c                               |  1 +
 qemu-timer.c                             |  1 +
 qga/channel-posix.c                      |  1 +
 qga/commands-posix.c                     |  1 +
 qga/commands.c                           |  1 +
 qga/guest-agent-core.h                   |  1 -
 qga/main.c                               |  2 +-
 qga/vss-win32/requester.cpp              |  1 -
 qobject/json-lexer.c                     |  1 -
 qobject/json-parser.c                    |  1 +
 qobject/json-streamer.c                  |  1 -
 qobject/qbool.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/cpu.c                                |  1 +
 qom/object.c                             |  1 +
 qom/object_interfaces.c                  |  1 +
 qom/qom-qobject.c                        |  2 +-
 qtest.c                                  |  2 +
 replay/replay-events.c                   |  1 -
 replay/replay-input.c                    |  2 +-
 replay/replay-internal.c                 |  1 -
 replay/replay-time.c                     |  1 -
 replay/replay.c                          |  1 +
 scripts/clean-includes                   |  6 +--
 scripts/qapi-types.py                    |  5 ---
 scripts/qapi-visit.py                    |  1 +
 scripts/tracetool/backend/log.py         |  6 +--
 scripts/tracetool/format/events_h.py     |  2 -
 scripts/tracetool/format/h.py            |  3 --
 scripts/tracetool/format/tcg_h.py        |  2 -
 scripts/tracetool/format/ust_events_c.py |  1 -
 scripts/tracetool/format/ust_events_h.py |  1 -
 slirp/ip_icmp.c                          |  1 +
 slirp/libslirp.h                         |  2 -
 slirp/misc.c                             |  2 +-
 slirp/tcp_subr.c                         |  1 +
 spice-qemu-char.c                        |  1 +
 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                          |  2 -
 stubs/get-fd.c                           |  2 +-
 stubs/get-next-serial.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/set-fd-handler.c                   |  1 -
 stubs/slirp.c                            |  1 -
 stubs/target-get-monitor-def.c           |  2 -
 stubs/target-monitor-defs.c              |  2 -
 stubs/uuid.c                             |  1 -
 stubs/vm-stop.c                          |  1 -
 stubs/vmstate.c                          |  1 -
 target-alpha/cpu.c                       |  1 +
 target-alpha/cpu.h                       |  1 -
 target-alpha/translate.c                 |  1 +
 target-arm/cpu.c                         |  1 +
 target-arm/cpu.h                         |  1 -
 target-arm/cpu64.c                       |  1 +
 target-arm/kvm-stub.c                    |  1 -
 target-arm/kvm.c                         |  1 -
 target-arm/kvm32.c                       |  1 -
 target-arm/kvm64.c                       |  1 -
 target-cris/cpu.c                        |  1 +
 target-cris/cpu.h                        |  1 -
 target-i386/cpu.c                        |  3 +-
 target-i386/cpu.h                        |  1 -
 target-i386/kvm-stub.c                   |  1 -
 target-i386/kvm.c                        |  2 +-
 target-i386/machine.c                    |  1 +
 target-lm32/cpu.c                        |  1 +
 target-lm32/cpu.h                        |  1 -
 target-m68k/cpu.c                        |  1 +
 target-m68k/cpu.h                        |  1 -
 target-m68k/m68k-semi.c                  |  1 -
 target-microblaze/cpu.c                  |  1 +
 target-microblaze/cpu.h                  |  1 -
 target-mips/cpu.c                        |  1 +
 target-mips/cpu.h                        |  1 -
 target-mips/kvm.c                        |  1 -
 target-moxie/cpu.c                       |  1 +
 target-moxie/cpu.h                       |  1 -
 target-openrisc/cpu.c                    |  1 +
 target-openrisc/cpu.h                    |  1 -
 target-openrisc/exception.h              |  1 -
 target-openrisc/interrupt.c              |  1 -
 target-openrisc/mmu.c                    |  1 -
 target-openrisc/translate.c              |  1 -
 target-ppc/cpu-models.c                  |  1 +
 target-ppc/cpu.h                         |  1 -
 target-ppc/kvm-stub.c                    |  1 -
 target-ppc/kvm.c                         |  1 -
 target-ppc/translate_init.c              |  1 +
 target-s390x/cpu.c                       |  1 +
 target-s390x/cpu.h                       |  1 -
 target-s390x/helper.c                    |  2 +
 target-s390x/kvm.c                       |  1 -
 target-s390x/misc_helper.c               |  1 +
 target-sh4/cpu.c                         |  1 +
 target-sh4/cpu.h                         |  1 -
 target-sparc/cpu.c                       |  3 ++
 target-sparc/cpu.h                       |  1 -
 target-tilegx/cpu.c                      |  1 +
 target-tilegx/cpu.h                      |  1 -
 target-tilegx/helper.c                   |  1 -
 target-tilegx/simd_helper.c              |  1 -
 target-tricore/cpu.c                     |  1 +
 target-tricore/cpu.h                     |  1 -
 target-unicore32/cpu.c                   |  1 +
 target-unicore32/cpu.h                   |  1 -
 target-xtensa/core-dc233c.c              |  1 -
 target-xtensa/cpu.c                      |  1 +
 target-xtensa/cpu.h                      |  1 -
 tcg/optimize.c                           |  1 -
 tcg/tcg.h                                |  2 +-
 tci.c                                    |  1 -
 tests/ahci-test.c                        |  1 -
 tests/boot-order-test.c                  |  4 +-
 tests/boot-sector.c                      |  1 -
 tests/check-qdict.c                      |  1 -
 tests/check-qfloat.c                     |  1 -
 tests/check-qint.c                       |  1 -
 tests/check-qjson.c                      |  1 -
 tests/check-qom-proplist.c               |  1 +
 tests/check-qstring.c                    |  1 -
 tests/crypto-tls-x509-helpers.h          |  2 -
 tests/device-introspect-test.c           |  1 -
 tests/fdc-test.c                         |  1 -
 tests/fw_cfg-test.c                      |  3 +-
 tests/hd-geo-test.c                      |  1 -
 tests/io-channel-helpers.c               |  1 +
 tests/ipmi-bt-test.c                     |  1 -
 tests/libqos/ahci.c                      |  1 -
 tests/libqos/malloc-pc.c                 |  4 +-
 tests/libqos/pci-pc.c                    |  1 -
 tests/pc-cpu-test.c                      |  1 -
 tests/pxe-test.c                         |  1 -
 tests/rtl8139-test.c                     |  1 -
 tests/tcg/test-i386-fprem.c              |  4 +-
 tests/test-aio.c                         |  1 +
 tests/test-base64.c                      |  2 +-
 tests/test-blockjob-txn.c                |  1 +
 tests/test-crypto-cipher.c               |  1 +
 tests/test-crypto-secret.c               |  2 +
 tests/test-crypto-tlscredsx509.c         |  2 +
 tests/test-crypto-tlssession.c           |  2 +
 tests/test-io-channel-buffer.c           |  2 +-
 tests/test-io-channel-command.c          |  2 +
 tests/test-io-channel-file.c             |  3 +-
 tests/test-io-channel-socket.c           |  2 +
 tests/test-io-channel-tls.c              |  1 +
 tests/test-io-task.c                     |  2 +
 tests/test-iov.c                         |  1 -
 tests/test-opts-visitor.c                |  1 +
 tests/test-qemu-opts.c                   |  1 +
 tests/test-qmp-commands.c                |  1 -
 tests/test-qmp-event.c                   |  1 -
 tests/test-qmp-input-strict.c            |  2 +-
 tests/test-qmp-input-visitor.c           |  2 +-
 tests/test-qmp-output-visitor.c          |  2 +-
 tests/test-string-input-visitor.c        |  2 +-
 tests/test-string-output-visitor.c       |  2 +-
 tests/test-thread-pool.c                 |  2 +-
 tests/test-throttle.c                    |  1 +
 tests/test-visitor-serialization.c       |  2 +-
 tests/test-vmstate.c                     |  1 -
 tests/vhost-user-test.c                  |  1 +
 tests/virtio-9p-test.c                   |  1 -
 thread-pool.c                            |  1 -
 trace/control.c                          |  1 +
 trace/control.h                          |  2 -
 trace/qmp.c                              |  1 -
 ui/console-gl.c                          |  1 -
 ui/curses.c                              |  1 -
 ui/cursor.c                              |  1 -
 ui/egl-context.c                         |  1 -
 ui/egl-helpers.c                         |  1 -
 ui/gtk-egl.c                             |  1 -
 ui/gtk-gl-area.c                         |  1 -
 ui/input-linux.c                         |  1 +
 ui/keymaps.c                             |  1 +
 ui/keymaps.h                             |  2 -
 ui/qemu-pixman.c                         |  1 -
 ui/sdl2-2d.c                             |  1 -
 ui/sdl2-gl.c                             |  1 -
 ui/sdl2-input.c                          |  1 -
 ui/sdl2.c                                |  1 -
 ui/shader.c                              |  1 -
 ui/spice-core.c                          |  1 -
 ui/spice-display.c                       |  1 -
 ui/spice-input.c                         |  1 -
 ui/vnc-auth-sasl.c                       |  1 +
 ui/vnc-auth-vencrypt.c                   |  1 +
 ui/vnc-enc-tight.c                       |  1 -
 ui/vnc-ws.c                              |  1 +
 ui/vnc.c                                 |  1 +
 ui/vnc.h                                 |  1 -
 ui/x_keymap.c                            |  1 -
 util/acl.c                               |  1 -
 util/base64.c                            |  3 +-
 util/buffer.c                            |  1 +
 util/compatfd.c                          |  1 -
 util/coroutine-gthread.c                 |  1 -
 util/coroutine-sigaltstack.c             |  1 -
 util/coroutine-ucontext.c                |  1 -
 util/coroutine-win32.c                   |  1 -
 util/crc32c.c                            |  1 -
 util/envlist.c                           |  1 -
 util/error.c                             |  2 +-
 util/event_notifier-win32.c              |  1 -
 util/fifo8.c                             |  1 -
 util/getauxval.c                         |  1 -
 util/iov.c                               |  1 +
 util/log.c                               |  1 -
 util/mmap-alloc.c                        |  1 +
 util/module.c                            |  1 -
 util/notify.c                            |  1 -
 util/oslib-posix.c                       |  3 +-
 util/qemu-config.c                       |  1 -
 util/qemu-coroutine-lock.c               |  1 -
 util/qemu-coroutine.c                    |  1 -
 util/qemu-option.c                       |  1 +
 util/qemu-sockets.c                      |  4 +-
 util/qemu-thread-win32.c                 |  1 -
 util/rcu.c                               |  1 -
 util/throttle.c                          |  1 +
 vl.c                                     |  1 +
 821 files changed, 684 insertions(+), 627 deletions(-)
 delete mode 100644 include/config.h
 create mode 100644 include/hw/nvram/fw_cfg_keys.h

-- 
2.4.3

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

* [Qemu-devel] [PATCH 01/15] include/qemu/osdep.h: Don't include qapi/error.h
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 16:04   ` Paolo Bonzini
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 02/15] Use scripts/clean-includes to drop redundant qemu/typedefs.h Markus Armbruster
                   ` (14 subsequent siblings)
  15 siblings, 1 reply; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

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

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

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

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

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 async.c                                  | 1 +
 backends/baum.c                          | 1 +
 backends/hostmem-file.c                  | 1 +
 backends/hostmem-ram.c                   | 1 +
 backends/hostmem.c                       | 1 +
 backends/rng-egd.c                       | 1 +
 backends/rng-random.c                    | 1 +
 backends/rng.c                           | 1 +
 backends/tpm.c                           | 1 +
 block/backup.c                           | 1 +
 block/blkdebug.c                         | 1 +
 block/blkverify.c                        | 1 +
 block/bochs.c                            | 1 +
 block/cloop.c                            | 1 +
 block/commit.c                           | 1 +
 block/curl.c                             | 1 +
 block/dmg.c                              | 1 +
 block/gluster.c                          | 1 +
 block/io.c                               | 1 +
 block/mirror.c                           | 1 +
 block/nbd.c                              | 1 +
 block/null.c                             | 1 +
 block/parallels.c                        | 1 +
 block/qcow.c                             | 1 +
 block/qcow2-cluster.c                    | 1 +
 block/qcow2-refcount.c                   | 1 +
 block/qcow2-snapshot.c                   | 1 +
 block/qed.c                              | 1 +
 block/raw-posix.c                        | 1 +
 block/raw_bsd.c                          | 1 +
 block/rbd.c                              | 1 +
 block/sheepdog.c                         | 1 +
 block/snapshot.c                         | 1 +
 block/ssh.c                              | 1 +
 block/stream.c                           | 1 +
 block/vdi.c                              | 1 +
 block/vhdx-log.c                         | 1 +
 block/vhdx.c                             | 1 +
 block/vmdk.c                             | 1 +
 block/vpc.c                              | 1 +
 block/vvfat.c                            | 1 +
 bootdevice.c                             | 1 +
 contrib/ivshmem-server/main.c            | 1 +
 crypto/cipher.c                          | 1 +
 crypto/hash.c                            | 1 +
 crypto/init.c                            | 1 +
 crypto/secret.c                          | 1 +
 crypto/tlscreds.c                        | 1 +
 crypto/tlscredsanon.c                    | 1 +
 crypto/tlscredsx509.c                    | 1 +
 crypto/tlssession.c                      | 1 +
 device_tree.c                            | 1 +
 exec.c                                   | 1 +
 gdbstub.c                                | 1 +
 hw/9pfs/9p.c                             | 1 +
 hw/acpi/cpu_hotplug.c                    | 1 +
 hw/acpi/ich9.c                           | 1 +
 hw/acpi/pcihp.c                          | 1 +
 hw/acpi/piix4.c                          | 1 +
 hw/alpha/typhoon.c                       | 1 +
 hw/arm/allwinner-a10.c                   | 1 +
 hw/arm/armv7m.c                          | 1 +
 hw/arm/bcm2835_peripherals.c             | 1 +
 hw/arm/bcm2836.c                         | 1 +
 hw/arm/boot.c                            | 1 +
 hw/arm/cubieboard.c                      | 1 +
 hw/arm/digic.c                           | 1 +
 hw/arm/digic_boards.c                    | 1 +
 hw/arm/exynos4210.c                      | 1 +
 hw/arm/fsl-imx25.c                       | 1 +
 hw/arm/fsl-imx31.c                       | 1 +
 hw/arm/highbank.c                        | 1 +
 hw/arm/imx25_pdk.c                       | 1 +
 hw/arm/integratorcp.c                    | 1 +
 hw/arm/kzm.c                             | 1 +
 hw/arm/mainstone.c                       | 1 +
 hw/arm/musicpal.c                        | 1 +
 hw/arm/netduino2.c                       | 1 +
 hw/arm/nseries.c                         | 1 +
 hw/arm/omap1.c                           | 1 +
 hw/arm/omap2.c                           | 1 +
 hw/arm/omap_sx1.c                        | 1 +
 hw/arm/palm.c                            | 1 +
 hw/arm/pxa2xx.c                          | 1 +
 hw/arm/raspi.c                           | 1 +
 hw/arm/realview.c                        | 1 +
 hw/arm/spitz.c                           | 1 +
 hw/arm/stellaris.c                       | 1 +
 hw/arm/stm32f205_soc.c                   | 1 +
 hw/arm/sysbus-fdt.c                      | 1 +
 hw/arm/tosa.c                            | 1 +
 hw/arm/versatilepb.c                     | 1 +
 hw/arm/vexpress.c                        | 1 +
 hw/arm/virt-acpi-build.c                 | 1 +
 hw/arm/virt.c                            | 1 +
 hw/arm/xilinx_zynq.c                     | 1 +
 hw/arm/xlnx-ep108.c                      | 1 +
 hw/arm/xlnx-zynqmp.c                     | 1 +
 hw/audio/adlib.c                         | 1 +
 hw/audio/gus.c                           | 1 +
 hw/block/block.c                         | 1 +
 hw/block/dataplane/virtio-blk.c          | 1 +
 hw/block/fdc.c                           | 1 +
 hw/block/nand.c                          | 1 +
 hw/block/nvme.c                          | 1 +
 hw/block/onenand.c                       | 1 +
 hw/block/pflash_cfi01.c                  | 1 +
 hw/block/pflash_cfi02.c                  | 1 +
 hw/block/virtio-blk.c                    | 1 +
 hw/block/xen_disk.c                      | 1 +
 hw/bt/hci.c                              | 1 +
 hw/char/debugcon.c                       | 1 +
 hw/char/parallel.c                       | 1 +
 hw/char/serial-isa.c                     | 1 +
 hw/char/serial-pci.c                     | 1 +
 hw/char/serial.c                         | 1 +
 hw/char/spapr_vty.c                      | 1 +
 hw/char/virtio-serial-bus.c              | 1 +
 hw/core/loader.c                         | 1 +
 hw/core/machine.c                        | 1 +
 hw/core/nmi.c                            | 1 +
 hw/core/qdev-properties-system.c         | 1 +
 hw/core/qdev-properties.c                | 1 +
 hw/cpu/a15mpcore.c                       | 1 +
 hw/cpu/a9mpcore.c                        | 1 +
 hw/cpu/arm11mpcore.c                     | 1 +
 hw/cpu/realview_mpcore.c                 | 1 +
 hw/cris/axis_dev88.c                     | 1 +
 hw/display/cg3.c                         | 1 +
 hw/display/cirrus_vga.c                  | 1 +
 hw/display/sm501.c                       | 1 +
 hw/display/tc6393xb.c                    | 1 +
 hw/display/tcx.c                         | 1 +
 hw/display/vga.c                         | 1 +
 hw/display/vmware_vga.c                  | 1 +
 hw/dma/pl330.c                           | 1 +
 hw/dma/xilinx_axidma.c                   | 1 +
 hw/i386/acpi-build.c                     | 1 +
 hw/i386/kvm/i8254.c                      | 1 +
 hw/i386/kvm/pci-assign.c                 | 1 +
 hw/i386/pc_sysfw.c                       | 1 +
 hw/i386/pci-assign-load-rom.c            | 1 +
 hw/i386/xen/xen_platform.c               | 1 +
 hw/i386/xen/xen_pvdevice.c               | 1 +
 hw/ide/qdev.c                            | 1 +
 hw/input/milkymist-softusb.c             | 1 +
 hw/input/virtio-input-host.c             | 1 +
 hw/input/virtio-input.c                  | 1 +
 hw/intc/apic_common.c                    | 1 +
 hw/intc/arm_gic.c                        | 1 +
 hw/intc/arm_gic_common.c                 | 1 +
 hw/intc/arm_gicv2m.c                     | 1 +
 hw/intc/arm_gicv3_common.c               | 1 +
 hw/intc/armv7m_nvic.c                    | 1 +
 hw/intc/ioapic_common.c                  | 1 +
 hw/intc/openpic.c                        | 1 +
 hw/intc/realview_gic.c                   | 1 +
 hw/intc/xics.c                           | 1 +
 hw/ipack/ipack.c                         | 1 +
 hw/ipmi/ipmi_bmc_extern.c                | 1 +
 hw/ipmi/isa_ipmi_bt.c                    | 1 +
 hw/ipmi/isa_ipmi_kcs.c                   | 1 +
 hw/isa/isa-bus.c                         | 1 +
 hw/isa/pc87312.c                         | 1 +
 hw/m68k/an5206.c                         | 1 +
 hw/m68k/mcf5208.c                        | 1 +
 hw/mem/pc-dimm.c                         | 1 +
 hw/microblaze/petalogix_ml605_mmu.c      | 1 +
 hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 +
 hw/mips/mips_fulong2e.c                  | 1 +
 hw/mips/mips_mipssim.c                   | 1 +
 hw/mips/mips_r4k.c                       | 1 +
 hw/misc/bcm2835_mbox.c                   | 1 +
 hw/misc/bcm2835_property.c               | 1 +
 hw/misc/ivshmem.c                        | 1 +
 hw/misc/macio/macio.c                    | 1 +
 hw/misc/tmp105.c                         | 1 +
 hw/moxie/moxiesim.c                      | 1 +
 hw/net/dp8393x.c                         | 1 +
 hw/net/milkymist-minimac2.c              | 1 +
 hw/net/ne2000-isa.c                      | 1 +
 hw/net/xilinx_axienet.c                  | 1 +
 hw/nvram/spapr_nvram.c                   | 1 +
 hw/openrisc/openrisc_sim.c               | 1 +
 hw/pci-bridge/pci_bridge_dev.c           | 1 +
 hw/pci-host/piix.c                       | 1 +
 hw/pci-host/prep.c                       | 1 +
 hw/pci-host/q35.c                        | 1 +
 hw/pci/pcie.c                            | 1 +
 hw/pci/shpc.c                            | 1 +
 hw/ppc/e500.c                            | 1 +
 hw/ppc/mac_newworld.c                    | 1 +
 hw/ppc/mac_oldworld.c                    | 1 +
 hw/ppc/ppc405_boards.c                   | 1 +
 hw/ppc/ppc405_uc.c                       | 1 +
 hw/ppc/spapr.c                           | 1 +
 hw/ppc/spapr_drc.c                       | 1 +
 hw/ppc/spapr_events.c                    | 1 +
 hw/ppc/spapr_hcall.c                     | 1 +
 hw/ppc/spapr_pci.c                       | 1 +
 hw/ppc/spapr_pci_vfio.c                  | 1 +
 hw/ppc/spapr_rng.c                       | 1 +
 hw/ppc/spapr_vio.c                       | 1 +
 hw/s390x/event-facility.c                | 1 +
 hw/s390x/ipl.c                           | 1 +
 hw/s390x/s390-virtio-ccw.c               | 1 +
 hw/s390x/s390-virtio.c                   | 1 +
 hw/s390x/sclp.c                          | 1 +
 hw/s390x/virtio-ccw.c                    | 1 +
 hw/scsi/esp-pci.c                        | 1 +
 hw/scsi/esp.c                            | 1 +
 hw/scsi/scsi-bus.c                       | 1 +
 hw/scsi/scsi-disk.c                      | 1 +
 hw/scsi/scsi-generic.c                   | 1 +
 hw/scsi/vhost-scsi.c                     | 1 +
 hw/scsi/virtio-scsi.c                    | 1 +
 hw/scsi/vmw_pvscsi.c                     | 1 +
 hw/sd/pxa2xx_mmci.c                      | 1 +
 hw/sd/sd.c                               | 1 +
 hw/sh4/r2d.c                             | 1 +
 hw/sh4/shix.c                            | 1 +
 hw/smbios/smbios.c                       | 1 +
 hw/sparc/leon3.c                         | 1 +
 hw/sparc/sun4m.c                         | 1 +
 hw/sparc64/sun4u.c                       | 1 +
 hw/timer/a9gtimer.c                      | 1 +
 hw/timer/arm_mptimer.c                   | 1 +
 hw/timer/hpet.c                          | 1 +
 hw/timer/m48t59.c                        | 1 +
 hw/tpm/tpm_tis.c                         | 1 +
 hw/tricore/tricore_testboard.c           | 1 +
 hw/unicore32/puv3.c                      | 1 +
 hw/usb/bus.c                             | 1 +
 hw/usb/dev-hid.c                         | 1 +
 hw/usb/dev-hub.c                         | 1 +
 hw/usb/dev-mtp.c                         | 1 +
 hw/usb/dev-network.c                     | 1 +
 hw/usb/dev-serial.c                      | 1 +
 hw/usb/dev-smartcard-reader.c            | 1 +
 hw/usb/dev-storage.c                     | 1 +
 hw/usb/hcd-ehci.c                        | 1 +
 hw/usb/hcd-ohci.c                        | 1 +
 hw/usb/hcd-uhci.c                        | 1 +
 hw/usb/host-libusb.c                     | 1 +
 hw/usb/redirect.c                        | 1 +
 hw/vfio/platform.c                       | 1 +
 hw/virtio/vhost-user.c                   | 1 +
 hw/virtio/vhost.c                        | 1 +
 hw/virtio/virtio-pci.c                   | 1 +
 hw/virtio/virtio-rng.c                   | 1 +
 hw/virtio/virtio.c                       | 1 +
 hw/xen/xen-host-pci-device.c             | 1 +
 hw/xen/xen_pt.c                          | 1 +
 hw/xen/xen_pt_config_init.c              | 1 +
 hw/xen/xen_pt_graphics.c                 | 1 +
 hw/xtensa/sim.c                          | 1 +
 hw/xtensa/xtfpga.c                       | 1 +
 include/qapi/error.h                     | 5 -----
 include/qemu/osdep.h                     | 9 +++++----
 include/qemu/typedefs.h                  | 1 +
 include/qom/object.h                     | 1 +
 include/ui/qemu-spice.h                  | 1 +
 io/channel-command.c                     | 1 +
 io/channel-file.c                        | 1 +
 io/channel-socket.c                      | 1 +
 io/channel-tls.c                         | 1 +
 io/channel-websock.c                     | 1 +
 io/channel.c                             | 1 +
 io/task.c                                | 1 +
 iohandler.c                              | 1 +
 main-loop.c                              | 1 +
 memory.c                                 | 1 +
 memory_mapping.c                         | 1 +
 migration/block.c                        | 1 +
 migration/exec.c                         | 1 +
 migration/fd.c                           | 1 +
 migration/rdma.c                         | 1 +
 nbd/client.c                             | 1 +
 nbd/common.c                             | 1 +
 nbd/server.c                             | 1 +
 net/dump.c                               | 1 +
 net/filter-buffer.c                      | 1 +
 net/filter.c                             | 1 +
 net/socket.c                             | 1 +
 net/tap-linux.c                          | 1 +
 net/tap.c                                | 1 +
 qapi/opts-visitor.c                      | 1 +
 qapi/qapi-util.c                         | 1 +
 qapi/qapi-visit-core.c                   | 1 +
 qapi/qmp-dispatch.c                      | 1 +
 qapi/qmp-input-visitor.c                 | 1 +
 qapi/string-input-visitor.c              | 1 +
 qemu-img.c                               | 1 +
 qemu-io-cmds.c                           | 1 +
 qemu-io.c                                | 1 +
 qemu-nbd.c                               | 1 +
 qga/channel-posix.c                      | 1 +
 qobject/json-parser.c                    | 1 +
 qom/cpu.c                                | 1 +
 qom/object.c                             | 1 +
 qom/object_interfaces.c                  | 1 +
 qom/qom-qobject.c                        | 1 +
 qtest.c                                  | 1 +
 replay/replay-input.c                    | 1 +
 replay/replay.c                          | 1 +
 scripts/clean-includes                   | 5 +++--
 scripts/qapi-visit.py                    | 1 +
 stubs/get-fd.c                           | 1 +
 target-alpha/cpu.c                       | 1 +
 target-arm/cpu.c                         | 1 +
 target-arm/cpu64.c                       | 1 +
 target-cris/cpu.c                        | 1 +
 target-i386/kvm.c                        | 1 +
 target-lm32/cpu.c                        | 1 +
 target-m68k/cpu.c                        | 1 +
 target-microblaze/cpu.c                  | 1 +
 target-mips/cpu.c                        | 1 +
 target-moxie/cpu.c                       | 1 +
 target-openrisc/cpu.c                    | 1 +
 target-s390x/cpu.c                       | 1 +
 target-s390x/helper.c                    | 1 +
 target-sh4/cpu.c                         | 1 +
 target-sparc/cpu.c                       | 1 +
 target-tilegx/cpu.c                      | 1 +
 target-tricore/cpu.c                     | 1 +
 target-unicore32/cpu.c                   | 1 +
 target-xtensa/cpu.c                      | 1 +
 tests/check-qom-proplist.c               | 1 +
 tests/io-channel-helpers.c               | 1 +
 tests/test-aio.c                         | 1 +
 tests/test-base64.c                      | 2 +-
 tests/test-blockjob-txn.c                | 1 +
 tests/test-crypto-cipher.c               | 1 +
 tests/test-crypto-secret.c               | 1 +
 tests/test-crypto-tlscredsx509.c         | 1 +
 tests/test-crypto-tlssession.c           | 1 +
 tests/test-io-channel-command.c          | 1 +
 tests/test-io-channel-file.c             | 2 +-
 tests/test-io-channel-socket.c           | 1 +
 tests/test-io-task.c                     | 1 +
 tests/test-opts-visitor.c                | 1 +
 tests/test-qemu-opts.c                   | 1 +
 tests/test-qmp-input-strict.c            | 1 +
 tests/test-qmp-input-visitor.c           | 1 +
 tests/test-qmp-output-visitor.c          | 1 +
 tests/test-string-input-visitor.c        | 1 +
 tests/test-string-output-visitor.c       | 1 +
 tests/test-thread-pool.c                 | 1 +
 tests/test-throttle.c                    | 1 +
 tests/test-visitor-serialization.c       | 1 +
 ui/input-linux.c                         | 1 +
 ui/vnc-auth-sasl.c                       | 1 +
 ui/vnc-auth-vencrypt.c                   | 1 +
 ui/vnc-ws.c                              | 1 +
 util/base64.c                            | 1 +
 util/error.c                             | 1 +
 util/oslib-posix.c                       | 1 +
 util/qemu-option.c                       | 1 +
 util/qemu-sockets.c                      | 1 +
 util/throttle.c                          | 1 +
 360 files changed, 365 insertions(+), 13 deletions(-)

diff --git a/async.c b/async.c
index d4dd2cc..b4bf205 100644
--- a/async.c
+++ b/async.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/aio.h"
 #include "block/thread-pool.h"
diff --git a/backends/baum.c b/backends/baum.c
index c11320e..7644f72 100644
--- a/backends/baum.c
+++ b/backends/baum.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.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 fd59482..c70f268 100644
--- a/backends/hostmem-file.c
+++ b/backends/hostmem-file.c
@@ -10,6 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.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 44fb390..04a7ac3 100644
--- a/backends/hostmem-ram.c
+++ b/backends/hostmem-ram.c
@@ -11,6 +11,7 @@
  */
 #include "qemu/osdep.h"
 #include "sysemu/hostmem.h"
+#include "qapi/error.h"
 #include "qom/object_interfaces.h"
 
 #define TYPE_MEMORY_BACKEND_RAM "memory-backend-ram"
diff --git a/backends/hostmem.c b/backends/hostmem.c
index 6c6f0da..6e28be1 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -12,6 +12,7 @@
 #include "qemu/osdep.h"
 #include "sysemu/hostmem.h"
 #include "hw/boards.h"
+#include "qapi/error.h"
 #include "qapi/visitor.h"
 #include "qapi-types.h"
 #include "qapi-visit.h"
diff --git a/backends/rng-egd.c b/backends/rng-egd.c
index 6e0ba22..7a1b924 100644
--- a/backends/rng-egd.c
+++ b/backends/rng-egd.c
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include "sysemu/rng.h"
 #include "sysemu/char.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "hw/qdev.h" /* just for DEFINE_PROP_CHR */
 
diff --git a/backends/rng-random.c b/backends/rng-random.c
index 122e8d4..2e44e25 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include "sysemu/rng-random.h"
 #include "sysemu/rng.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/main-loop.h"
 
diff --git a/backends/rng.c b/backends/rng.c
index e57e2b4..398ebe4 100644
--- a/backends/rng.c
+++ b/backends/rng.c
@@ -12,6 +12,7 @@
 
 #include "qemu/osdep.h"
 #include "sysemu/rng.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "qom/object_interfaces.h"
 
diff --git a/backends/tpm.c b/backends/tpm.c
index d53da18..536f262 100644
--- a/backends/tpm.c
+++ b/backends/tpm.c
@@ -14,6 +14,7 @@
 
 #include "qemu/osdep.h"
 #include "sysemu/tpm_backend.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "sysemu/tpm.h"
 #include "qemu/thread.h"
diff --git a/block/backup.c b/block/backup.c
index 0f1b1bc..0e59471 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -17,6 +17,7 @@
 #include "block/block.h"
 #include "block/block_int.h"
 #include "block/blockjob.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/ratelimit.h"
 #include "sysemu/block-backend.h"
diff --git a/block/blkdebug.c b/block/blkdebug.c
index f85c54b..792d36b 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/config-file.h"
 #include "block/block_int.h"
diff --git a/block/blkverify.c b/block/blkverify.c
index 2a885cc..41432e5 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/sockets.h" /* for EINPROGRESS on Windows */
 #include "block/block_int.h"
 #include "qapi/qmp/qdict.h"
diff --git a/block/bochs.c b/block/bochs.c
index 8b953bb..af8b7ab 100644
--- a/block/bochs.c
+++ b/block/bochs.c
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
diff --git a/block/cloop.c b/block/cloop.c
index 41bdee8..a84f140 100644
--- a/block/cloop.c
+++ b/block/cloop.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
diff --git a/block/commit.c b/block/commit.c
index 446a3ae..cba0e8c 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -16,6 +16,7 @@
 #include "trace.h"
 #include "block/block_int.h"
 #include "block/blockjob.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/ratelimit.h"
 #include "sysemu/block-backend.h"
diff --git a/block/curl.c b/block/curl.c
index c70bfb4..fe331ca 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "block/block_int.h"
diff --git a/block/dmg.c b/block/dmg.c
index 1018fd1..a496eb7 100644
--- a/block/dmg.c
+++ b/block/dmg.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/bswap.h"
diff --git a/block/gluster.c b/block/gluster.c
index 65077a0..51e154c 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -10,6 +10,7 @@
 #include "qemu/osdep.h"
 #include <glusterfs/api/glfs.h>
 #include "block/block_int.h"
+#include "qapi/error.h"
 #include "qemu/uri.h"
 
 typedef struct GlusterAIOCB {
diff --git a/block/io.c b/block/io.c
index a69bfc4..d636bf7 100644
--- a/block/io.c
+++ b/block/io.c
@@ -28,6 +28,7 @@
 #include "block/blockjob.h"
 #include "block/block_int.h"
 #include "block/throttle-groups.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 
 #define NOT_DONE 0x7fffffff /* used while emulated sync operation in progress */
diff --git a/block/mirror.c b/block/mirror.c
index 9635fa8..7bfd0d2 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -16,6 +16,7 @@
 #include "block/blockjob.h"
 #include "block/block_int.h"
 #include "sysemu/block-backend.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/ratelimit.h"
 #include "qemu/bitmap.h"
diff --git a/block/nbd.c b/block/nbd.c
index 9f333c9..673f4a9 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -28,6 +28,7 @@
 
 #include "qemu/osdep.h"
 #include "block/nbd-client.h"
+#include "qapi/error.h"
 #include "qemu/uri.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
diff --git a/block/null.c b/block/null.c
index d90165d..00bc6e4 100644
--- a/block/null.c
+++ b/block/null.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "block/block_int.h"
 
 #define NULL_OPT_LATENCY "latency-ns"
diff --git a/block/parallels.c b/block/parallels.c
index 645521d..dfba8d4 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -28,6 +28,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
diff --git a/block/qcow.c b/block/qcow.c
index 251910c..4485819 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 3e887e9..31ecc10 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include <zlib.h>
 
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "block/qcow2.h"
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 52a0a9f..ca6094f 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "block/qcow2.h"
diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c
index 13f88d1..269acc2 100644
--- a/block/qcow2-snapshot.c
+++ b/block/qcow2-snapshot.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "block/qcow2.h"
diff --git a/block/qed.c b/block/qed.c
index 404be1e..3679a32 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "trace.h"
 #include "qed.h"
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 8866121..29dc658 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
diff --git a/block/raw_bsd.c b/block/raw_bsd.c
index ea16a23..41dddf8 100644
--- a/block/raw_bsd.c
+++ b/block/raw_bsd.c
@@ -28,6 +28,7 @@
 
 #include "qemu/osdep.h"
 #include "block/block_int.h"
+#include "qapi/error.h"
 #include "qemu/option.h"
 
 static QemuOptsList raw_create_opts = {
diff --git a/block/rbd.c b/block/rbd.c
index abfea61..4f3fa30 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -13,6 +13,7 @@
 
 #include "qemu/osdep.h"
 
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "block/block_int.h"
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 05677ed..e1f9769 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/uri.h"
 #include "qemu/error-report.h"
diff --git a/block/snapshot.c b/block/snapshot.c
index 17a27b5..e9d721d 100644
--- a/block/snapshot.c
+++ b/block/snapshot.c
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "block/snapshot.h"
 #include "block/block_int.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 
 QemuOptsList internal_snapshot_opts = {
diff --git a/block/ssh.c b/block/ssh.c
index 04deeba..06928ed 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -28,6 +28,7 @@
 #include <libssh2_sftp.h>
 
 #include "block/block_int.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/sockets.h"
 #include "qemu/uri.h"
diff --git a/block/stream.c b/block/stream.c
index cafaa07..9b0b0f3 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -15,6 +15,7 @@
 #include "trace.h"
 #include "block/block_int.h"
 #include "block/blockjob.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/ratelimit.h"
 #include "sysemu/block-backend.h"
diff --git a/block/vdi.c b/block/vdi.c
index b403243..8b791f4 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -50,6 +50,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
diff --git a/block/vhdx-log.c b/block/vhdx-log.c
index 3690761..7ea7187 100644
--- a/block/vhdx-log.c
+++ b/block/vhdx-log.c
@@ -18,6 +18,7 @@
  *
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/error-report.h"
diff --git a/block/vhdx.c b/block/vhdx.c
index 9a51428..cbb54d8 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
diff --git a/block/vmdk.c b/block/vmdk.c
index a8db5d9..c1eb2b5 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qapi/qmp/qerror.h"
diff --git a/block/vpc.c b/block/vpc.c
index f504536..d60f692 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
diff --git a/block/vvfat.c b/block/vvfat.c
index b8d29e1..bdce8da 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -24,6 +24,7 @@
  */
 #include "qemu/osdep.h"
 #include <dirent.h>
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
diff --git a/bootdevice.c b/bootdevice.c
index dbc0159..2e83ff0 100644
--- a/bootdevice.c
+++ b/bootdevice.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "sysemu/sysemu.h"
 #include "qapi/visitor.h"
 #include "qemu/error-report.h"
diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c
index cca1061..4c9a11f 100644
--- a/contrib/ivshmem-server/main.c
+++ b/contrib/ivshmem-server/main.c
@@ -7,6 +7,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 
 #include "ivshmem-server.h"
diff --git a/crypto/cipher.c b/crypto/cipher.c
index 076dff0..a48aab2 100644
--- a/crypto/cipher.c
+++ b/crypto/cipher.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "crypto/cipher.h"
 
 
diff --git a/crypto/hash.c b/crypto/hash.c
index 4a8c0ca..b90af34 100644
--- a/crypto/hash.c
+++ b/crypto/hash.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "crypto/hash.h"
 
 #ifdef CONFIG_GNUTLS_HASH
diff --git a/crypto/init.c b/crypto/init.c
index 31eea19..1e564d9 100644
--- a/crypto/init.c
+++ b/crypto/init.c
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "crypto/init.h"
+#include "qapi/error.h"
 #include "qemu/thread.h"
 
 #ifdef CONFIG_GNUTLS
diff --git a/crypto/secret.c b/crypto/secret.c
index be736f2..285ab7a 100644
--- a/crypto/secret.c
+++ b/crypto/secret.c
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "crypto/secret.h"
 #include "crypto/cipher.h"
+#include "qapi/error.h"
 #include "qom/object_interfaces.h"
 #include "qemu/base64.h"
 #include "trace.h"
diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c
index fc99589..1620e12 100644
--- a/crypto/tlscreds.c
+++ b/crypto/tlscreds.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "crypto/tlscredspriv.h"
 #include "trace.h"
 
diff --git a/crypto/tlscredsanon.c b/crypto/tlscredsanon.c
index f36a793..1464220 100644
--- a/crypto/tlscredsanon.c
+++ b/crypto/tlscredsanon.c
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "crypto/tlscredsanon.h"
 #include "crypto/tlscredspriv.h"
+#include "qapi/error.h"
 #include "qom/object_interfaces.h"
 #include "trace.h"
 
diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c
index 9913043..6a0179c 100644
--- a/crypto/tlscredsx509.c
+++ b/crypto/tlscredsx509.c
@@ -22,6 +22,7 @@
 #include "crypto/tlscredsx509.h"
 #include "crypto/tlscredspriv.h"
 #include "crypto/secret.h"
+#include "qapi/error.h"
 #include "qom/object_interfaces.h"
 #include "trace.h"
 
diff --git a/crypto/tlssession.c b/crypto/tlssession.c
index e0d9658..a543e5a 100644
--- a/crypto/tlssession.c
+++ b/crypto/tlssession.c
@@ -22,6 +22,7 @@
 #include "crypto/tlssession.h"
 #include "crypto/tlscredsanon.h"
 #include "crypto/tlscredsx509.h"
+#include "qapi/error.h"
 #include "qemu/acl.h"
 #include "trace.h"
 
diff --git a/device_tree.c b/device_tree.c
index 6204af8..ccba1fd 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -17,6 +17,7 @@
 #include <dirent.h>
 #endif
 
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "sysemu/device_tree.h"
diff --git a/exec.c b/exec.c
index f09dd4e..f0d1667 100644
--- a/exec.c
+++ b/exec.c
@@ -17,6 +17,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #ifndef _WIN32
 #include <sys/mman.h>
 #endif
diff --git a/gdbstub.c b/gdbstub.c
index 61c12b1..492e1e4 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -17,6 +17,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #ifdef CONFIG_USER_ONLY
 
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index db5f478..f5e3012 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -14,6 +14,7 @@
 #include "qemu/osdep.h"
 #include "hw/virtio/virtio.h"
 #include "hw/i386/pc.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/iov.h"
 #include "qemu/sockets.h"
diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c
index 5a410a5..4d86743 100644
--- a/hw/acpi/cpu_hotplug.c
+++ b/hw/acpi/cpu_hotplug.c
@@ -12,6 +12,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/acpi/cpu_hotplug.h"
+#include "qapi/error.h"
 #include "qom/cpu.h"
 
 static uint64_t cpu_status_read(void *opaque, hwaddr addr, unsigned int size)
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 7220254..27e978f 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -25,6 +25,7 @@
  */
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "qapi/error.h"
 #include "qapi/visitor.h"
 #include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index 3e338b5..71f4c4e 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -35,6 +35,7 @@
 #include "exec/ioport.h"
 #include "exec/address-spaces.h"
 #include "hw/pci/pci_bus.h"
+#include "qapi/error.h"
 #include "qom/qom-qobject.h"
 #include "qapi/qmp/qint.h"
 
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 9694e52..16abdf1 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -26,6 +26,7 @@
 #include "hw/pci/pci.h"
 #include "hw/acpi/acpi.h"
 #include "sysemu/sysemu.h"
+#include "qapi/error.h"
 #include "qemu/range.h"
 #include "exec/ioport.h"
 #include "hw/nvram/fw_cfg.h"
diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c
index b86ff5e..97721b5 100644
--- a/hw/alpha/typhoon.c
+++ b/hw/alpha/typhoon.c
@@ -7,6 +7,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "hw/hw.h"
 #include "hw/devices.h"
diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c
index 02c8caa..b4d3cf6 100644
--- a/hw/arm/allwinner-a10.c
+++ b/hw/arm/allwinner-a10.c
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/devices.h"
 #include "hw/arm/allwinner-a10.h"
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index ed7d97f..c68d644 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/arm/arm.h"
 #include "hw/loader.h"
diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c
index 6d66fa0..902f6cf 100644
--- a/hw/arm/bcm2835_peripherals.c
+++ b/hw/arm/bcm2835_peripherals.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/arm/bcm2835_peripherals.h"
 #include "hw/misc/bcm2835_mbox_defs.h"
 #include "hw/arm/raspi_platform.h"
diff --git a/hw/arm/bcm2836.c b/hw/arm/bcm2836.c
index 0321439..1a0108b 100644
--- a/hw/arm/bcm2836.c
+++ b/hw/arm/bcm2836.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/arm/bcm2836.h"
 #include "hw/arm/raspi_platform.h"
 #include "hw/sysbus.h"
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 8ba0e42..5975fbf 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/arm/arm.h"
 #include "hw/arm/linux-boot-if.h"
diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c
index 2382c59..69fdfc9 100644
--- a/hw/arm/cubieboard.c
+++ b/hw/arm/cubieboard.c
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/devices.h"
 #include "hw/boards.h"
diff --git a/hw/arm/digic.c b/hw/arm/digic.c
index 82087ba..e0f9730 100644
--- a/hw/arm/digic.c
+++ b/hw/arm/digic.c
@@ -21,6 +21,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/arm/digic.h"
 
 #define DIGIC4_TIMER_BASE(n)    (0xc0210000 + (n) * 0x100)
diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c
index e5308f4..c4bec42 100644
--- a/hw/arm/digic_boards.c
+++ b/hw/arm/digic_boards.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/boards.h"
 #include "exec/address-spaces.h"
 #include "qemu/error-report.h"
diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c
index 6a8f0b5..e27a182 100644
--- a/hw/arm/exynos4210.c
+++ b/hw/arm/exynos4210.c
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/boards.h"
 #include "sysemu/sysemu.h"
 #include "hw/sysbus.h"
diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c
index fb743bf..f168a30 100644
--- a/hw/arm/fsl-imx25.c
+++ b/hw/arm/fsl-imx25.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/arm/fsl-imx25.h"
 #include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c
index f2c2ce5..d053495 100644
--- a/hw/arm/fsl-imx31.c
+++ b/hw/arm/fsl-imx31.c
@@ -20,6 +20,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/arm/fsl-imx31.h"
 #include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index e25cf5e..a482396 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/arm/arm.h"
 #include "hw/devices.h"
diff --git a/hw/arm/imx25_pdk.c b/hw/arm/imx25_pdk.c
index e3cffd1..facd605 100644
--- a/hw/arm/imx25_pdk.c
+++ b/hw/arm/imx25_pdk.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/arm/fsl-imx25.h"
 #include "hw/boards.h"
 #include "qemu/error-report.h"
diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
index c6656a8..5a4540b 100644
--- a/hw/arm/integratorcp.c
+++ b/hw/arm/integratorcp.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/devices.h"
 #include "hw/boards.h"
diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c
index 2eeb9d8..12cbd05 100644
--- a/hw/arm/kzm.c
+++ b/hw/arm/kzm.c
@@ -14,6 +14,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/arm/fsl-imx31.h"
 #include "hw/boards.h"
 #include "qemu/error-report.h"
diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c
index 98a892f..454acc5 100644
--- a/hw/arm/mainstone.c
+++ b/hw/arm/mainstone.c
@@ -12,6 +12,7 @@
  * GNU GPL, version 2 or (at your option) any later version.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/arm/pxa.h"
 #include "hw/arm/arm.h"
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
index 54548f3..28d5af1 100644
--- a/hw/arm/musicpal.c
+++ b/hw/arm/musicpal.c
@@ -10,6 +10,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/arm/arm.h"
 #include "hw/devices.h"
diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c
index 49da6e3..23d7928 100644
--- a/hw/arm/netduino2.c
+++ b/hw/arm/netduino2.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/boards.h"
 #include "qemu/error-report.h"
 #include "hw/arm/stm32f205_soc.h"
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
index d9e61f7..644315f 100644
--- a/hw/arm/nseries.c
+++ b/hw/arm/nseries.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "sysemu/sysemu.h"
 #include "hw/arm/omap.h"
diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c
index 6f68130..387a776 100644
--- a/hw/arm/omap1.c
+++ b/hw/arm/omap1.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/boards.h"
 #include "hw/hw.h"
 #include "hw/arm/arm.h"
diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c
index d11224e..74d45ba 100644
--- a/hw/arm/omap2.c
+++ b/hw/arm/omap2.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "hw/boards.h"
diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c
index 68236a3..08c72dd 100644
--- a/hw/arm/omap_sx1.c
+++ b/hw/arm/omap_sx1.c
@@ -26,6 +26,7 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "ui/console.h"
 #include "hw/arm/omap.h"
diff --git a/hw/arm/palm.c b/hw/arm/palm.c
index cae0a46..7f46073 100644
--- a/hw/arm/palm.c
+++ b/hw/arm/palm.c
@@ -17,6 +17,7 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "audio/audio.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index ff6ac7a..2410909 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/arm/pxa.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
index 6582279..0376cfd 100644
--- a/hw/arm/raspi.c
+++ b/hw/arm/raspi.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/arm/bcm2836.h"
 #include "qemu/error-report.h"
 #include "hw/boards.h"
diff --git a/hw/arm/realview.c b/hw/arm/realview.c
index 90429fc..48cfcd3 100644
--- a/hw/arm/realview.c
+++ b/hw/arm/realview.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/arm/arm.h"
 #include "hw/arm/primecell.h"
diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c
index 607cb58..8332f4e 100644
--- a/hw/arm/spitz.c
+++ b/hw/arm/spitz.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/arm/pxa.h"
 #include "hw/arm/arm.h"
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index de8dbb2..fe6a4f0 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/ssi/ssi.h"
 #include "hw/arm/arm.h"
diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c
index 79bfe6d..6ce2fdc 100644
--- a/hw/arm/stm32f205_soc.c
+++ b/hw/arm/stm32f205_soc.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/arm/arm.h"
 #include "exec/address-spaces.h"
 #include "hw/arm/stm32f205_soc.h"
diff --git a/hw/arm/sysbus-fdt.c b/hw/arm/sysbus-fdt.c
index 49bd212..5debb33 100644
--- a/hw/arm/sysbus-fdt.c
+++ b/hw/arm/sysbus-fdt.c
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include <libfdt.h>
 #include "qemu-common.h"
 #ifdef CONFIG_LINUX
diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c
index d83c1e1..4e9494f 100644
--- a/hw/arm/tosa.c
+++ b/hw/arm/tosa.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/arm/pxa.h"
 #include "hw/arm/arm.h"
diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
index d061f0f..888c479 100644
--- a/hw/arm/versatilepb.c
+++ b/hw/arm/versatilepb.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/arm/arm.h"
 #include "hw/devices.h"
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 726c4e0..83fc0e9 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/arm/arm.h"
 #include "hw/arm/primecell.h"
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 6a86b2c..f51fe39 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -27,6 +27,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "hw/arm/virt-acpi-build.h"
 #include "qemu/bitmap.h"
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 8c6c996..a0937bb 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -29,6 +29,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/arm/arm.h"
 #include "hw/arm/primecell.h"
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index a35983a..fa8bbe7 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/arm/arm.h"
 #include "net/net.h"
diff --git a/hw/arm/xlnx-ep108.c b/hw/arm/xlnx-ep108.c
index a1bd283..3313ad0 100644
--- a/hw/arm/xlnx-ep108.c
+++ b/hw/arm/xlnx-ep108.c
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/arm/xlnx-zynqmp.h"
 #include "hw/boards.h"
 #include "qemu/error-report.h"
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 4fbb635..0cff6de 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/arm/xlnx-zynqmp.h"
 #include "hw/intc/arm_gic_common.h"
 #include "exec/address-spaces.h"
diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c
index 1270b19..355a259 100644
--- a/hw/audio/adlib.c
+++ b/hw/audio/adlib.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/audio/audio.h"
 #include "audio/audio.h"
diff --git a/hw/audio/gus.c b/hw/audio/gus.c
index b416a54..9dd6947 100644
--- a/hw/audio/gus.c
+++ b/hw/audio/gus.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/audio/audio.h"
 #include "audio/audio.h"
diff --git a/hw/block/block.c b/hw/block/block.c
index 960df2b..97a59d4 100644
--- a/hw/block/block.c
+++ b/hw/block/block.c
@@ -11,6 +11,7 @@
 #include "sysemu/blockdev.h"
 #include "sysemu/block-backend.h"
 #include "hw/block/block.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 
 void blkconf_serial(BlockConf *conf, char **serial)
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
index 36f3d2b..e666dd4 100644
--- a/hw/block/dataplane/virtio-blk.c
+++ b/hw/block/dataplane/virtio-blk.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "trace.h"
 #include "qemu/iov.h"
 #include "qemu/thread.h"
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 9838d21..4cffffd 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -30,6 +30,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/block/fdc.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "hw/isa/isa.h"
diff --git a/hw/block/nand.c b/hw/block/nand.c
index f51e13f..29c6596 100644
--- a/hw/block/nand.c
+++ b/hw/block/nand.c
@@ -23,6 +23,7 @@
 #include "hw/block/flash.h"
 #include "sysemu/block-backend.h"
 #include "hw/qdev.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 
 # define NAND_CMD_READ0		0x00
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index c68b625..173988e 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -26,6 +26,7 @@
 #include <hw/pci/msix.h>
 #include <hw/pci/pci.h>
 #include "sysemu/sysemu.h"
+#include "qapi/error.h"
 #include "qapi/visitor.h"
 #include "sysemu/block-backend.h"
 
diff --git a/hw/block/onenand.c b/hw/block/onenand.c
index 9189685..883f4b1 100644
--- a/hw/block/onenand.c
+++ b/hw/block/onenand.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/block/flash.h"
diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
index a4c4fa1..c475c2a 100644
--- a/hw/block/pflash_cfi01.c
+++ b/hw/block/pflash_cfi01.c
@@ -40,6 +40,7 @@
 #include "hw/hw.h"
 #include "hw/block/flash.h"
 #include "sysemu/block-backend.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "qemu/bitops.h"
 #include "exec/address-spaces.h"
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
index aaa697a..eadc61b 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -38,6 +38,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/block/flash.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "sysemu/block-backend.h"
 #include "exec/address-spaces.h"
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index cb710f1..870d345 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/iov.h"
 #include "qemu/error-report.h"
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 7bd5bde..f8088ee 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -29,6 +29,7 @@
 #include "xen_blkif.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/block-backend.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qstring.h"
 
diff --git a/hw/bt/hci.c b/hw/bt/hci.c
index 8bc33b5..1eaa442 100644
--- a/hw/bt/hci.c
+++ b/hw/bt/hci.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/timer.h"
 #include "hw/usb.h"
diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c
index 148632e..e7f025e 100644
--- a/hw/char/debugcon.c
+++ b/hw/char/debugcon.c
@@ -25,6 +25,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "sysemu/char.h"
 #include "hw/isa/isa.h"
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index f6ba76f..11c78fe 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "sysemu/char.h"
 #include "hw/isa/isa.h"
diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c
index b9b5bc6..1594ec4 100644
--- a/hw/char/serial-isa.c
+++ b/hw/char/serial-isa.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/char/serial.h"
 #include "hw/isa/isa.h"
 
diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
index 8f1b6f3..303104d 100644
--- a/hw/char/serial-pci.c
+++ b/hw/char/serial-pci.c
@@ -26,6 +26,7 @@
 /* see docs/specs/pci-serial.txt */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/char/serial.h"
 #include "hw/pci/pci.h"
 
diff --git a/hw/char/serial.c b/hw/char/serial.c
index 39e07db..6f89f2c 100644
--- a/hw/char/serial.c
+++ b/hw/char/serial.c
@@ -26,6 +26,7 @@
 #include "qemu/osdep.h"
 #include "hw/char/serial.h"
 #include "sysemu/char.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "exec/address-spaces.h"
 #include "qemu/error-report.h"
diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c
index 747c69d..f3aff5e 100644
--- a/hw/char/spapr_vty.c
+++ b/hw/char/spapr_vty.c
@@ -1,4 +1,5 @@
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/qdev.h"
 #include "sysemu/char.h"
 #include "hw/ppc/spapr.h"
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
index 99cb683..6e5de6d 100644
--- a/hw/char/virtio-serial-bus.c
+++ b/hw/char/virtio-serial-bus.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/iov.h"
 #include "monitor/monitor.h"
 #include "qemu/error-report.h"
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 8e8031c..93410e3 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -43,6 +43,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "disas/disas.h"
 #include "monitor/monitor.h"
diff --git a/hw/core/machine.c b/hw/core/machine.c
index a8c4680..136bf27 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -12,6 +12,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/boards.h"
+#include "qapi/error.h"
 #include "qapi-visit.h"
 #include "qapi/visitor.h"
 #include "hw/sysbus.h"
diff --git a/hw/core/nmi.c b/hw/core/nmi.c
index 6ca569b..e8bcc41 100644
--- a/hw/core/nmi.c
+++ b/hw/core/nmi.c
@@ -21,6 +21,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/nmi.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "monitor/monitor.h"
 
diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c
index e10cede..891219a 100644
--- a/hw/core/qdev-properties-system.c
+++ b/hw/core/qdev-properties-system.c
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include "net/net.h"
 #include "hw/qdev.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index bc89800..eef932c 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -1,6 +1,7 @@
 #include "qemu/osdep.h"
 #include "net/net.h"
 #include "hw/qdev.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/error-report.h"
 #include "sysemu/block-backend.h"
diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
index a221b8f..bc05152 100644
--- a/hw/cpu/a15mpcore.c
+++ b/hw/cpu/a15mpcore.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/cpu/a15mpcore.h"
 #include "sysemu/kvm.h"
 #include "kvm_arm.h"
diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c
index 23c882f..5459ae8 100644
--- a/hw/cpu/a9mpcore.c
+++ b/hw/cpu/a9mpcore.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/cpu/a9mpcore.h"
 
 static void a9mp_priv_set_irq(void *opaque, int irq, int level)
diff --git a/hw/cpu/arm11mpcore.c b/hw/cpu/arm11mpcore.c
index 5f4ca31..eb24465 100644
--- a/hw/cpu/arm11mpcore.c
+++ b/hw/cpu/arm11mpcore.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/cpu/arm11mpcore.h"
 #include "hw/intc/realview_gic.h"
 
diff --git a/hw/cpu/realview_mpcore.c b/hw/cpu/realview_mpcore.c
index c5c4dfc..39d4ebe 100644
--- a/hw/cpu/realview_mpcore.c
+++ b/hw/cpu/realview_mpcore.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/cpu/arm11mpcore.h"
 #include "hw/intc/realview_gic.h"
 
diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c
index f2ba1d0..8cfa082 100644
--- a/hw/cris/axis_dev88.c
+++ b/hw/cris/axis_dev88.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "net/net.h"
 #include "hw/block/flash.h"
diff --git a/hw/display/cg3.c b/hw/display/cg3.c
index 321a251..fc0d97f 100644
--- a/hw/display/cg3.c
+++ b/hw/display/cg3.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "ui/console.h"
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index 57b91a7..3d712d5 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -27,6 +27,7 @@
  *   available at http://home.worldonline.dk/~finth/
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "ui/console.h"
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 2957243..183e1d2 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/char/serial.h"
 #include "ui/console.h"
diff --git a/hw/display/tc6393xb.c b/hw/display/tc6393xb.c
index 31043b1..da3cece 100644
--- a/hw/display/tc6393xb.c
+++ b/hw/display/tc6393xb.c
@@ -11,6 +11,7 @@
  * GNU GPL, version 2 or (at your option) any later version.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/devices.h"
 #include "hw/block/flash.h"
diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index 8afc2f3..cac9fe3 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "ui/console.h"
 #include "ui/pixel_ops.h"
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 555cac6..25dc978 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "vga.h"
 #include "ui/console.h"
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 17bba63..0c63fa8 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/loader.h"
 #include "trace.h"
diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c
index 37ea7e4..ea89ecb 100644
--- a/hw/dma/pl330.c
+++ b/hw/dma/pl330.c
@@ -16,6 +16,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "sysemu/dma.h"
 
diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c
index ce5c1e6..a4753e5 100644
--- a/hw/dma/xilinx_axidma.c
+++ b/hw/dma/xilinx_axidma.c
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "hw/ptimer.h"
 #include "qemu/log.h"
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index b888008..2af5a6b 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -21,6 +21,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "acpi-build.h"
 #include <glib.h>
 #include "qemu-common.h"
diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c
index e43b5c4..a4462e5 100644
--- a/hw/i386/kvm/i8254.c
+++ b/hw/i386/kvm/i8254.c
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "hw/timer/i8254.h"
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index d4089e7..bf425a2 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -21,6 +21,7 @@
  *  Copyright (C) 2008, IBM, Muli Ben-Yehuda (muli@il.ibm.com)
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include <sys/mman.h>
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
index 2324e70..f915ad0 100644
--- a/hw/i386/pc_sysfw.c
+++ b/hw/i386/pc_sysfw.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "sysemu/block-backend.h"
 #include "qemu/error-report.h"
 #include "hw/sysbus.h"
diff --git a/hw/i386/pci-assign-load-rom.c b/hw/i386/pci-assign-load-rom.c
index bff979a..4bbb08c 100644
--- a/hw/i386/pci-assign-load-rom.c
+++ b/hw/i386/pci-assign-load-rom.c
@@ -2,6 +2,7 @@
  * This is splited from hw/i386/kvm/pci-assign.c
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "qemu/error-report.h"
diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
index a2247b9..aa78393 100644
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "hw/ide.h"
diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c
index 1095c65..c093b34 100644
--- a/hw/i386/xen/xen_pvdevice.c
+++ b/hw/i386/xen/xen_pvdevice.c
@@ -30,6 +30,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "trace.h"
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 2d14a76..4bc74a3 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -19,6 +19,7 @@
 #include "qemu/osdep.h"
 #include <hw/hw.h>
 #include "sysemu/dma.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 #include <hw/ide/internal.h>
 #include "sysemu/block-backend.h"
diff --git a/hw/input/milkymist-softusb.c b/hw/input/milkymist-softusb.c
index 64b9292..40dfca1 100644
--- a/hw/input/milkymist-softusb.c
+++ b/hw/input/milkymist-softusb.c
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "trace.h"
diff --git a/hw/input/virtio-input-host.c b/hw/input/virtio-input-host.c
index ddee54c..9e0f46d 100644
--- a/hw/input/virtio-input-host.c
+++ b/hw/input/virtio-input-host.c
@@ -5,6 +5,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/sockets.h"
 
diff --git a/hw/input/virtio-input.c b/hw/input/virtio-input.c
index 5061f4c..672c207 100644
--- a/hw/input/virtio-input.c
+++ b/hw/input/virtio-input.c
@@ -5,6 +5,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/iov.h"
 
 #include "hw/qdev.h"
diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index 659f377..4abe145 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
@@ -18,6 +18,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/i386/apic.h"
 #include "hw/i386/apic_internal.h"
 #include "trace.h"
diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
index 0834c2f..f551241 100644
--- a/hw/intc/arm_gic.c
+++ b/hw/intc/arm_gic.c
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "gic_internal.h"
+#include "qapi/error.h"
 #include "qom/cpu.h"
 
 //#define DEBUG_GIC
diff --git a/hw/intc/arm_gic_common.c b/hw/intc/arm_gic_common.c
index 707d00d..0a1f56a 100644
--- a/hw/intc/arm_gic_common.c
+++ b/hw/intc/arm_gic_common.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "gic_internal.h"
 #include "hw/arm/linux-boot-if.h"
 
diff --git a/hw/intc/arm_gicv2m.c b/hw/intc/arm_gicv2m.c
index 70c0b97..3e35915 100644
--- a/hw/intc/arm_gicv2m.c
+++ b/hw/intc/arm_gicv2m.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/pci/msi.h"
 
diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
index e4f0f5a..b9d3824 100644
--- a/hw/intc/arm_gicv3_common.c
+++ b/hw/intc/arm_gicv3_common.c
@@ -21,6 +21,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/intc/arm_gicv3_common.h"
 
 static void gicv3_pre_save(void *opaque)
diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
index 92f6a44..3a23d34 100644
--- a/hw/intc/armv7m_nvic.c
+++ b/hw/intc/armv7m_nvic.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
 #include "hw/arm/arm.h"
diff --git a/hw/intc/ioapic_common.c b/hw/intc/ioapic_common.c
index 0a48de2..1b7ec5e 100644
--- a/hw/intc/ioapic_common.c
+++ b/hw/intc/ioapic_common.c
@@ -20,6 +20,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "monitor/monitor.h"
 #include "hw/i386/ioapic.h"
 #include "hw/i386/ioapic_internal.h"
diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c
index 903888c..dc8fa0d 100644
--- a/hw/intc/openpic.c
+++ b/hw/intc/openpic.c
@@ -41,6 +41,7 @@
 #include "hw/ppc/ppc_e500.h"
 #include "hw/sysbus.h"
 #include "hw/pci/msi.h"
+#include "qapi/error.h"
 #include "qemu/bitops.h"
 #include "qapi/qmp/qerror.h"
 
diff --git a/hw/intc/realview_gic.c b/hw/intc/realview_gic.c
index 291f196..50bbab6 100644
--- a/hw/intc/realview_gic.c
+++ b/hw/intc/realview_gic.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/intc/realview_gic.h"
 
 static void realview_gic_set_irq(void *opaque, int irq, int level)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index 213a370..04a079c 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "trace.h"
 #include "qemu/timer.h"
diff --git a/hw/ipack/ipack.c b/hw/ipack/ipack.c
index 7c5c30d..5f99ed9 100644
--- a/hw/ipack/ipack.c
+++ b/hw/ipack/ipack.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/ipack/ipack.h"
 
 IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot)
diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c
index c31a3a0..fe12112 100644
--- a/hw/ipmi/ipmi_bmc_extern.c
+++ b/hw/ipmi/ipmi_bmc_extern.c
@@ -28,6 +28,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "sysemu/char.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c
index ace2dc0..aaea12e 100644
--- a/hw/ipmi/isa_ipmi_bt.c
+++ b/hw/ipmi/isa_ipmi_bt.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/ipmi/ipmi.h"
 #include "hw/isa/isa.h"
diff --git a/hw/ipmi/isa_ipmi_kcs.c b/hw/ipmi/isa_ipmi_kcs.c
index 9841b7f..2742ce0 100644
--- a/hw/ipmi/isa_ipmi_kcs.c
+++ b/hw/ipmi/isa_ipmi_kcs.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/ipmi/ipmi.h"
 #include "hw/isa/isa.h"
diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index c3b7388..7aa115c 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -17,6 +17,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "monitor/monitor.h"
 #include "hw/sysbus.h"
diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c
index 6b5c7a2..c3ebf3e 100644
--- a/hw/isa/pc87312.c
+++ b/hw/isa/pc87312.c
@@ -25,6 +25,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/isa/pc87312.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c
index 85f7277..c00cc70 100644
--- a/hw/m68k/an5206.c
+++ b/hw/m68k/an5206.c
@@ -7,6 +7,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/m68k/mcf.h"
 #include "hw/boards.h"
diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
index 4f49d34..67c3bb6 100644
--- a/hw/m68k/mcf5208.c
+++ b/hw/m68k/mcf5208.c
@@ -6,6 +6,7 @@
  * This code is licensed under the GPL
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/m68k/mcf.h"
 #include "qemu/timer.h"
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 650f0f8..6f25abb 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/mem/pc-dimm.h"
+#include "qapi/error.h"
 #include "qemu/config-file.h"
 #include "qapi/visitor.h"
 #include "qemu/range.h"
diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c
index 85e974b..4505d18 100644
--- a/hw/microblaze/petalogix_ml605_mmu.c
+++ b/hw/microblaze/petalogix_ml605_mmu.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "net/net.h"
diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c
index 606ba1f..bf19ad7 100644
--- a/hw/microblaze/petalogix_s3adsp1800_mmu.c
+++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "net/net.h"
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index 4e5581b..bdb716e 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "hw/char/serial.h"
diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
index 1ecff44..23b2dca 100644
--- a/hw/mips/mips_mipssim.c
+++ b/hw/mips/mips_mipssim.c
@@ -25,6 +25,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/mips/mips.h"
 #include "hw/mips/cpudevs.h"
diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index 724b1e9..0ef2fb1 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -8,6 +8,7 @@
  * the standard PC ISA addresses.
 */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/mips/mips.h"
 #include "hw/mips/cpudevs.h"
diff --git a/hw/misc/bcm2835_mbox.c b/hw/misc/bcm2835_mbox.c
index 106585a..263280f 100644
--- a/hw/misc/bcm2835_mbox.c
+++ b/hw/misc/bcm2835_mbox.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/misc/bcm2835_mbox.h"
 
 #define MAIL0_PEEK   0x90
diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c
index 41fbbe3..37e5f6a 100644
--- a/hw/misc/bcm2835_property.c
+++ b/hw/misc/bcm2835_property.c
@@ -4,6 +4,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/misc/bcm2835_property.h"
 #include "hw/misc/bcm2835_mbox_defs.h"
 #include "sysemu/dma.h"
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 1838bc8..55071dc 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -17,6 +17,7 @@
  * GNU GPL, version 2 or (at your option) any later version.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "hw/pci/pci.h"
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index 42325bf..6e94e3b 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/ppc/mac.h"
 #include "hw/pci/pci.h"
diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c
index b53f6ba..f5c2472 100644
--- a/hw/misc/tmp105.c
+++ b/hw/misc/tmp105.c
@@ -22,6 +22,7 @@
 #include "hw/hw.h"
 #include "hw/i2c/i2c.h"
 #include "tmp105.h"
+#include "qapi/error.h"
 #include "qapi/visitor.h"
 
 static void tmp105_interrupt_update(TMP105State *s)
diff --git a/hw/moxie/moxiesim.c b/hw/moxie/moxiesim.c
index d88c942..800c7cc 100644
--- a/hw/moxie/moxiesim.c
+++ b/hw/moxie/moxiesim.c
@@ -25,6 +25,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
index e847b77..819743e 100644
--- a/hw/net/dp8393x.c
+++ b/hw/net/dp8393x.c
@@ -21,6 +21,7 @@
 #include "hw/sysbus.h"
 #include "hw/devices.h"
 #include "net/net.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include <zlib.h>
 
diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c
index d35d39a..f01e804 100644
--- a/hw/net/milkymist-minimac2.c
+++ b/hw/net/milkymist-minimac2.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "trace.h"
diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c
index 8dca7c9..a7f5a94 100644
--- a/hw/net/ne2000-isa.c
+++ b/hw/net/ne2000-isa.c
@@ -29,6 +29,7 @@
 #include "net/net.h"
 #include "ne2000.h"
 #include "exec/address-spaces.h"
+#include "qapi/error.h"
 #include "qapi/visitor.h"
 
 #define TYPE_ISA_NE2000 "ne2k_isa"
diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c
index 2deb8ce..de23ab5 100644
--- a/hw/net/xilinx_axienet.c
+++ b/hw/net/xilinx_axienet.c
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
+#include "qapi/error.h"
 #include "qemu/log.h"
 #include "net/net.h"
 #include "net/checksum.h"
diff --git a/hw/nvram/spapr_nvram.c b/hw/nvram/spapr_nvram.c
index 32d5a36..2ca427b 100644
--- a/hw/nvram/spapr_nvram.c
+++ b/hw/nvram/spapr_nvram.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include <libfdt.h>
 
 #include "sysemu/block-backend.h"
diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c
index 46418c3..7967cfb 100644
--- a/hw/openrisc/openrisc_sim.c
+++ b/hw/openrisc/openrisc_sim.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "elf.h"
diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
index 100bb5e..a4d3730 100644
--- a/hw/pci-bridge/pci_bridge_dev.c
+++ b/hw/pci-bridge/pci_bridge_dev.c
@@ -20,6 +20,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pci_ids.h"
 #include "hw/pci/msi.h"
diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
index 41aa66f..df2b0e2 100644
--- a/hw/pci-host/piix.c
+++ b/hw/pci-host/piix.c
@@ -29,6 +29,7 @@
 #include "hw/pci/pci_host.h"
 #include "hw/isa/isa.h"
 #include "hw/sysbus.h"
+#include "qapi/error.h"
 #include "qemu/range.h"
 #include "hw/xen/xen.h"
 #include "hw/pci-host/pam.h"
diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c
index 49cdaab..487e32e 100644
--- a/hw/pci-host/prep.c
+++ b/hw/pci-host/prep.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bus.h"
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 115fb8c..70f897e 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -30,6 +30,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/pci-host/q35.h"
+#include "qapi/error.h"
 #include "qapi/visitor.h"
 
 /****************************************************************************
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 4aca0c5..728386a 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pcie.h"
diff --git a/hw/pci/shpc.c b/hw/pci/shpc.c
index aef8384..3dcd472 100644
--- a/hw/pci/shpc.c
+++ b/hw/pci/shpc.c
@@ -1,4 +1,5 @@
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/range.h"
 #include "qemu/error-report.h"
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 09154fa..ee1c60b 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -15,6 +15,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "e500.h"
 #include "e500-ccsr.h"
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index f0a36b3..1086f88 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -47,6 +47,7 @@
  *
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/ppc/ppc.h"
 #include "hw/ppc/mac.h"
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index d952713..9bfa02e 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -24,6 +24,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/ppc/ppc.h"
 #include "mac.h"
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 6797808..1d51587 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/ppc/ppc.h"
 #include "ppc405.h"
diff --git a/hw/ppc/ppc405_uc.c b/hw/ppc/ppc405_uc.c
index ec81f65..4f9aebc 100644
--- a/hw/ppc/ppc405_uc.c
+++ b/hw/ppc/ppc405_uc.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/ppc/ppc.h"
 #include "hw/boards.h"
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 64c4acc..e409276 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -25,6 +25,7 @@
  *
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/numa.h"
 #include "hw/hw.h"
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index ef063c0..b94b44a 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/ppc/spapr_drc.h"
 #include "qom/object.h"
 #include "hw/qdev.h"
diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c
index 39f4682..61204f0 100644
--- a/hw/ppc/spapr_events.c
+++ b/hw/ppc/spapr_events.c
@@ -25,6 +25,7 @@
  *
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/char.h"
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 1733482..fb448fb 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -1,4 +1,5 @@
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "sysemu/sysemu.h"
 #include "cpu.h"
 #include "helper_regs.h"
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index e8edad3..b18d88f 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "hw/pci/pci.h"
diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c
index 2f3752e..ad0ab21 100644
--- a/hw/ppc/spapr_pci_vfio.c
+++ b/hw/ppc/spapr_pci_vfio.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/ppc/spapr.h"
 #include "hw/pci-host/spapr.h"
 #include "hw/pci/msix.h"
diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c
index a39d472..f511382 100644
--- a/hw/ppc/spapr_rng.c
+++ b/hw/ppc/spapr_rng.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/device_tree.h"
diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c
index 0f61a55..8aa021f 100644
--- a/hw/ppc/spapr_vio.c
+++ b/hw/ppc/spapr_vio.c
@@ -20,6 +20,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
index 85be24d..34b2faf 100644
--- a/hw/s390x/event-facility.c
+++ b/hw/s390x/event-facility.c
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "sysemu/sysemu.h"
 
 #include "hw/s390x/sclp.h"
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 41ff002..f104200 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "sysemu/sysemu.h"
 #include "cpu.h"
 #include "elf.h"
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 3d8c3c4..8b62b19 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -10,6 +10,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/boards.h"
 #include "exec/address-spaces.h"
 #include "s390-virtio.h"
diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c
index 7c6e281..544c616 100644
--- a/hw/s390x/s390-virtio.c
+++ b/hw/s390x/s390-virtio.c
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/error-report.h"
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index c8cc732..85dbe1b 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "sysemu/kvm.h"
 #include "exec/memory.h"
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index cb887ba..d51642d 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
index 1de7706..595f88b 100644
--- a/hw/scsi/esp-pci.c
+++ b/hw/scsi/esp-pci.c
@@ -28,6 +28,7 @@
 #include "hw/nvram/eeprom93xx.h"
 #include "hw/scsi/esp.h"
 #include "trace.h"
+#include "qapi/error.h"
 #include "qemu/log.h"
 
 #define TYPE_AM53C974_DEVICE "am53c974"
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index e55c32c..8961be2 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -27,6 +27,7 @@
 #include "hw/sysbus.h"
 #include "hw/scsi/esp.h"
 #include "trace.h"
+#include "qapi/error.h"
 #include "qemu/log.h"
 
 /*
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index a21752b..a5ad3c7 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -1,5 +1,6 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "hw/scsi/scsi.h"
 #include "block/scsi.h"
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 469aec2..96c7953 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -29,6 +29,7 @@ do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0)
 #endif
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "hw/scsi/scsi.h"
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index f8a1ff2..7459465 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "hw/scsi/scsi.h"
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index c86622c..97a0dd1 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -15,6 +15,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include <sys/ioctl.h>
 #include "qemu/error-report.h"
 #include "qemu/queue.h"
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 0c30d2e..ade4972 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -14,6 +14,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "standard-headers/linux/virtio_ids.h"
 #include "hw/virtio/virtio-scsi.h"
 #include "qemu/error-report.h"
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index 9abc086..e690b4e 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/scsi/scsi.h"
 #include <block/scsi.h>
 #include "hw/pci/msi.h"
diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c
index 9c3679b..3deccf0 100644
--- a/hw/sd/pxa2xx_mmci.c
+++ b/hw/sd/pxa2xx_mmci.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/sysbus.h"
 #include "hw/arm/pxa.h"
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 00c320d..3389fcc 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -34,6 +34,7 @@
 #include "hw/hw.h"
 #include "sysemu/block-backend.h"
 #include "hw/sd/sd.h"
+#include "qapi/error.h"
 #include "qemu/bitmap.h"
 #include "hw/qdev-properties.h"
 #include "qemu/error-report.h"
diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
index 7d9a1cd..90672ac 100644
--- a/hw/sh4/r2d.c
+++ b/hw/sh4/r2d.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "hw/sh4/sh.h"
diff --git a/hw/sh4/shix.c b/hw/sh4/shix.c
index 386a485..986bd29 100644
--- a/hw/sh4/shix.c
+++ b/hw/sh4/shix.c
@@ -28,6 +28,7 @@
    More information in target-sh4/README.sh4
 */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/sh4/sh.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 3b5f9bd..b688b94 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index c579f5b..9f085ec 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "qemu/timer.h"
 #include "hw/ptimer.h"
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index eebef37..28182c3 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 0a6f453..2e03a28 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "hw/pci-host/apb.h"
diff --git a/hw/timer/a9gtimer.c b/hw/timer/a9gtimer.c
index fa4602c..afe577c 100644
--- a/hw/timer/a9gtimer.c
+++ b/hw/timer/a9gtimer.c
@@ -22,6 +22,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/timer/a9gtimer.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "qemu/bitops.h"
 #include "qemu/log.h"
diff --git a/hw/timer/arm_mptimer.c b/hw/timer/arm_mptimer.c
index 2bdaf42..d66bbf0 100644
--- a/hw/timer/arm_mptimer.c
+++ b/hw/timer/arm_mptimer.c
@@ -21,6 +21,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/timer/arm_mptimer.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "qom/cpu.h"
 
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index 0ad5420..78140e6 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -28,6 +28,7 @@
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "ui/console.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "hw/timer/hpet.h"
diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c
index bbcfeb2..c4db0e6 100644
--- a/hw/timer/m48t59.c
+++ b/hw/timer/m48t59.c
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/timer/m48t59.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "hw/sysbus.h"
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index c1c3d4d..381e726 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -31,6 +31,7 @@
 #include "hw/i386/pc.h"
 #include "hw/pci/pci_ids.h"
 #include "tpm_tis.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/main-loop.h"
 #include "sysemu/tpm_backend.h"
diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c
index 3cadb65..858040a 100644
--- a/hw/tricore/tricore_testboard.c
+++ b/hw/tricore/tricore_testboard.c
@@ -19,6 +19,7 @@
 
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/devices.h"
 #include "net/net.h"
diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
index 4522fa2..d2933cb 100644
--- a/hw/unicore32/puv3.c
+++ b/hw/unicore32/puv3.c
@@ -10,6 +10,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "ui/console.h"
 #include "elf.h"
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 4452bdb..a9a6f9e 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -2,6 +2,7 @@
 #include "hw/hw.h"
 #include "hw/usb.h"
 #include "hw/qdev.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "sysemu/sysemu.h"
 #include "monitor/monitor.h"
diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c
index 40f38ad..24d05f7 100644
--- a/hw/usb/dev-hid.c
+++ b/hw/usb/dev-hid.c
@@ -27,6 +27,7 @@
 #include "ui/console.h"
 #include "hw/usb.h"
 #include "hw/usb/desc.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "hw/input/hid.h"
 
diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c
index 64acdb0..a33f21c 100644
--- a/hw/usb/dev-hub.c
+++ b/hw/usb/dev-hub.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "trace.h"
 #include "hw/usb.h"
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 7391783..0be4135 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -16,6 +16,7 @@
 #include <sys/statvfs.h>
 #ifdef __linux__
 #include <sys/inotify.h>
+#include "qapi/error.h"
 #include "qemu/main-loop.h"
 #endif
 
diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c
index c6abd38..b183caf 100644
--- a/hw/usb/dev-network.c
+++ b/hw/usb/dev-network.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "hw/usb.h"
 #include "hw/usb/desc.h"
diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c
index afad1db..ff4b0c5 100644
--- a/hw/usb/dev-serial.c
+++ b/hw/usb/dev-serial.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "hw/usb.h"
diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
index 96a1a13..af4b851 100644
--- a/hw/usb/dev-smartcard-reader.c
+++ b/hw/usb/dev-smartcard-reader.c
@@ -35,6 +35,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "hw/usb.h"
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index 5ae0424..284024e 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/option.h"
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 1b50601..f598937 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -28,6 +28,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/usb/ehci-regs.h"
 #include "hw/usb/hcd-ehci.h"
 #include "trace.h"
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 17ed461..f3dc26b 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -27,6 +27,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/hw.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "hw/usb.h"
 #include "hw/pci/pci.h"
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index c370240..6521418 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -30,6 +30,7 @@
 #include "hw/usb.h"
 #include "hw/usb/uhci-regs.h"
 #include "hw/pci/pci.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "qemu/iov.h"
 #include "sysemu/dma.h"
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 5e7ec45..6458a94 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -37,6 +37,7 @@
 #include <poll.h>
 #include <libusb.h>
 
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "monitor/monitor.h"
 #include "qemu/error-report.h"
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 38a5393..dbcc5a7 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
index a2ab75d..1798a00 100644
--- a/hw/vfio/platform.c
+++ b/hw/vfio/platform.c
@@ -15,6 +15,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include <sys/ioctl.h>
 #include <linux/vfio.h>
 
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 7ed3dd9..5914e85 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/virtio/vhost.h"
 #include "hw/virtio/vhost-backend.h"
 #include "hw/virtio/virtio-net.h"
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 392d848..4400718 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -14,6 +14,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "hw/virtio/vhost.h"
 #include "hw/hw.h"
 #include "qemu/atomic.h"
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 440776c..5e371a2 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -26,6 +26,7 @@
 #include "hw/virtio/virtio-balloon.h"
 #include "hw/virtio/virtio-input.h"
 #include "hw/pci/pci.h"
+#include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c
index d713464..6b991a7 100644
--- a/hw/virtio/virtio-rng.c
+++ b/hw/virtio/virtio-rng.c
@@ -10,6 +10,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/iov.h"
 #include "hw/qdev.h"
 #include "hw/virtio/virtio.h"
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 08275a9..8ce19a0 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 
 #include "trace.h"
 #include "exec/address-spaces.h"
diff --git a/hw/xen/xen-host-pci-device.c b/hw/xen/xen-host-pci-device.c
index 9666fff..4005d6a 100644
--- a/hw/xen/xen-host-pci-device.c
+++ b/hw/xen/xen-host-pci-device.c
@@ -7,6 +7,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "xen-host-pci-device.h"
 
diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index 657bf6c..f593b04 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -53,6 +53,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include <sys/ioctl.h>
 
 #include "hw/pci/pci.h"
diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c
index 1b48f19..9869ffd 100644
--- a/hw/xen/xen_pt_config_init.c
+++ b/hw/xen/xen_pt_config_init.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "hw/xen/xen_backend.h"
 #include "xen_pt.h"
diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c
index 71e745f..0f4c8d7 100644
--- a/hw/xen/xen_pt_graphics.c
+++ b/hw/xen/xen_pt_graphics.c
@@ -2,6 +2,7 @@
  * graphics passthrough
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "xen_pt.h"
 #include "xen-host-pci-device.h"
 #include "hw/xen/xen_backend.h"
diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c
index 23050e8..0967aa6 100644
--- a/hw/xtensa/sim.c
+++ b/hw/xtensa/sim.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index ed09b9d..d61ec05 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "hw/loader.h"
diff --git a/include/qapi/error.h b/include/qapi/error.h
index 02e9dd2..11be232 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -118,11 +118,6 @@
 #include "qapi-types.h"
 
 /*
- * Opaque error object.
- */
-typedef struct Error Error;
-
-/*
  * Overall category of an error.
  * Based on the qapi type QapiErrorClass, but reproduced here for nicer
  * enum names.
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 4538fdc..1c0ce4a 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -7,8 +7,10 @@
  *
  * To avoid getting into possible circular include dependencies, this
  * file should not include any other QEMU headers, with the exceptions
- * of config-host.h, compiler.h, os-posix.h and os-win32.h, all of which
- * are doing a similar job to this file and are under similar constraints.
+ * of config-host.h, config-target.h, qemu/compiler.h,
+ * sysemu/os-posix.h, sysemu/os-win32.h, glib-compat.h and
+ * qemu/typedefs.h, all of which are doing a similar job to this file
+ * and are under similar constraints.
  *
  * This header also contains prototypes for functions defined in
  * os-*.c and util/oslib-*.c; those would probably be better split
@@ -98,8 +100,7 @@ extern int daemon(int, int);
 #endif
 
 #include "glib-compat.h"
-
-#include "qapi/error.h"
+#include "qemu/typedefs.h"
 
 #ifndef O_LARGEFILE
 #define O_LARGEFILE 0
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 9a5ead6..099146e 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -25,6 +25,7 @@ typedef struct DisplayChangeListener DisplayChangeListener;
 typedef struct DisplayState DisplayState;
 typedef struct DisplaySurface DisplaySurface;
 typedef struct DriveInfo DriveInfo;
+typedef struct Error Error;
 typedef struct EventNotifier EventNotifier;
 typedef struct FWCfgIoState FWCfgIoState;
 typedef struct FWCfgMemState FWCfgMemState;
diff --git a/include/qom/object.h b/include/qom/object.h
index eda16df..0eba22e 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -15,6 +15,7 @@
 #define QEMU_OBJECT_H
 
 #include <glib.h>
+#include "qapi-types.h"
 #include "qemu/queue.h"
 #include "qemu/typedefs.h"
 
diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h
index 2dabe49..904501a 100644
--- a/include/ui/qemu-spice.h
+++ b/include/ui/qemu-spice.h
@@ -23,6 +23,7 @@
 
 #include <spice.h>
 
+#include "qapi/error.h"
 #include "qemu/option.h"
 #include "qemu/config-file.h"
 
diff --git a/io/channel-command.c b/io/channel-command.c
index 604514a..ad25313 100644
--- a/io/channel-command.c
+++ b/io/channel-command.c
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "io/channel-command.h"
 #include "io/channel-watch.h"
+#include "qapi/error.h"
 #include "qemu/sockets.h"
 #include "trace.h"
 
diff --git a/io/channel-file.c b/io/channel-file.c
index f28e2b0..e1da243 100644
--- a/io/channel-file.c
+++ b/io/channel-file.c
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "io/channel-file.h"
 #include "io/channel-watch.h"
+#include "qapi/error.h"
 #include "qemu/sockets.h"
 #include "trace.h"
 
diff --git a/io/channel-socket.c b/io/channel-socket.c
index d005070..ca8bc20 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "io/channel-socket.h"
 #include "io/channel-watch.h"
 #include "trace.h"
diff --git a/io/channel-tls.c b/io/channel-tls.c
index 7608fd9..9a8525c 100644
--- a/io/channel-tls.c
+++ b/io/channel-tls.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "io/channel-tls.h"
 #include "trace.h"
 
diff --git a/io/channel-websock.c b/io/channel-websock.c
index 35860a2..7081787 100644
--- a/io/channel-websock.c
+++ b/io/channel-websock.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "io/channel-websock.h"
 #include "crypto/hash.h"
 #include "trace.h"
diff --git a/io/channel.c b/io/channel.c
index dd6fc0e..692eb17 100644
--- a/io/channel.c
+++ b/io/channel.c
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "io/channel.h"
+#include "qapi/error.h"
 #include "qemu/coroutine.h"
 
 bool qio_channel_has_feature(QIOChannel *ioc,
diff --git a/io/task.c b/io/task.c
index bf1a333..c7f97a9 100644
--- a/io/task.c
+++ b/io/task.c
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "io/task.h"
+#include "qapi/error.h"
 #include "qemu/thread.h"
 #include "trace.h"
 
diff --git a/iohandler.c b/iohandler.c
index 0abb4a7..3f23433 100644
--- a/iohandler.c
+++ b/iohandler.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/queue.h"
 #include "block/aio.h"
diff --git a/main-loop.c b/main-loop.c
index 19beae7..4336a59 100644
--- a/main-loop.c
+++ b/main-loop.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.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 9f5c458..44bf93e 100644
--- a/memory.c
+++ b/memory.c
@@ -14,6 +14,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "exec/memory.h"
 #include "exec/address-spaces.h"
 #include "exec/ioport.h"
diff --git a/memory_mapping.c b/memory_mapping.c
index c8855de..2354b2b 100644
--- a/memory_mapping.c
+++ b/memory_mapping.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include <glib.h>
 
 #include "qemu-common.h"
diff --git a/migration/block.c b/migration/block.c
index 72883d7..af8e16d 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -14,6 +14,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "block/block.h"
 #include "qemu/error-report.h"
diff --git a/migration/exec.c b/migration/exec.c
index 62f892d..5594209 100644
--- a/migration/exec.c
+++ b/migration/exec.c
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/sockets.h"
 #include "qemu/main-loop.h"
diff --git a/migration/fd.c b/migration/fd.c
index 085dd7c..3d788bb 100644
--- a/migration/fd.c
+++ b/migration/fd.c
@@ -14,6 +14,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/main-loop.h"
 #include "qemu/sockets.h"
diff --git a/migration/rdma.c b/migration/rdma.c
index bcae1e8..0601d52 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -12,6 +12,7 @@
  *
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "migration/migration.h"
 #include "migration/qemu-file.h"
diff --git a/nbd/client.c b/nbd/client.c
index 9e5b651..f89c0a1 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -17,6 +17,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.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 bde673a..a44718c 100644
--- a/nbd/common.c
+++ b/nbd/common.c
@@ -17,6 +17,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "nbd-internal.h"
 
 ssize_t nbd_wr_syncv(QIOChannel *ioc,
diff --git a/nbd/server.c b/nbd/server.c
index d4225cd..b95571b 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -17,6 +17,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "nbd-internal.h"
 
 static int system_errno_to_nbd_errno(int err)
diff --git a/net/dump.c b/net/dump.c
index 61dec9d..b2bf1bc 100644
--- a/net/dump.c
+++ b/net/dump.c
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "clients.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/iov.h"
diff --git a/net/filter-buffer.c b/net/filter-buffer.c
index 972177b..cc6bd94 100644
--- a/net/filter-buffer.c
+++ b/net/filter-buffer.c
@@ -9,6 +9,7 @@
 #include "qemu/osdep.h"
 #include "net/filter.h"
 #include "net/queue.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/timer.h"
 #include "qemu/iov.h"
diff --git a/net/filter.c b/net/filter.c
index a08ef68..1c4fc5a 100644
--- a/net/filter.c
+++ b/net/filter.c
@@ -7,6 +7,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/error-report.h"
diff --git a/net/socket.c b/net/socket.c
index 73dc49a..df404a6 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -26,6 +26,7 @@
 #include "net/net.h"
 #include "clients.h"
 #include "monitor/monitor.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/option.h"
diff --git a/net/tap-linux.c b/net/tap-linux.c
index 0929cf7..8077d2b 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -32,6 +32,7 @@
 #include <sys/ioctl.h>
 
 #include "sysemu/sysemu.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 
diff --git a/net/tap.c b/net/tap.c
index cd7a7fc..553fd9e 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -36,6 +36,7 @@
 #include "clients.h"
 #include "monitor/monitor.h"
 #include "sysemu/sysemu.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 
diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
index 73e4ace..5e2b883 100644
--- a/qapi/opts-visitor.c
+++ b/qapi/opts-visitor.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qapi/qmp/qerror.h"
 #include "qapi/opts-visitor.h"
diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c
index 8afb12e..818730a 100644
--- a/qapi/qapi-util.c
+++ b/qapi/qapi-util.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qapi/util.h"
 
diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c
index 856606b..fa680c9 100644
--- a/qapi/qapi-visit-core.c
+++ b/qapi/qapi-visit-core.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.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 8f27c34..510a1ae 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qapi/qmp/types.h"
 #include "qapi/qmp/dispatch.h"
 #include "qapi/qmp/json-parser.h"
diff --git a/qapi/qmp-input-visitor.c b/qapi/qmp-input-visitor.c
index e659832..7cd1b77 100644
--- a/qapi/qmp-input-visitor.c
+++ b/qapi/qmp-input-visitor.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qapi/qmp-input-visitor.h"
 #include "qapi/visitor-impl.h"
 #include "qemu/queue.h"
diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c
index 59eb5dc..ab12953 100644
--- a/qapi/string-input-visitor.c
+++ b/qapi/string-input-visitor.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qapi/string-input-visitor.h"
 #include "qapi/visitor-impl.h"
diff --git a/qemu-img.c b/qemu-img.c
index 2edb139..abd14cd 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qapi-visit.h"
 #include "qapi/qmp-output-visitor.h"
 #include "qapi/qmp/qerror.h"
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index e929d24..13fbb59 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-io.h"
 #include "sysemu/block-backend.h"
 #include "block/block.h"
diff --git a/qemu-io.c b/qemu-io.c
index 8c31257..f5b3058 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -11,6 +11,7 @@
 #include <getopt.h>
 #include <libgen.h>
 
+#include "qapi/error.h"
 #include "qemu-io.h"
 #include "qemu/error-report.h"
 #include "qemu/main-loop.h"
diff --git a/qemu-nbd.c b/qemu-nbd.c
index a5c1d95..4cf9b9e 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -17,6 +17,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "sysemu/block-backend.h"
 #include "block/block_int.h"
diff --git a/qga/channel-posix.c b/qga/channel-posix.c
index 7ad3c00..63458c6 100644
--- a/qga/channel-posix.c
+++ b/qga/channel-posix.c
@@ -1,6 +1,7 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 #include <termios.h>
+#include "qapi/error.h"
 #include "qemu/sockets.h"
 #include "qga/channel.h"
 
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index 6c05f6c..6e65b82 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -13,6 +13,7 @@
 
 #include "qemu/osdep.h"
 
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qapi/qmp/qstring.h"
 #include "qapi/qmp/qint.h"
diff --git a/qom/cpu.c b/qom/cpu.c
index c45d0bb..c9007d3 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qom/cpu.h"
 #include "sysemu/kvm.h"
diff --git a/qom/object.c b/qom/object.c
index 844ae7a..6a1f030 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.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 c2f6e29..ab5da35 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -1,4 +1,5 @@
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qom/object_interfaces.h"
 #include "qemu/module.h"
 #include "qapi-visit.h"
diff --git a/qom/qom-qobject.c b/qom/qom-qobject.c
index 9cbc4c6..e6b17c1 100644
--- a/qom/qom-qobject.c
+++ b/qom/qom-qobject.c
@@ -10,6 +10,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qom/object.h"
 #include "qom/qom-qobject.h"
diff --git a/qtest.c b/qtest.c
index 58a7732..87575bc 100644
--- a/qtest.c
+++ b/qtest.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "sysemu/qtest.h"
 #include "hw/qdev.h"
 #include "sysemu/char.h"
diff --git a/replay/replay-input.c b/replay/replay-input.c
index c38af50..43afc78 100644
--- a/replay/replay-input.c
+++ b/replay/replay-input.c
@@ -10,6 +10,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "sysemu/replay.h"
 #include "replay-internal.h"
diff --git a/replay/replay.c b/replay/replay.c
index f8739c2..8debb11 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -10,6 +10,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "sysemu/replay.h"
 #include "replay-internal.h"
diff --git a/scripts/clean-includes b/scripts/clean-includes
index a1faa60..2ae3b43 100755
--- a/scripts/clean-includes
+++ b/scripts/clean-includes
@@ -140,12 +140,13 @@ for f in "$@"; do
   # Remove includes that osdep.h already provides
   perl -n -i -e 'print if !/\s*#\s*include\s*(["<][^>"]*[">])/ ||
                           ! (grep { $_ eq $1 } qw (
-           "config-host.h" "qemu/compiler.h" "config.h"
+           "config-host.h" "config-target.h" "qemu/compiler.h"
            <stdarg.h> <stddef.h> <stdbool.h> <stdint.h> <sys/types.h>
            <stdlib.h> <stdio.h> <string.h> <strings.h> <inttypes.h>
            <limits.h> <unistd.h> <time.h> <ctype.h> <errno.h> <fcntl.h>
            <sys/stat.h> <sys/time.h> <assert.h> <signal.h>
-           "glib-compat.h" "qapi/error.h"
+           "sysemu/os-posix.h, sysemu/os-win32.h "glib-compat.h"
+           "qemu/typedefs.h"
             ))' "$f"
 
 done
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index a712e9a..8e89256 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -353,6 +353,7 @@ h_comment = '''
 fdef.write(mcgen('''
 #include "qemu/osdep.h"
 #include "qemu-common.h"
+#include "qapi/error.h"
 #include "%(prefix)sqapi-visit.h"
 ''',
                  prefix=prefix))
diff --git a/stubs/get-fd.c b/stubs/get-fd.c
index 85881fb..7dfdfb5 100644
--- a/stubs/get-fd.c
+++ b/stubs/get-fd.c
@@ -1,4 +1,5 @@
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "monitor/monitor.h"
 
diff --git a/target-alpha/cpu.c b/target-alpha/cpu.c
index 2eab060..8a155ca 100644
--- a/target-alpha/cpu.c
+++ b/target-alpha/cpu.c
@@ -20,6 +20,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 #include "migration/vmstate.h"
diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index 352d9f8..e48e83a 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "internals.h"
 #include "qemu-common.h"
diff --git a/target-arm/cpu64.c b/target-arm/cpu64.c
index fa5eda2..1635deb 100644
--- a/target-arm/cpu64.c
+++ b/target-arm/cpu64.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 #if !defined(CONFIG_USER_ONLY)
diff --git a/target-cris/cpu.c b/target-cris/cpu.c
index b2c8624..1cb79dd 100644
--- a/target-cris/cpu.c
+++ b/target-cris/cpu.c
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 #include "mmu.h"
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 7974acb..940b494 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 #include <sys/utsname.h>
diff --git a/target-lm32/cpu.c b/target-lm32/cpu.c
index f93bb5d..6e7e1b8 100644
--- a/target-lm32/cpu.c
+++ b/target-lm32/cpu.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 
diff --git a/target-m68k/cpu.c b/target-m68k/cpu.c
index 6de74bf..0b5f9a5 100644
--- a/target-m68k/cpu.c
+++ b/target-m68k/cpu.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 #include "migration/vmstate.h"
diff --git a/target-microblaze/cpu.c b/target-microblaze/cpu.c
index 7a42897..fdfb019 100644
--- a/target-microblaze/cpu.c
+++ b/target-microblaze/cpu.c
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 #include "hw/qdev-properties.h"
diff --git a/target-mips/cpu.c b/target-mips/cpu.c
index 7dc3a44..0e2ecbe 100644
--- a/target-mips/cpu.c
+++ b/target-mips/cpu.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "kvm_mips.h"
 #include "qemu-common.h"
diff --git a/target-moxie/cpu.c b/target-moxie/cpu.c
index b33c2b3..b4ee84e 100644
--- a/target-moxie/cpu.c
+++ b/target-moxie/cpu.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 #include "migration/vmstate.h"
diff --git a/target-openrisc/cpu.c b/target-openrisc/cpu.c
index cafc07f..ae6ed9e 100644
--- a/target-openrisc/cpu.c
+++ b/target-openrisc/cpu.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 
diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c
index 1cbf703..9746b1d 100644
--- a/target-s390x/cpu.c
+++ b/target-s390x/cpu.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 #include "qemu/timer.h"
diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index 76d5fbe..92abe7e 100644
--- a/target-s390x/helper.c
+++ b/target-s390x/helper.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "exec/gdbstub.h"
 #include "qemu/timer.h"
diff --git a/target-sh4/cpu.c b/target-sh4/cpu.c
index 8621d70..86ba388 100644
--- a/target-sh4/cpu.c
+++ b/target-sh4/cpu.c
@@ -20,6 +20,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 #include "migration/vmstate.h"
diff --git a/target-sparc/cpu.c b/target-sparc/cpu.c
index ce903f8..fe4119e 100644
--- a/target-sparc/cpu.c
+++ b/target-sparc/cpu.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu/error-report.h"
 
diff --git a/target-tilegx/cpu.c b/target-tilegx/cpu.c
index eceeb2c..d2d0912 100644
--- a/target-tilegx/cpu.c
+++ b/target-tilegx/cpu.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 #include "hw/qdev-properties.h"
diff --git a/target-tricore/cpu.c b/target-tricore/cpu.c
index f8b8518..69fca8c 100644
--- a/target-tricore/cpu.c
+++ b/target-tricore/cpu.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 
diff --git a/target-unicore32/cpu.c b/target-unicore32/cpu.c
index c92ccc4..66f43ac 100644
--- a/target-unicore32/cpu.c
+++ b/target-unicore32/cpu.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 #include "migration/vmstate.h"
diff --git a/target-xtensa/cpu.c b/target-xtensa/cpu.c
index d572d56..01b251f 100644
--- a/target-xtensa/cpu.c
+++ b/target-xtensa/cpu.c
@@ -29,6 +29,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "cpu.h"
 #include "qemu-common.h"
 #include "migration/vmstate.h"
diff --git a/tests/check-qom-proplist.c b/tests/check-qom-proplist.c
index a2bb556..ffffd87 100644
--- a/tests/check-qom-proplist.c
+++ b/tests/check-qom-proplist.c
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 
+#include "qapi/error.h"
 #include "qom/object.h"
 #include "qemu/module.h"
 
diff --git a/tests/io-channel-helpers.c b/tests/io-channel-helpers.c
index a4dedbe..05e5579 100644
--- a/tests/io-channel-helpers.c
+++ b/tests/io-channel-helpers.c
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "io-channel-helpers.h"
+#include "qapi/error.h"
 
 struct QIOChannelTest {
     QIOChannel *src;
diff --git a/tests/test-aio.c b/tests/test-aio.c
index a109bd0..687dfa0 100644
--- a/tests/test-aio.c
+++ b/tests/test-aio.c
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 #include "block/aio.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "qemu/sockets.h"
 #include "qemu/error-report.h"
diff --git a/tests/test-base64.c b/tests/test-base64.c
index ae0c107..922e839 100644
--- a/tests/test-base64.c
+++ b/tests/test-base64.c
@@ -21,9 +21,9 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 
+#include "qapi/error.h"
 #include "qemu/base64.h"
 
-
 static void test_base64_good(void)
 {
     const char input[] =
diff --git a/tests/test-blockjob-txn.c b/tests/test-blockjob-txn.c
index c866da6..55fad95 100644
--- a/tests/test-blockjob-txn.c
+++ b/tests/test-blockjob-txn.c
@@ -12,6 +12,7 @@
 
 #include "qemu/osdep.h"
 #include <glib.h>
+#include "qapi/error.h"
 #include "qemu/main-loop.h"
 #include "block/blockjob.h"
 
diff --git a/tests/test-crypto-cipher.c b/tests/test-crypto-cipher.c
index 9f912ec..5770ba5 100644
--- a/tests/test-crypto-cipher.c
+++ b/tests/test-crypto-cipher.c
@@ -23,6 +23,7 @@
 
 #include "crypto/init.h"
 #include "crypto/cipher.h"
+#include "qapi/error.h"
 
 typedef struct QCryptoCipherTestData QCryptoCipherTestData;
 struct QCryptoCipherTestData {
diff --git a/tests/test-crypto-secret.c b/tests/test-crypto-secret.c
index 2bbc4d9..43e2952 100644
--- a/tests/test-crypto-secret.c
+++ b/tests/test-crypto-secret.c
@@ -23,6 +23,7 @@
 
 #include "crypto/init.h"
 #include "crypto/secret.h"
+#include "qapi/error.h"
 
 static void test_secret_direct(void)
 {
diff --git a/tests/test-crypto-tlscredsx509.c b/tests/test-crypto-tlscredsx509.c
index 7ca387d..af2f80e 100644
--- a/tests/test-crypto-tlscredsx509.c
+++ b/tests/test-crypto-tlscredsx509.c
@@ -22,6 +22,7 @@
 
 #include "crypto-tls-x509-helpers.h"
 #include "crypto/tlscredsx509.h"
+#include "qapi/error.h"
 
 #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
 
diff --git a/tests/test-crypto-tlssession.c b/tests/test-crypto-tlssession.c
index 036a86b..1a4a066 100644
--- a/tests/test-crypto-tlssession.c
+++ b/tests/test-crypto-tlssession.c
@@ -24,6 +24,7 @@
 #include "crypto/tlscredsx509.h"
 #include "crypto/tlssession.h"
 #include "qom/object_interfaces.h"
+#include "qapi/error.h"
 #include "qemu/sockets.h"
 #include "qemu/acl.h"
 
diff --git a/tests/test-io-channel-command.c b/tests/test-io-channel-command.c
index 8855437..1d1f461 100644
--- a/tests/test-io-channel-command.c
+++ b/tests/test-io-channel-command.c
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include "io/channel-command.h"
 #include "io-channel-helpers.h"
+#include "qapi/error.h"
 
 #ifndef WIN32
 static void test_io_channel_command_fifo(bool async)
diff --git a/tests/test-io-channel-file.c b/tests/test-io-channel-file.c
index 1e7f3c7..6bfede6 100644
--- a/tests/test-io-channel-file.c
+++ b/tests/test-io-channel-file.c
@@ -22,7 +22,7 @@
 #include "io/channel-file.h"
 #include "io/channel-util.h"
 #include "io-channel-helpers.h"
-
+#include "qapi/error.h"
 
 static void test_io_channel_file(void)
 {
diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-socket.c
index ae665f5..d0664fb 100644
--- a/tests/test-io-channel-socket.c
+++ b/tests/test-io-channel-socket.c
@@ -22,6 +22,7 @@
 #include "io/channel-socket.h"
 #include "io/channel-util.h"
 #include "io-channel-helpers.h"
+#include "qapi/error.h"
 
 static int check_bind(struct sockaddr *sa, socklen_t salen, bool *has_proto)
 {
diff --git a/tests/test-io-task.c b/tests/test-io-task.c
index ae46c56..5a97750 100644
--- a/tests/test-io-task.c
+++ b/tests/test-io-task.c
@@ -22,6 +22,7 @@
 #include <glib.h>
 
 #include "io/task.h"
+#include "qapi/error.h"
 
 #define TYPE_DUMMY "qemu:dummy"
 
diff --git a/tests/test-opts-visitor.c b/tests/test-opts-visitor.c
index 297a02d..008e677 100644
--- a/tests/test-opts-visitor.c
+++ b/tests/test-opts-visitor.c
@@ -15,6 +15,7 @@
 
 #include "qemu/config-file.h"     /* qemu_add_opts() */
 #include "qemu/option.h"          /* qemu_opts_parse() */
+#include "qapi/error.h"
 #include "qapi/opts-visitor.h"    /* opts_visitor_new() */
 #include "test-qapi-visit.h"      /* visit_type_UserDefOptions() */
 
diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c
index 848374e..32abed5 100644
--- a/tests/test-qemu-opts.c
+++ b/tests/test-qemu-opts.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qapi/qmp/qstring.h"
 #include "qemu/config-file.h"
 
diff --git a/tests/test-qmp-input-strict.c b/tests/test-qmp-input-strict.c
index 6a33aa4..d71727e 100644
--- a/tests/test-qmp-input-strict.c
+++ b/tests/test-qmp-input-strict.c
@@ -15,6 +15,7 @@
 #include <glib.h>
 
 #include "qemu-common.h"
+#include "qapi/error.h"
 #include "qapi/qmp-input-visitor.h"
 #include "test-qapi-types.h"
 #include "test-qapi-visit.h"
diff --git a/tests/test-qmp-input-visitor.c b/tests/test-qmp-input-visitor.c
index b05da5b..dd247ea 100644
--- a/tests/test-qmp-input-visitor.c
+++ b/tests/test-qmp-input-visitor.c
@@ -14,6 +14,7 @@
 #include <glib.h>
 
 #include "qemu-common.h"
+#include "qapi/error.h"
 #include "qapi/qmp-input-visitor.h"
 #include "test-qapi-types.h"
 #include "test-qapi-visit.h"
diff --git a/tests/test-qmp-output-visitor.c b/tests/test-qmp-output-visitor.c
index a7f8b45..f211b21 100644
--- a/tests/test-qmp-output-visitor.c
+++ b/tests/test-qmp-output-visitor.c
@@ -14,6 +14,7 @@
 #include <glib.h>
 
 #include "qemu-common.h"
+#include "qapi/error.h"
 #include "qapi/qmp-output-visitor.h"
 #include "test-qapi-types.h"
 #include "test-qapi-visit.h"
diff --git a/tests/test-string-input-visitor.c b/tests/test-string-input-visitor.c
index 4b48ec2..9e6906a 100644
--- a/tests/test-string-input-visitor.c
+++ b/tests/test-string-input-visitor.c
@@ -14,6 +14,7 @@
 #include <glib.h>
 
 #include "qemu-common.h"
+#include "qapi/error.h"
 #include "qapi/string-input-visitor.h"
 #include "test-qapi-types.h"
 #include "test-qapi-visit.h"
diff --git a/tests/test-string-output-visitor.c b/tests/test-string-output-visitor.c
index 0beccf9..1ecd75b 100644
--- a/tests/test-string-output-visitor.c
+++ b/tests/test-string-output-visitor.c
@@ -14,6 +14,7 @@
 #include <glib.h>
 
 #include "qemu-common.h"
+#include "qapi/error.h"
 #include "qapi/string-output-visitor.h"
 #include "test-qapi-types.h"
 #include "test-qapi-visit.h"
diff --git a/tests/test-thread-pool.c b/tests/test-thread-pool.c
index 40600b4..88dc731 100644
--- a/tests/test-thread-pool.c
+++ b/tests/test-thread-pool.c
@@ -4,6 +4,7 @@
 #include "block/aio.h"
 #include "block/thread-pool.h"
 #include "block/block.h"
+#include "qapi/error.h"
 #include "qemu/timer.h"
 #include "qemu/error-report.h"
 
diff --git a/tests/test-throttle.c b/tests/test-throttle.c
index 59675fa..744a524 100644
--- a/tests/test-throttle.c
+++ b/tests/test-throttle.c
@@ -16,6 +16,7 @@
 #include <glib.h>
 #include <math.h>
 #include "block/aio.h"
+#include "qapi/error.h"
 #include "qemu/throttle.h"
 #include "qemu/error-report.h"
 #include "block/throttle-groups.h"
diff --git a/tests/test-visitor-serialization.c b/tests/test-visitor-serialization.c
index ef4dac5..9adbc30 100644
--- a/tests/test-visitor-serialization.c
+++ b/tests/test-visitor-serialization.c
@@ -18,6 +18,7 @@
 #include "qemu-common.h"
 #include "test-qapi-types.h"
 #include "test-qapi-visit.h"
+#include "qapi/error.h"
 #include "qapi/qmp/types.h"
 #include "qapi/qmp-input-visitor.h"
 #include "qapi/qmp-output-visitor.h"
diff --git a/ui/input-linux.c b/ui/input-linux.c
index 0bc0405..358d928 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -5,6 +5,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/config-file.h"
 #include "qemu/sockets.h"
diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c
index 13a59f5..04f834d 100644
--- a/ui/vnc-auth-sasl.c
+++ b/ui/vnc-auth-sasl.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.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 8f3bb11..11c8c9a 100644
--- a/ui/vnc-auth-vencrypt.c
+++ b/ui/vnc-auth-vencrypt.c
@@ -26,6 +26,7 @@
 
 #include "qemu/osdep.h"
 #include "vnc.h"
+#include "qapi/error.h"
 #include "qemu/main-loop.h"
 
 static void start_auth_vencrypt_subauth(VncState *vs)
diff --git a/ui/vnc-ws.c b/ui/vnc-ws.c
index 1d3ecc2..7c79a4c 100644
--- a/ui/vnc-ws.c
+++ b/ui/vnc-ws.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "vnc.h"
 #include "io/channel-websock.h"
 
diff --git a/util/base64.c b/util/base64.c
index 8aa2a5b..d166ff7 100644
--- a/util/base64.c
+++ b/util/base64.c
@@ -21,6 +21,7 @@
 #include "qemu/osdep.h"
 #include <config-host.h>
 
+#include "qapi/error.h"
 #include "qemu/base64.h"
 
 static const char *base64_valid_chars =
diff --git a/util/error.c b/util/error.c
index 471b8b3..35b5882 100644
--- a/util/error.c
+++ b/util/error.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 7615be4..dcc3c7e 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -46,6 +46,7 @@
 
 #include "sysemu/sysemu.h"
 #include "trace.h"
+#include "qapi/error.h"
 #include "qemu/sockets.h"
 #include <sys/mman.h>
 #include <libgen.h>
diff --git a/util/qemu-option.c b/util/qemu-option.c
index e7aa43f..98967ff 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -25,6 +25,7 @@
 
 #include "qemu/osdep.h"
 
+#include "qapi/error.h"
 #include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qapi/qmp/types.h"
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index fd37ac2..d9cf1eb 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -18,6 +18,7 @@
 #include "qemu/osdep.h"
 
 #include "monitor/monitor.h"
+#include "qapi/error.h"
 #include "qemu/sockets.h"
 #include "qemu/main-loop.h"
 #include "qapi/qmp-input-visitor.h"
diff --git a/util/throttle.c b/util/throttle.c
index 371c769..71246b2 100644
--- a/util/throttle.c
+++ b/util/throttle.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qapi/error.h"
 #include "qemu/throttle.h"
 #include "qemu/timer.h"
 #include "block/aio.h"
-- 
2.4.3

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

* [Qemu-devel] [PATCH 02/15] Use scripts/clean-includes to drop redundant qemu/typedefs.h
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 01/15] include/qemu/osdep.h: Don't include qapi/error.h Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 03/15] include/config.h: Unused, remove Markus Armbruster
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

Re-run scripts/clean-includes to apply the previous commit's
corrections and updates.  Besides redundant qemu/typedefs.h, this only
finds a redundant config-host.h include in ui/egl-helpers.c.  No idea
how that escaped the previous runs.

Some manual whitespace trimming around dropped includes squashed in.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/i386/acpi-build.h            | 2 --
 include/block/accounting.h      | 2 --
 include/block/aio.h             | 1 -
 include/block/write-threshold.h | 2 --
 include/exec/cpu-common.h       | 1 -
 include/exec/memory.h           | 1 -
 include/hw/acpi/acpi.h          | 1 -
 include/hw/acpi/piix4.h         | 2 --
 include/hw/acpi/tco.h           | 1 -
 include/hw/boards.h             | 1 -
 include/hw/char/digic-uart.h    | 1 -
 include/hw/hotplug.h            | 1 -
 include/hw/i386/pc.h            | 1 -
 include/hw/nvram/fw_cfg.h       | 1 -
 include/hw/qdev-core.h          | 1 -
 include/hw/scsi/scsi.h          | 1 -
 include/hw/timer/digic-timer.h  | 1 -
 include/hw/vfio/vfio.h          | 2 --
 include/hw/xen/xen.h            | 1 -
 include/monitor/qdev.h          | 1 -
 include/net/filter.h            | 1 -
 include/qapi/visitor.h          | 1 -
 include/qemu-common.h           | 1 -
 include/qemu/coroutine.h        | 1 -
 include/qemu/option.h           | 1 -
 include/qemu/timer.h            | 1 -
 include/qom/cpu.h               | 1 -
 include/qom/object.h            | 1 -
 include/sysemu/accel.h          | 1 -
 include/sysemu/block-backend.h  | 2 --
 include/sysemu/memory_mapping.h | 1 -
 include/sysemu/replay.h         | 1 -
 include/sysemu/sysemu.h         | 1 -
 include/ui/console.h            | 1 -
 include/ui/qemu-pixman.h        | 2 --
 stubs/target-get-monitor-def.c  | 1 -
 stubs/target-monitor-defs.c     | 1 -
 trace/control.h                 | 1 -
 trace/qmp.c                     | 1 -
 ui/egl-helpers.c                | 1 -
 40 files changed, 47 deletions(-)

diff --git a/hw/i386/acpi-build.h b/hw/i386/acpi-build.h
index 148c0f9..007332e 100644
--- a/hw/i386/acpi-build.h
+++ b/hw/i386/acpi-build.h
@@ -2,8 +2,6 @@
 #ifndef HW_I386_ACPI_BUILD_H
 #define HW_I386_ACPI_BUILD_H
 
-#include "qemu/typedefs.h"
-
 void acpi_setup(void);
 
 #endif
diff --git a/include/block/accounting.h b/include/block/accounting.h
index 2db2a00..2089163 100644
--- a/include/block/accounting.h
+++ b/include/block/accounting.h
@@ -25,8 +25,6 @@
 #ifndef BLOCK_ACCOUNTING_H
 #define BLOCK_ACCOUNTING_H
 
-
-#include "qemu/typedefs.h"
 #include "qemu/timed-average.h"
 
 typedef struct BlockAcctTimedStats BlockAcctTimedStats;
diff --git a/include/block/aio.h b/include/block/aio.h
index e086e3b..88a64ee 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -14,7 +14,6 @@
 #ifndef QEMU_AIO_H
 #define QEMU_AIO_H
 
-#include "qemu/typedefs.h"
 #include "qemu-common.h"
 #include "qemu/queue.h"
 #include "qemu/event_notifier.h"
diff --git a/include/block/write-threshold.h b/include/block/write-threshold.h
index 8a79505..234d219 100644
--- a/include/block/write-threshold.h
+++ b/include/block/write-threshold.h
@@ -12,8 +12,6 @@
 #ifndef BLOCK_WRITE_THRESHOLD_H
 #define BLOCK_WRITE_THRESHOLD_H
 
-
-#include "qemu/typedefs.h"
 #include "qemu-common.h"
 
 /*
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index a0ad2ac..9e839e5 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -14,7 +14,6 @@
 #include "qemu/bswap.h"
 #include "qemu/queue.h"
 #include "qemu/fprintf-fn.h"
-#include "qemu/typedefs.h"
 
 /**
  * CPUListState:
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 2de7898..e2a3e99 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -31,7 +31,6 @@
 #include "qemu/notify.h"
 #include "qom/object.h"
 #include "qemu/rcu.h"
-#include "qemu/typedefs.h"
 
 #define MAX_PHYS_ADDR_SPACE_BITS 62
 #define MAX_PHYS_ADDR            (((hwaddr)1 << MAX_PHYS_ADDR_SPACE_BITS) - 1)
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index 7462e20..443687d 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -19,7 +19,6 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#include "qemu/typedefs.h"
 #include "qemu/notify.h"
 #include "qemu/option.h"
 #include "exec/memory.h"
diff --git a/include/hw/acpi/piix4.h b/include/hw/acpi/piix4.h
index 65e6fd7..26c2370 100644
--- a/include/hw/acpi/piix4.h
+++ b/include/hw/acpi/piix4.h
@@ -1,8 +1,6 @@
 #ifndef HW_ACPI_PIIX4_H
 #define HW_ACPI_PIIX4_H
 
-#include "qemu/typedefs.h"
-
 Object *piix4_pm_find(void);
 
 #endif
diff --git a/include/hw/acpi/tco.h b/include/hw/acpi/tco.h
index c63afc8..52ad767 100644
--- a/include/hw/acpi/tco.h
+++ b/include/hw/acpi/tco.h
@@ -9,7 +9,6 @@
 #ifndef HW_ACPI_TCO_H
 #define HW_ACPI_TCO_H
 
-#include "qemu/typedefs.h"
 #include "qemu-common.h"
 
 /* As per ICH9 spec, the internal timer has an error of ~0.6s on every tick */
diff --git a/include/hw/boards.h b/include/hw/boards.h
index b5d7eae..f9c15a8 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -3,7 +3,6 @@
 #ifndef HW_BOARDS_H
 #define HW_BOARDS_H
 
-#include "qemu/typedefs.h"
 #include "sysemu/blockdev.h"
 #include "sysemu/accel.h"
 #include "hw/qdev.h"
diff --git a/include/hw/char/digic-uart.h b/include/hw/char/digic-uart.h
index ef83a30..7b3f145 100644
--- a/include/hw/char/digic-uart.h
+++ b/include/hw/char/digic-uart.h
@@ -19,7 +19,6 @@
 #define HW_CHAR_DIGIC_UART_H
 
 #include "hw/sysbus.h"
-#include "qemu/typedefs.h"
 
 #define TYPE_DIGIC_UART "digic-uart"
 #define DIGIC_UART(obj) \
diff --git a/include/hw/hotplug.h b/include/hw/hotplug.h
index 2db025d..da1d0e4 100644
--- a/include/hw/hotplug.h
+++ b/include/hw/hotplug.h
@@ -13,7 +13,6 @@
 #define HOTPLUG_H
 
 #include "qom/object.h"
-#include "qemu/typedefs.h"
 
 #define TYPE_HOTPLUG_HANDLER "hotplug-handler"
 
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 79ffe5b..4f6ce10 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -2,7 +2,6 @@
 #define HW_PC_H
 
 #include "qemu-common.h"
-#include "qemu/typedefs.h"
 #include "exec/memory.h"
 #include "hw/boards.h"
 #include "hw/isa/isa.h"
diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
index 4315f4e..10a9971 100644
--- a/include/hw/nvram/fw_cfg.h
+++ b/include/hw/nvram/fw_cfg.h
@@ -4,7 +4,6 @@
 #ifndef NO_QEMU_PROTOS
 
 #include "exec/hwaddr.h"
-#include "qemu/typedefs.h"
 #endif
 
 #define FW_CFG_SIGNATURE        0x00
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index c3ff99f..1ce02b2 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -3,7 +3,6 @@
 
 #include "qemu/queue.h"
 #include "qemu/option.h"
-#include "qemu/typedefs.h"
 #include "qemu/bitmap.h"
 #include "qom/object.h"
 #include "hw/irq.h"
diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h
index 29052f8..8acd3fa 100644
--- a/include/hw/scsi/scsi.h
+++ b/include/hw/scsi/scsi.h
@@ -2,7 +2,6 @@
 #define QEMU_HW_SCSI_H
 
 #include "hw/qdev.h"
-#include "qemu/typedefs.h"
 #include "hw/block/block.h"
 #include "sysemu/sysemu.h"
 #include "qemu/notify.h"
diff --git a/include/hw/timer/digic-timer.h b/include/hw/timer/digic-timer.h
index ae91348..d9e67fe 100644
--- a/include/hw/timer/digic-timer.h
+++ b/include/hw/timer/digic-timer.h
@@ -19,7 +19,6 @@
 #define HW_TIMER_DIGIC_TIMER_H
 
 #include "hw/sysbus.h"
-#include "qemu/typedefs.h"
 #include "hw/ptimer.h"
 
 #define TYPE_DIGIC_TIMER "digic-timer"
diff --git a/include/hw/vfio/vfio.h b/include/hw/vfio/vfio.h
index 0b26cd8..477f026 100644
--- a/include/hw/vfio/vfio.h
+++ b/include/hw/vfio/vfio.h
@@ -1,8 +1,6 @@
 #ifndef VFIO_API_H
 #define VFIO_API_H
 
-#include "qemu/typedefs.h"
-
 extern int vfio_container_ioctl(AddressSpace *as, int32_t groupid,
                                 int req, void *param);
 
diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h
index bf3fe97..6eb815a 100644
--- a/include/hw/xen/xen.h
+++ b/include/hw/xen/xen.h
@@ -9,7 +9,6 @@
 
 #include "hw/irq.h"
 #include "qemu-common.h"
-#include "qemu/typedefs.h"
 
 /* xen-machine.c */
 enum xen_mode {
diff --git a/include/monitor/qdev.h b/include/monitor/qdev.h
index 50ec2ff..c4b8a05 100644
--- a/include/monitor/qdev.h
+++ b/include/monitor/qdev.h
@@ -2,7 +2,6 @@
 #define QEMU_QDEV_MONITOR_H
 
 #include "hw/qdev-core.h"
-#include "qemu/typedefs.h"
 
 /*** monitor commands ***/
 
diff --git a/include/net/filter.h b/include/net/filter.h
index cfb1172..0c4a2ea 100644
--- a/include/net/filter.h
+++ b/include/net/filter.h
@@ -11,7 +11,6 @@
 
 #include "qom/object.h"
 #include "qemu-common.h"
-#include "qemu/typedefs.h"
 #include "net/queue.h"
 
 #define TYPE_NETFILTER "netfilter"
diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h
index 1000da2..9a8d010 100644
--- a/include/qapi/visitor.h
+++ b/include/qapi/visitor.h
@@ -14,7 +14,6 @@
 #ifndef QAPI_VISITOR_CORE_H
 #define QAPI_VISITOR_CORE_H
 
-#include "qemu/typedefs.h"
 #include "qapi/qmp/qobject.h"
 
 /* This struct is layout-compatible with all other *List structs
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 887ca71..2de4ce2 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -12,7 +12,6 @@
 #ifndef QEMU_COMMON_H
 #define QEMU_COMMON_H
 
-#include "qemu/typedefs.h"
 #include "qemu/fprintf-fn.h"
 
 #if defined(__arm__) || defined(__sparc__) || defined(__mips__) || defined(__hppa__) || defined(__ia64__)
diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h
index 99b9398..305fe76 100644
--- a/include/qemu/coroutine.h
+++ b/include/qemu/coroutine.h
@@ -15,7 +15,6 @@
 #ifndef QEMU_COROUTINE_H
 #define QEMU_COROUTINE_H
 
-#include "qemu/typedefs.h"
 #include "qemu/queue.h"
 #include "qemu/timer.h"
 
diff --git a/include/qemu/option.h b/include/qemu/option.h
index 8809ce1..8542d2d 100644
--- a/include/qemu/option.h
+++ b/include/qemu/option.h
@@ -28,7 +28,6 @@
 
 #include "qemu/queue.h"
 #include "qapi/qmp/qdict.h"
-#include "qemu/typedefs.h"
 
 const char *get_opt_name(char *buf, int buf_size, const char *p, char delim);
 const char *get_opt_value(char *buf, int buf_size, const char *p);
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index d0946cb..59a7169 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -1,7 +1,6 @@
 #ifndef QEMU_TIMER_H
 #define QEMU_TIMER_H
 
-#include "qemu/typedefs.h"
 #include "qemu-common.h"
 #include "qemu/notify.h"
 #include "qemu/host-utils.h"
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 7052eee..0b6fa25 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -27,7 +27,6 @@
 #include "exec/memattrs.h"
 #include "qemu/queue.h"
 #include "qemu/thread.h"
-#include "qemu/typedefs.h"
 
 typedef int (*WriteCoreDumpFunction)(const void *buf, size_t size,
                                      void *opaque);
diff --git a/include/qom/object.h b/include/qom/object.h
index 0eba22e..21bb5ff 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -17,7 +17,6 @@
 #include <glib.h>
 #include "qapi-types.h"
 #include "qemu/queue.h"
-#include "qemu/typedefs.h"
 
 struct TypeImpl;
 typedef struct TypeImpl *Type;
diff --git a/include/sysemu/accel.h b/include/sysemu/accel.h
index 997720f..a74b2fa 100644
--- a/include/sysemu/accel.h
+++ b/include/sysemu/accel.h
@@ -23,7 +23,6 @@
 #ifndef HW_ACCEL_H
 #define HW_ACCEL_H
 
-#include "qemu/typedefs.h"
 #include "qom/object.h"
 
 typedef struct AccelState {
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index 66c5cf2..3211e01 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -13,8 +13,6 @@
 #ifndef BLOCK_BACKEND_H
 #define BLOCK_BACKEND_H
 
-#include "qemu/typedefs.h"
-
 /*
  * TODO Have to include block/block.h for a bunch of block layer
  * types.  Unfortunately, this pulls in the whole BlockDriverState
diff --git a/include/sysemu/memory_mapping.h b/include/sysemu/memory_mapping.h
index d46d879..706152d 100644
--- a/include/sysemu/memory_mapping.h
+++ b/include/sysemu/memory_mapping.h
@@ -15,7 +15,6 @@
 #define MEMORY_MAPPING_H
 
 #include "qemu/queue.h"
-#include "qemu/typedefs.h"
 #include "exec/memory.h"
 
 typedef struct GuestPhysBlock {
diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index e4108e8..63145e4 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -13,7 +13,6 @@
  */
 
 #include "qapi-types.h"
-#include "qemu/typedefs.h"
 
 /* replay clock kinds */
 enum ReplayClockKind {
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 3bb8897..38fb3ca 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -2,7 +2,6 @@
 #define SYSEMU_H
 /* Misc. things related to the system emulator.  */
 
-#include "qemu/typedefs.h"
 #include "qemu/option.h"
 #include "qemu/queue.h"
 #include "qemu/timer.h"
diff --git a/include/ui/console.h b/include/ui/console.h
index f636971..eb9419d 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -5,7 +5,6 @@
 #include "qom/object.h"
 #include "qapi/qmp/qdict.h"
 #include "qemu/notify.h"
-#include "qemu/typedefs.h"
 #include "qapi-types.h"
 
 #ifdef CONFIG_OPENGL
diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h
index e34c4ef..4a67e01 100644
--- a/include/ui/qemu-pixman.h
+++ b/include/ui/qemu-pixman.h
@@ -16,8 +16,6 @@
 #pragma GCC diagnostic pop
 #endif
 
-#include "qemu/typedefs.h"
-
 /*
  * pixman image formats are defined to be native endian,
  * that means host byte order on qemu.  So we go define
diff --git a/stubs/target-get-monitor-def.c b/stubs/target-get-monitor-def.c
index 4d1033d..dd83052 100644
--- a/stubs/target-get-monitor-def.c
+++ b/stubs/target-get-monitor-def.c
@@ -20,7 +20,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu/typedefs.h"
 #include "stdint.h"
 
 int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval);
diff --git a/stubs/target-monitor-defs.c b/stubs/target-monitor-defs.c
index 203ebb0..7a16ad7 100644
--- a/stubs/target-monitor-defs.c
+++ b/stubs/target-monitor-defs.c
@@ -1,6 +1,5 @@
 #include "qemu/osdep.h"
 #include "stddef.h"
-#include "qemu/typedefs.h"
 
 const MonitorDef *target_monitor_defs(void);
 
diff --git a/trace/control.h b/trace/control.h
index f0fe535..e2ba6d4 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -11,7 +11,6 @@
 #define TRACE__CONTROL_H
 
 #include "qemu-common.h"
-#include "qemu/typedefs.h"
 #include "trace/generated-events.h"
 
 
diff --git a/trace/qmp.c b/trace/qmp.c
index 6320b4b..8aa2660 100644
--- a/trace/qmp.c
+++ b/trace/qmp.c
@@ -8,7 +8,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu/typedefs.h"
 #include "qmp-commands.h"
 #include "trace/control.h"
 
diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c
index 54be44c..558edfd 100644
--- a/ui/egl-helpers.c
+++ b/ui/egl-helpers.c
@@ -2,7 +2,6 @@
 #include <glob.h>
 #include <dirent.h>
 
-#include "config-host.h"
 #include "ui/egl-helpers.h"
 
 EGLDisplay *qemu_egl_display;
-- 
2.4.3

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

* [Qemu-devel] [PATCH 03/15] include/config.h: Unused, remove
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 01/15] include/qemu/osdep.h: Don't include qapi/error.h Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 02/15] Use scripts/clean-includes to drop redundant qemu/typedefs.h Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 04/15] Clean up includes some more Markus Armbruster
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

Commit 90ce6e2 removed one of its two lines, but missed the fact that
it also removed the last of its users.  Bury the body.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/config.h       | 1 -
 scripts/clean-includes | 1 -
 2 files changed, 2 deletions(-)
 delete mode 100644 include/config.h

diff --git a/include/config.h b/include/config.h
deleted file mode 100644
index 992d761..0000000
--- a/include/config.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "config-target.h"
diff --git a/scripts/clean-includes b/scripts/clean-includes
index 2ae3b43..8052bbd 100755
--- a/scripts/clean-includes
+++ b/scripts/clean-includes
@@ -104,7 +104,6 @@ for f in "$@"; do
       ;;
     *include/qemu/osdep.h | \
     *include/qemu/compiler.h | \
-    *include/config.h | \
     *include/standard-headers/ )
       # Removing include lines from osdep.h itself would be counterproductive.
       echo "SKIPPING $f (special case header)"
-- 
2.4.3

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

* [Qemu-devel] [PATCH 04/15] Clean up includes some more
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
                   ` (2 preceding siblings ...)
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 03/15] include/config.h: Unused, remove Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 05/15] fw_cfg: Split fw_cfg_keys.h off fw_cfg.h Markus Armbruster
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

Manually drop redundant includes that scripts/clean-includes misses,
e.g. because they're hidden in generator programs, or they use the
wrong kind of delimiter.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/net/vmxnet_rx_pkt.h                   | 2 --
 hw/net/vmxnet_tx_pkt.h                   | 2 --
 hw/scsi/virtio-scsi-dataplane.c          | 1 -
 include/hw/acpi/pcihp.h                  | 1 -
 include/qemu/range.h                     | 1 -
 qga/main.c                               | 1 -
 qga/vss-win32/requester.cpp              | 1 -
 scripts/qapi-types.py                    | 5 -----
 scripts/tracetool/backend/log.py         | 6 +-----
 scripts/tracetool/format/events_h.py     | 2 --
 scripts/tracetool/format/h.py            | 1 -
 scripts/tracetool/format/tcg_h.py        | 2 --
 scripts/tracetool/format/ust_events_c.py | 1 -
 stubs/gdbstub.c                          | 2 --
 stubs/target-get-monitor-def.c           | 1 -
 stubs/target-monitor-defs.c              | 1 -
 tests/tcg/test-i386-fprem.c              | 4 +---
 util/base64.c                            | 2 --
 18 files changed, 2 insertions(+), 34 deletions(-)

diff --git a/hw/net/vmxnet_rx_pkt.h b/hw/net/vmxnet_rx_pkt.h
index a425846..0a45c1b 100644
--- a/hw/net/vmxnet_rx_pkt.h
+++ b/hw/net/vmxnet_rx_pkt.h
@@ -18,8 +18,6 @@
 #ifndef VMXNET_RX_PKT_H
 #define VMXNET_RX_PKT_H
 
-#include "stdint.h"
-#include "stdbool.h"
 #include "net/eth.h"
 
 /* defines to enable packet dump functions */
diff --git a/hw/net/vmxnet_tx_pkt.h b/hw/net/vmxnet_tx_pkt.h
index 57121a6..f51e98a 100644
--- a/hw/net/vmxnet_tx_pkt.h
+++ b/hw/net/vmxnet_tx_pkt.h
@@ -18,8 +18,6 @@
 #ifndef VMXNET_TX_PKT_H
 #define VMXNET_TX_PKT_H
 
-#include "stdint.h"
-#include "stdbool.h"
 #include "net/eth.h"
 #include "exec/hwaddr.h"
 
diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c
index 367e476..b44ac5d 100644
--- a/hw/scsi/virtio-scsi-dataplane.c
+++ b/hw/scsi/virtio-scsi-dataplane.c
@@ -19,7 +19,6 @@
 #include <block/scsi.h>
 #include <hw/virtio/virtio-bus.h>
 #include "hw/virtio/virtio-access.h"
-#include "stdio.h"
 
 /* Context: QEMU global mutex held */
 void virtio_scsi_set_iothread(VirtIOSCSI *s, IOThread *iothread)
diff --git a/include/hw/acpi/pcihp.h b/include/hw/acpi/pcihp.h
index 31b7820..79a4392 100644
--- a/include/hw/acpi/pcihp.h
+++ b/include/hw/acpi/pcihp.h
@@ -27,7 +27,6 @@
 #ifndef HW_ACPI_PCIHP_H
 #define HW_ACPI_PCIHP_H
 
-#include <qemu/typedefs.h>
 #include "hw/acpi/acpi.h"
 #include "migration/vmstate.h"
 
diff --git a/include/qemu/range.h b/include/qemu/range.h
index 9fc547b..c903eb5 100644
--- a/include/qemu/range.h
+++ b/include/qemu/range.h
@@ -1,7 +1,6 @@
 #ifndef QEMU_RANGE_H
 #define QEMU_RANGE_H
 
-#include <qemu/typedefs.h>
 #include "qemu/queue.h"
 
 /*
diff --git a/qga/main.c b/qga/main.c
index 0a168e2..fb2f663 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -24,7 +24,6 @@
 #include "qapi/qmp/qjson.h"
 #include "qga/guest-agent-core.h"
 #include "qemu/module.h"
-#include "signal.h"
 #include "qapi/qmp/qerror.h"
 #include "qapi/qmp/dispatch.h"
 #include "qga/channel.h"
diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index b57d517..889052d 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -13,7 +13,6 @@
 #include "qemu/osdep.h"
 #include "vss-common.h"
 #include "requester.h"
-#include "assert.h"
 #include "inc/win2003/vswriter.h"
 #include "inc/win2003/vsbackup.h"
 
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 0306a88..2ac8185 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -292,11 +292,6 @@ fdef.write(mcgen('''
 ''',
                  prefix=prefix))
 
-# To avoid circular headers, use only typedefs.h here, not qobject.h
-fdecl.write(mcgen('''
-#include "qemu/typedefs.h"
-'''))
-
 schema = QAPISchema(input_file)
 gen = QAPISchemaGenTypeVisitor()
 schema.visit(gen)
diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/log.py
index a62c310..e409b73 100644
--- a/scripts/tracetool/backend/log.py
+++ b/scripts/tracetool/backend/log.py
@@ -20,11 +20,7 @@ PUBLIC = True
 
 
 def generate_h_begin(events):
-    out('#include <stdio.h>',
-        '#include <sys/time.h>',
-        '#include <sys/types.h>',
-        '#include <unistd.h>',
-        '#include "trace/control.h"',
+    out('#include "trace/control.h"',
         '#include "qemu/log.h"',
         '')
 
diff --git a/scripts/tracetool/format/events_h.py b/scripts/tracetool/format/events_h.py
index bbfaa5b..4529263 100644
--- a/scripts/tracetool/format/events_h.py
+++ b/scripts/tracetool/format/events_h.py
@@ -21,8 +21,6 @@ def generate(events, backend):
         '',
         '#ifndef TRACE__GENERATED_EVENTS_H',
         '#define TRACE__GENERATED_EVENTS_H',
-        '',
-        '#include <stdbool.h>',
         '')
 
     # event identifiers
diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py
index 2bd68a2..0835406 100644
--- a/scripts/tracetool/format/h.py
+++ b/scripts/tracetool/format/h.py
@@ -23,7 +23,6 @@ def generate(events, backend):
         '#define TRACE__GENERATED_TRACERS_H',
         '',
         '#include "qemu-common.h"',
-        '#include "qemu/typedefs.h"',
         '')
 
     backend.generate_begin(events)
diff --git a/scripts/tracetool/format/tcg_h.py b/scripts/tracetool/format/tcg_h.py
index 006eaa8..e2331f2 100644
--- a/scripts/tracetool/format/tcg_h.py
+++ b/scripts/tracetool/format/tcg_h.py
@@ -34,8 +34,6 @@ def generate(events, backend):
         '#ifndef TRACE__GENERATED_TCG_TRACERS_H',
         '#define TRACE__GENERATED_TCG_TRACERS_H',
         '',
-        '#include <stdint.h>',
-        '',
         '#include "trace.h"',
         '#include "exec/helper-proto.h"',
         '',
diff --git a/scripts/tracetool/format/ust_events_c.py b/scripts/tracetool/format/ust_events_c.py
index bf0b334..9967c7a 100644
--- a/scripts/tracetool/format/ust_events_c.py
+++ b/scripts/tracetool/format/ust_events_c.py
@@ -32,5 +32,4 @@ def generate(events, backend):
         ' */',
         '#pragma GCC diagnostic ignored "-Wredundant-decls"',
         '',
-        '#include "qemu/typedefs.h"',
         '#include "generated-ust-provider.h"')
diff --git a/stubs/gdbstub.c b/stubs/gdbstub.c
index 359c289..2b7aee5 100644
--- a/stubs/gdbstub.c
+++ b/stubs/gdbstub.c
@@ -1,6 +1,4 @@
 #include "qemu/osdep.h"
-#include "stdbool.h"            /* bool (in exec/gdbstub.h) */
-#include "stddef.h"             /* NULL */
 #include "exec/gdbstub.h"       /* xml_builtin */
 
 const char *const xml_builtin[][2] = {
diff --git a/stubs/target-get-monitor-def.c b/stubs/target-get-monitor-def.c
index dd83052..394e0f9 100644
--- a/stubs/target-get-monitor-def.c
+++ b/stubs/target-get-monitor-def.c
@@ -20,7 +20,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "stdint.h"
 
 int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval);
 
diff --git a/stubs/target-monitor-defs.c b/stubs/target-monitor-defs.c
index 7a16ad7..ac07b19 100644
--- a/stubs/target-monitor-defs.c
+++ b/stubs/target-monitor-defs.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "stddef.h"
 
 const MonitorDef *target_monitor_defs(void);
 
diff --git a/tests/tcg/test-i386-fprem.c b/tests/tcg/test-i386-fprem.c
index e91fb1a..1a71623 100644
--- a/tests/tcg/test-i386-fprem.c
+++ b/tests/tcg/test-i386-fprem.c
@@ -22,10 +22,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 "qemu/compiler.h"
+
 #include "qemu/osdep.h"
-#include <stdio.h>
-#include <inttypes.h>
 
 /*
  * Inspired by <ieee754.h>'s union ieee854_long_double, but with single
diff --git a/util/base64.c b/util/base64.c
index d166ff7..9d3c46c 100644
--- a/util/base64.c
+++ b/util/base64.c
@@ -19,8 +19,6 @@
  */
 
 #include "qemu/osdep.h"
-#include <config-host.h>
-
 #include "qapi/error.h"
 #include "qemu/base64.h"
 
-- 
2.4.3

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

* [Qemu-devel] [PATCH 05/15] fw_cfg: Split fw_cfg_keys.h off fw_cfg.h
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
                   ` (3 preceding siblings ...)
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 04/15] Clean up includes some more Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 06/15] include/qemu/iov.h: Don't include qemu-common.h Markus Armbruster
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

Much of fw_cfg.h's contents is #ifndef NO_QEMU_PROTOS.  This lets a
few places include it without satisfying the dependencies of the
suppressed code.  If you somehow include it with NO_QEMU_PROTOS, any
future includes are ignored.  Unnecessarily unclean.

Move the stuff not under NO_QEMU_PROTOS into its own header
fw_cfg_keys.h, and include it as appropriate.  Tidy up the moved code
to please checkpatch.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/hw/nvram/fw_cfg.h      | 49 +-----------------------------------------
 include/hw/nvram/fw_cfg_keys.h | 46 +++++++++++++++++++++++++++++++++++++++
 pc-bios/optionrom/optionrom.h  |  3 +--
 tests/boot-order-test.c        |  4 +---
 tests/fw_cfg-test.c            |  3 +--
 tests/libqos/malloc-pc.c       |  3 +--
 6 files changed, 51 insertions(+), 57 deletions(-)
 create mode 100644 include/hw/nvram/fw_cfg_keys.h

diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
index 10a9971..d516989 100644
--- a/include/hw/nvram/fw_cfg.h
+++ b/include/hw/nvram/fw_cfg.h
@@ -1,54 +1,9 @@
 #ifndef FW_CFG_H
 #define FW_CFG_H
 
-#ifndef NO_QEMU_PROTOS
-
 #include "exec/hwaddr.h"
-#endif
+#include "hw/nvram/fw_cfg_keys.h"
 
-#define FW_CFG_SIGNATURE        0x00
-#define FW_CFG_ID               0x01
-#define FW_CFG_UUID             0x02
-#define FW_CFG_RAM_SIZE         0x03
-#define FW_CFG_NOGRAPHIC        0x04
-#define FW_CFG_NB_CPUS          0x05
-#define FW_CFG_MACHINE_ID       0x06
-#define FW_CFG_KERNEL_ADDR      0x07
-#define FW_CFG_KERNEL_SIZE      0x08
-#define FW_CFG_KERNEL_CMDLINE   0x09
-#define FW_CFG_INITRD_ADDR      0x0a
-#define FW_CFG_INITRD_SIZE      0x0b
-#define FW_CFG_BOOT_DEVICE      0x0c
-#define FW_CFG_NUMA             0x0d
-#define FW_CFG_BOOT_MENU        0x0e
-#define FW_CFG_MAX_CPUS         0x0f
-#define FW_CFG_KERNEL_ENTRY     0x10
-#define FW_CFG_KERNEL_DATA      0x11
-#define FW_CFG_INITRD_DATA      0x12
-#define FW_CFG_CMDLINE_ADDR     0x13
-#define FW_CFG_CMDLINE_SIZE     0x14
-#define FW_CFG_CMDLINE_DATA     0x15
-#define FW_CFG_SETUP_ADDR       0x16
-#define FW_CFG_SETUP_SIZE       0x17
-#define FW_CFG_SETUP_DATA       0x18
-#define FW_CFG_FILE_DIR         0x19
-
-#define FW_CFG_FILE_FIRST       0x20
-#define FW_CFG_FILE_SLOTS       0x10
-#define FW_CFG_MAX_ENTRY        (FW_CFG_FILE_FIRST+FW_CFG_FILE_SLOTS)
-
-#define FW_CFG_WRITE_CHANNEL    0x4000
-#define FW_CFG_ARCH_LOCAL       0x8000
-#define FW_CFG_ENTRY_MASK       ~(FW_CFG_WRITE_CHANNEL | FW_CFG_ARCH_LOCAL)
-
-#define FW_CFG_INVALID          0xffff
-
-/* width in bytes of fw_cfg control register */
-#define FW_CFG_CTL_SIZE         0x02
-
-#define FW_CFG_MAX_FILE_PATH    56
-
-#ifndef NO_QEMU_PROTOS
 typedef struct FWCfgFile {
     uint32_t  size;        /* file size */
     uint16_t  select;      /* write this to 0x510 to read it */
@@ -220,6 +175,4 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
 
 FWCfgState *fw_cfg_find(void);
 
-#endif /* NO_QEMU_PROTOS */
-
 #endif
diff --git a/include/hw/nvram/fw_cfg_keys.h b/include/hw/nvram/fw_cfg_keys.h
new file mode 100644
index 0000000..0f3e871
--- /dev/null
+++ b/include/hw/nvram/fw_cfg_keys.h
@@ -0,0 +1,46 @@
+#ifndef FW_CFG_KEYS_H
+#define FW_CFG_KEYS_H
+
+#define FW_CFG_SIGNATURE        0x00
+#define FW_CFG_ID               0x01
+#define FW_CFG_UUID             0x02
+#define FW_CFG_RAM_SIZE         0x03
+#define FW_CFG_NOGRAPHIC        0x04
+#define FW_CFG_NB_CPUS          0x05
+#define FW_CFG_MACHINE_ID       0x06
+#define FW_CFG_KERNEL_ADDR      0x07
+#define FW_CFG_KERNEL_SIZE      0x08
+#define FW_CFG_KERNEL_CMDLINE   0x09
+#define FW_CFG_INITRD_ADDR      0x0a
+#define FW_CFG_INITRD_SIZE      0x0b
+#define FW_CFG_BOOT_DEVICE      0x0c
+#define FW_CFG_NUMA             0x0d
+#define FW_CFG_BOOT_MENU        0x0e
+#define FW_CFG_MAX_CPUS         0x0f
+#define FW_CFG_KERNEL_ENTRY     0x10
+#define FW_CFG_KERNEL_DATA      0x11
+#define FW_CFG_INITRD_DATA      0x12
+#define FW_CFG_CMDLINE_ADDR     0x13
+#define FW_CFG_CMDLINE_SIZE     0x14
+#define FW_CFG_CMDLINE_DATA     0x15
+#define FW_CFG_SETUP_ADDR       0x16
+#define FW_CFG_SETUP_SIZE       0x17
+#define FW_CFG_SETUP_DATA       0x18
+#define FW_CFG_FILE_DIR         0x19
+
+#define FW_CFG_FILE_FIRST       0x20
+#define FW_CFG_FILE_SLOTS       0x10
+#define FW_CFG_MAX_ENTRY        (FW_CFG_FILE_FIRST + FW_CFG_FILE_SLOTS)
+
+#define FW_CFG_WRITE_CHANNEL    0x4000
+#define FW_CFG_ARCH_LOCAL       0x8000
+#define FW_CFG_ENTRY_MASK       (~(FW_CFG_WRITE_CHANNEL | FW_CFG_ARCH_LOCAL))
+
+#define FW_CFG_INVALID          0xffff
+
+/* width in bytes of fw_cfg control register */
+#define FW_CFG_CTL_SIZE         0x02
+
+#define FW_CFG_MAX_FILE_PATH    56
+
+#endif
diff --git a/pc-bios/optionrom/optionrom.h b/pc-bios/optionrom/optionrom.h
index f1a9021..6c4c2c8 100644
--- a/pc-bios/optionrom/optionrom.h
+++ b/pc-bios/optionrom/optionrom.h
@@ -19,8 +19,7 @@
  */
 
 
-#define NO_QEMU_PROTOS
-#include "../../include/hw/nvram/fw_cfg.h"
+#include "../../include/hw/nvram/fw_cfg_keys.h"
 
 #define BIOS_CFG_IOPORT_CFG	0x510
 #define BIOS_CFG_IOPORT_DATA	0x511
diff --git a/tests/boot-order-test.c b/tests/boot-order-test.c
index 210964a..a6d8bd5 100644
--- a/tests/boot-order-test.c
+++ b/tests/boot-order-test.c
@@ -15,9 +15,7 @@
 #include "libqos/fw_cfg.h"
 #include "libqtest.h"
 
-#define NO_QEMU_PROTOS
-#include "hw/nvram/fw_cfg.h"
-#undef NO_QEMU_PROTOS
+#include "hw/nvram/fw_cfg_keys.h"
 
 typedef struct {
     const char *args;
diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c
index 398643a..b4392c2 100644
--- a/tests/fw_cfg-test.c
+++ b/tests/fw_cfg-test.c
@@ -14,8 +14,7 @@
 #include <glib.h>
 
 #include "libqtest.h"
-#define NO_QEMU_PROTOS
-#include "hw/nvram/fw_cfg.h"
+#include "hw/nvram/fw_cfg_keys.h"
 #include "libqos/fw_cfg.h"
 
 static uint64_t ram_size = 128 << 20;
diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c
index 74f76c5..eee706b 100644
--- a/tests/libqos/malloc-pc.c
+++ b/tests/libqos/malloc-pc.c
@@ -14,8 +14,7 @@
 #include "libqos/malloc-pc.h"
 #include "libqos/fw_cfg.h"
 
-#define NO_QEMU_PROTOS
-#include "hw/nvram/fw_cfg.h"
+#include "hw/nvram/fw_cfg_keys.h"
 
 #include "qemu-common.h"
 #include <glib.h>
-- 
2.4.3

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

* [Qemu-devel] [PATCH 06/15] include/qemu/iov.h: Don't include qemu-common.h
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
                   ` (4 preceding siblings ...)
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 05/15] fw_cfg: Split fw_cfg_keys.h off fw_cfg.h Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 07/15] include/hw/hw.h: " Markus Armbruster
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

qemu-common.h should only be included by .c files.  Its file comment
explains why: "No header file should depend on qemu-common.h, as this
would easily lead to circular header dependencies."

qemu/iov.h includes qemu-common.h for QEMUIOVector stuff.  Move all
that to qemu/iov.h and drop the ill-advised include.  Include
qemu/iov.h where the QEMUIOVector stuff is now missing.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 block/raw-aio.h                |  2 ++
 include/block/block.h          |  2 +-
 include/hw/ppc/mac_dbdma.h     |  1 +
 include/hw/usb.h               |  1 +
 include/qemu-common.h          | 28 ----------------------------
 include/qemu/iov.h             | 30 ++++++++++++++++++++++++++++--
 include/sysemu/block-backend.h |  2 ++
 util/iov.c                     |  1 +
 8 files changed, 36 insertions(+), 31 deletions(-)

diff --git a/block/raw-aio.h b/block/raw-aio.h
index 31d791f..811e375 100644
--- a/block/raw-aio.h
+++ b/block/raw-aio.h
@@ -15,6 +15,8 @@
 #ifndef QEMU_RAW_AIO_H
 #define QEMU_RAW_AIO_H
 
+#include "qemu/iov.h"
+
 /* AIO request types */
 #define QEMU_AIO_READ         0x0001
 #define QEMU_AIO_WRITE        0x0002
diff --git a/include/block/block.h b/include/block/block.h
index 1c4f4d8..d88db01 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -2,7 +2,7 @@
 #define BLOCK_H
 
 #include "block/aio.h"
-#include "qemu-common.h"
+#include "qemu/iov.h"
 #include "qemu/option.h"
 #include "qemu/coroutine.h"
 #include "block/accounting.h"
diff --git a/include/hw/ppc/mac_dbdma.h b/include/hw/ppc/mac_dbdma.h
index c687021..0cce4e8 100644
--- a/include/hw/ppc/mac_dbdma.h
+++ b/include/hw/ppc/mac_dbdma.h
@@ -23,6 +23,7 @@
 #define HW_MAC_DBDMA_H 1
 
 #include "exec/memory.h"
+#include "qemu/iov.h"
 
 typedef struct DBDMA_io DBDMA_io;
 
diff --git a/include/hw/usb.h b/include/hw/usb.h
index c8b6e7b..163fe04 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -26,6 +26,7 @@
  */
 
 #include "hw/qdev.h"
+#include "qemu/iov.h"
 #include "qemu/queue.h"
 
 /* Constants related to the USB / PCI interaction */
diff --git a/include/qemu-common.h b/include/qemu-common.h
index 2de4ce2..b8fbd9e 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -364,34 +364,6 @@ ssize_t qemu_co_send_recv(int sockfd, void *buf, size_t bytes, bool do_send);
 #define qemu_co_send(sockfd, buf, bytes) \
   qemu_co_send_recv(sockfd, buf, bytes, true)
 
-typedef struct QEMUIOVector {
-    struct iovec *iov;
-    int niov;
-    int nalloc;
-    size_t size;
-} QEMUIOVector;
-
-void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint);
-void qemu_iovec_init_external(QEMUIOVector *qiov, struct iovec *iov, int niov);
-void qemu_iovec_add(QEMUIOVector *qiov, void *base, size_t len);
-void qemu_iovec_concat(QEMUIOVector *dst,
-                       QEMUIOVector *src, size_t soffset, size_t sbytes);
-size_t qemu_iovec_concat_iov(QEMUIOVector *dst,
-                             struct iovec *src_iov, unsigned int src_cnt,
-                             size_t soffset, size_t sbytes);
-bool qemu_iovec_is_zero(QEMUIOVector *qiov);
-void qemu_iovec_destroy(QEMUIOVector *qiov);
-void qemu_iovec_reset(QEMUIOVector *qiov);
-size_t qemu_iovec_to_buf(QEMUIOVector *qiov, size_t offset,
-                         void *buf, size_t bytes);
-size_t qemu_iovec_from_buf(QEMUIOVector *qiov, size_t offset,
-                           const void *buf, size_t bytes);
-size_t qemu_iovec_memset(QEMUIOVector *qiov, size_t offset,
-                         int fillc, size_t bytes);
-ssize_t qemu_iovec_compare(QEMUIOVector *a, QEMUIOVector *b);
-void qemu_iovec_clone(QEMUIOVector *dest, const QEMUIOVector *src, void *buf);
-void qemu_iovec_discard_back(QEMUIOVector *qiov, size_t bytes);
-
 bool buffer_is_zero(const void *buf, size_t len);
 
 void qemu_progress_init(int enabled, float min_skip);
diff --git a/include/qemu/iov.h b/include/qemu/iov.h
index 2847551..bd9fd55 100644
--- a/include/qemu/iov.h
+++ b/include/qemu/iov.h
@@ -14,8 +14,6 @@
 #ifndef IOV_H
 #define IOV_H
 
-#include "qemu-common.h"
-
 /**
  * count and return data size, in bytes, of an iovec
  * starting at `iov' of `iov_cnt' number of elements.
@@ -138,4 +136,32 @@ size_t iov_discard_front(struct iovec **iov, unsigned int *iov_cnt,
 size_t iov_discard_back(struct iovec *iov, unsigned int *iov_cnt,
                         size_t bytes);
 
+typedef struct QEMUIOVector {
+    struct iovec *iov;
+    int niov;
+    int nalloc;
+    size_t size;
+} QEMUIOVector;
+
+void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint);
+void qemu_iovec_init_external(QEMUIOVector *qiov, struct iovec *iov, int niov);
+void qemu_iovec_add(QEMUIOVector *qiov, void *base, size_t len);
+void qemu_iovec_concat(QEMUIOVector *dst,
+                       QEMUIOVector *src, size_t soffset, size_t sbytes);
+size_t qemu_iovec_concat_iov(QEMUIOVector *dst,
+                             struct iovec *src_iov, unsigned int src_cnt,
+                             size_t soffset, size_t sbytes);
+bool qemu_iovec_is_zero(QEMUIOVector *qiov);
+void qemu_iovec_destroy(QEMUIOVector *qiov);
+void qemu_iovec_reset(QEMUIOVector *qiov);
+size_t qemu_iovec_to_buf(QEMUIOVector *qiov, size_t offset,
+                         void *buf, size_t bytes);
+size_t qemu_iovec_from_buf(QEMUIOVector *qiov, size_t offset,
+                           const void *buf, size_t bytes);
+size_t qemu_iovec_memset(QEMUIOVector *qiov, size_t offset,
+                         int fillc, size_t bytes);
+ssize_t qemu_iovec_compare(QEMUIOVector *a, QEMUIOVector *b);
+void qemu_iovec_clone(QEMUIOVector *dest, const QEMUIOVector *src, void *buf);
+void qemu_iovec_discard_back(QEMUIOVector *qiov, size_t bytes);
+
 #endif
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index 3211e01..b966378 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -13,6 +13,8 @@
 #ifndef BLOCK_BACKEND_H
 #define BLOCK_BACKEND_H
 
+#include "qemu/iov.h"
+
 /*
  * TODO Have to include block/block.h for a bunch of block layer
  * types.  Unfortunately, this pulls in the whole BlockDriverState
diff --git a/util/iov.c b/util/iov.c
index 062f4e5..b69e4b7 100644
--- a/util/iov.c
+++ b/util/iov.c
@@ -17,6 +17,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qemu/iov.h"
 #include "qemu/sockets.h"
 
-- 
2.4.3

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

* [Qemu-devel] [PATCH 07/15] include/hw/hw.h: Don't include qemu-common.h
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
                   ` (5 preceding siblings ...)
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 06/15] include/qemu/iov.h: Don't include qemu-common.h Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 08/15] hw/pci/pci.h: " Markus Armbruster
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

qemu-common.h should only be included by .c files.  Its file comment
explains why: "No header file should depend on qemu-common.h, as this
would easily lead to circular header dependencies."

hw/hw.h includes qemu-common.h, but its users generally need only
hw_error() and qemu/module.h from it.  Move the former to hw/hw.h,
include the latter there, and drop the ill-advised include.
hw/misc/cbus.c now misses hw_error(), so include hw/hw.h there.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/misc/cbus.c        | 2 +-
 include/hw/hw.h       | 4 +++-
 include/qemu-common.h | 4 ----
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/hw/misc/cbus.c b/hw/misc/cbus.c
index fafe070..0c207e3 100644
--- a/hw/misc/cbus.c
+++ b/hw/misc/cbus.c
@@ -21,7 +21,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
+#include "hw/hw.h"
 #include "hw/irq.h"
 #include "hw/devices.h"
 #include "sysemu/sysemu.h"
diff --git a/include/hw/hw.h b/include/hw/hw.h
index cd3d410..2cb69d5 100644
--- a/include/hw/hw.h
+++ b/include/hw/hw.h
@@ -2,7 +2,6 @@
 #ifndef QEMU_HW_H
 #define QEMU_HW_H
 
-#include "qemu-common.h"
 
 #if !defined(CONFIG_USER_ONLY) && !defined(NEED_CPU_H)
 #include "exec/cpu-common.h"
@@ -13,6 +12,7 @@
 #include "block/aio.h"
 #include "migration/vmstate.h"
 #include "qemu/log.h"
+#include "qemu/module.h"
 
 #ifdef NEED_CPU_H
 #if TARGET_LONG_BITS == 64
@@ -41,6 +41,8 @@ typedef void QEMUResetHandler(void *opaque);
 void qemu_register_reset(QEMUResetHandler *func, void *opaque);
 void qemu_unregister_reset(QEMUResetHandler *func, void *opaque);
 
+void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
+
 #ifdef NEED_CPU_H
 #if TARGET_LONG_BITS == 64
 #define VMSTATE_UINTTL_V(_f, _s, _v)                                  \
diff --git a/include/qemu-common.h b/include/qemu-common.h
index b8fbd9e..ba37968 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -303,10 +303,6 @@ int qemu_openpty_raw(int *aslave, char *pty_name);
     sendto(sockfd, buf, len, flags, destaddr, addrlen)
 #endif
 
-/* Error handling.  */
-
-void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
-
 struct ParallelIOArg {
     void *buffer;
     int count;
-- 
2.4.3

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

* [Qemu-devel] [PATCH 08/15] hw/pci/pci.h: Don't include qemu-common.h
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
                   ` (6 preceding siblings ...)
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 07/15] include/hw/hw.h: " Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 09/15] Move HOST_LONG_BITS from qemu-common.h to qemu/osdep.h Markus Armbruster
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

qemu-common.h should only be included by .c files.  Its file comment
explains why: "No header file should depend on qemu-common.h, as this
would easily lead to circular header dependencies."

hw/pci/pci.h includes qemu-common.h, but its users only need pcibus_t
and PCIHostDeviceAddress from it.  Move them to hw/pci/pci.h and drop
the ill-advised include.  Include hw/pci/pci.h where the moved stuff
is now missing.  Except we can't in target-i386/kvm_i386.h, because
that would break the i386-linux-user compile.  Add
PCIHostDeviceAddress to qemu/typedefs.h instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/core/qdev-properties.c |  1 +
 include/hw/pci/pci.h      | 11 +++++++++--
 include/qemu-common.h     |  9 ---------
 include/qemu/typedefs.h   |  1 +
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index eef932c..a8c77ec 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -2,6 +2,7 @@
 #include "net/net.h"
 #include "hw/qdev.h"
 #include "qapi/error.h"
+#include "hw/pci/pci.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/error-report.h"
 #include "sysemu/block-backend.h"
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index 0be07c8..ef6ba51 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -1,8 +1,6 @@
 #ifndef QEMU_PCI_H
 #define QEMU_PCI_H
 
-#include "qemu-common.h"
-
 #include "hw/qdev.h"
 #include "exec/memory.h"
 #include "sysemu/dma.h"
@@ -97,6 +95,15 @@
 
 #define FMT_PCIBUS                      PRIx64
 
+typedef uint64_t pcibus_t;
+
+struct PCIHostDeviceAddress {
+    unsigned int domain;
+    unsigned int bus;
+    unsigned int slot;
+    unsigned int function;
+};
+
 typedef void PCIConfigWriteFunc(PCIDevice *pci_dev,
                                 uint32_t address, uint32_t data, int len);
 typedef uint32_t PCIConfigReadFunc(PCIDevice *pci_dev,
diff --git a/include/qemu-common.h b/include/qemu-common.h
index ba37968..5a2d997 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -310,15 +310,6 @@ struct ParallelIOArg {
 
 typedef int (*DMA_transfer_handler) (void *opaque, int nchan, int pos, int size);
 
-typedef uint64_t pcibus_t;
-
-typedef struct PCIHostDeviceAddress {
-    unsigned int domain;
-    unsigned int bus;
-    unsigned int slot;
-    unsigned int function;
-} PCIHostDeviceAddress;
-
 void tcg_exec_init(unsigned long tb_size);
 bool tcg_enabled(void);
 
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 099146e..c1d2c2e 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -65,6 +65,7 @@ typedef struct PCIEPort PCIEPort;
 typedef struct PCIESlot PCIESlot;
 typedef struct PCIExpressDevice PCIExpressDevice;
 typedef struct PCIExpressHost PCIExpressHost;
+typedef struct PCIHostDeviceAddress PCIHostDeviceAddress;
 typedef struct PCIHostState PCIHostState;
 typedef struct PCMachineClass PCMachineClass;
 typedef struct PCMachineState PCMachineState;
-- 
2.4.3

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

* [Qemu-devel] [PATCH 09/15] Move HOST_LONG_BITS from qemu-common.h to qemu/osdep.h
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
                   ` (7 preceding siblings ...)
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 08/15] hw/pci/pci.h: " Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 10/15] Move QEMU_ALIGN_*() " Markus Armbruster
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

qemu-common.h should only be included by .c files.  Its file comment
explains why: "No header file should depend on qemu-common.h, as this
would easily lead to circular header dependencies."

One of the reasons for headers to include it is HOST_LONG_BITS.  Move
that to its more natural home qemu/osdep.h, to facilitate removing
these ill-advised includes later on.

This also lets us use HOST_LONG_BITS in bswap.h instead of duplicating
its definition there to avoid cyclic inclusion.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/qemu-common.h | 9 ---------
 include/qemu/bswap.h  | 6 ++----
 include/qemu/osdep.h  | 9 +++++++++
 3 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/include/qemu-common.h b/include/qemu-common.h
index 5a2d997..fbd999c 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -23,15 +23,6 @@
 #include "qemu/option.h"
 #include "qemu/host-utils.h"
 
-/* HOST_LONG_BITS is the size of a native pointer in bits. */
-#if UINTPTR_MAX == UINT32_MAX
-# define HOST_LONG_BITS 32
-#elif UINTPTR_MAX == UINT64_MAX
-# define HOST_LONG_BITS 64
-#else
-# error Unknown pointer size
-#endif
-
 void cpu_ticks_init(void);
 
 /* icount */
diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h
index 95071ba..fcedf0d 100644
--- a/include/qemu/bswap.h
+++ b/include/qemu/bswap.h
@@ -419,11 +419,9 @@ static inline void stfq_be_p(void *ptr, float64 v)
 
 static inline unsigned long leul_to_cpu(unsigned long v)
 {
-    /* In order to break an include loop between here and
-       qemu-common.h, don't rely on HOST_LONG_BITS.  */
-#if ULONG_MAX == UINT32_MAX
+#if HOST_LONG_BITS == 32
     return le_bswap(v, 32);
-#elif ULONG_MAX == UINT64_MAX
+#elif HOST_LONG_BITS == 64
     return le_bswap(v, 64);
 #else
 # error Unknown sizeof long
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 1c0ce4a..64b06e3 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -127,6 +127,15 @@ extern int daemon(int, int);
 #define TIME_MAX LONG_MAX
 #endif
 
+/* HOST_LONG_BITS is the size of a native pointer in bits. */
+#if UINTPTR_MAX == UINT32_MAX
+# define HOST_LONG_BITS 32
+#elif UINTPTR_MAX == UINT64_MAX
+# define HOST_LONG_BITS 64
+#else
+# error Unknown pointer size
+#endif
+
 #ifndef MIN
 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
 #endif
-- 
2.4.3

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

* [Qemu-devel] [PATCH 10/15] Move QEMU_ALIGN_*() from qemu-common.h to qemu/osdep.h
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
                   ` (8 preceding siblings ...)
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 09/15] Move HOST_LONG_BITS from qemu-common.h to qemu/osdep.h Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 11/15] Move ParallelIOArg from qemu-common.h to sysemu/char.h Markus Armbruster
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

qemu-common.h should only be included by .c files.  Its file comment
explains why: "No header file should depend on qemu-common.h, as this
would easily lead to circular header dependencies."

One of the reasons for headers to include it is QEMU_ALIGN_UP() and
QEMU_ALIGN_DOWN().  Move them next to ROUND_UP() in qemu/osdep.h, to
facilitate removing these ill-advised includes later on.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/qemu-common.h | 6 ------
 include/qemu/osdep.h  | 6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/qemu-common.h b/include/qemu-common.h
index fbd999c..f272752 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -369,12 +369,6 @@ static inline uint8_t from_bcd(uint8_t val)
     return ((val >> 4) * 10) + (val & 0x0f);
 }
 
-/* Round number down to multiple */
-#define QEMU_ALIGN_DOWN(n, m) ((n) / (m) * (m))
-
-/* Round number up to multiple */
-#define QEMU_ALIGN_UP(n, m) QEMU_ALIGN_DOWN((n) + (m) - 1, (m))
-
 #include "qemu/module.h"
 
 /*
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 64b06e3..97a7fa2 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -149,6 +149,12 @@ extern int daemon(int, int);
 #define MIN_NON_ZERO(a, b) (((a) != 0 && (a) < (b)) ? (a) : (b))
 #endif
 
+/* Round number down to multiple */
+#define QEMU_ALIGN_DOWN(n, m) ((n) / (m) * (m))
+
+/* Round number up to multiple */
+#define QEMU_ALIGN_UP(n, m) QEMU_ALIGN_DOWN((n) + (m) - 1, (m))
+
 #ifndef ROUND_UP
 #define ROUND_UP(n,d) (((n) + (d) - 1) & -(d))
 #endif
-- 
2.4.3

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

* [Qemu-devel] [PATCH 11/15] Move ParallelIOArg from qemu-common.h to sysemu/char.h
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
                   ` (9 preceding siblings ...)
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 10/15] Move QEMU_ALIGN_*() " Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 12/15] isa: Move DMA_transfer_handler from qemu-common.h to hw/isa/isa.h Markus Armbruster
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

ParallelIOArg is shared between just qemu-char.c and
hw/char/parallel.c, and as such has no business in qemu-common.h.
Move it to sysemu/char.h.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/qemu-common.h | 5 -----
 include/sysemu/char.h | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/qemu-common.h b/include/qemu-common.h
index f272752..e7bd1f8 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -294,11 +294,6 @@ int qemu_openpty_raw(int *aslave, char *pty_name);
     sendto(sockfd, buf, len, flags, destaddr, addrlen)
 #endif
 
-struct ParallelIOArg {
-    void *buffer;
-    int count;
-};
-
 typedef int (*DMA_transfer_handler) (void *opaque, int nchan, int pos, int size);
 
 void tcg_exec_init(unsigned long tb_size);
diff --git a/include/sysemu/char.h b/include/sysemu/char.h
index e46884f..7aac3b6 100644
--- a/include/sysemu/char.h
+++ b/include/sysemu/char.h
@@ -41,6 +41,11 @@ typedef struct {
 #define CHR_IOCTL_PP_EPP_WRITE       11
 #define CHR_IOCTL_PP_DATA_DIR        12
 
+struct ParallelIOArg {
+    void *buffer;
+    int count;
+};
+
 #define CHR_IOCTL_SERIAL_SET_TIOCM   13
 #define CHR_IOCTL_SERIAL_GET_TIOCM   14
 
-- 
2.4.3

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

* [Qemu-devel] [PATCH 12/15] isa: Move DMA_transfer_handler from qemu-common.h to hw/isa/isa.h
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
                   ` (10 preceding siblings ...)
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 11/15] Move ParallelIOArg from qemu-common.h to sysemu/char.h Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 13/15] include/crypto: Include qapi-types.h instead of qemu-common.h Markus Armbruster
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

DMA_transfer_handler is actually an ISA thing, and as such has no
business in qemu-common.h.  Move it to hw/isa/isa.h, and rename it to
IsaDmaTransferHandler.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/dma/i8257.c         | 2 +-
 include/hw/isa/i8257.h | 2 +-
 include/hw/isa/isa.h   | 5 ++++-
 include/qemu-common.h  | 2 --
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c
index 6078893..f345c54 100644
--- a/hw/dma/i8257.c
+++ b/hw/dma/i8257.c
@@ -381,7 +381,7 @@ out:
 }
 
 static void i8257_dma_register_channel(IsaDma *obj, int nchan,
-                                       DMA_transfer_handler transfer_handler,
+                                       IsaDmaTransferHandler transfer_handler,
                                        void *opaque)
 {
     I8257State *d = I8257(obj);
diff --git a/include/hw/isa/i8257.h b/include/hw/isa/i8257.h
index 8d34ed1..8c44d36 100644
--- a/include/hw/isa/i8257.h
+++ b/include/hw/isa/i8257.h
@@ -11,7 +11,7 @@ typedef struct I8257Regs {
     uint8_t pageh;
     uint8_t dack;
     uint8_t eop;
-    DMA_transfer_handler transfer_handler;
+    IsaDmaTransferHandler transfer_handler;
     void *opaque;
 } I8257Regs;
 
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 0bbe21c..ffb2ea7 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -54,6 +54,9 @@ typedef enum {
     ISADMA_TRANSFER_ILLEGAL,
 } IsaDmaTransferMode;
 
+typedef int (*IsaDmaTransferHandler)(void *opaque, int nchan, int pos,
+                                     int size);
+
 typedef struct IsaDmaClass {
     InterfaceClass parent;
 
@@ -65,7 +68,7 @@ typedef struct IsaDmaClass {
     void (*release_DREQ)(IsaDma *obj, int nchan);
     void (*schedule)(IsaDma *obj);
     void (*register_channel)(IsaDma *obj, int nchan,
-                             DMA_transfer_handler transfer_handler,
+                             IsaDmaTransferHandler transfer_handler,
                              void *opaque);
 } IsaDmaClass;
 
diff --git a/include/qemu-common.h b/include/qemu-common.h
index e7bd1f8..bbb45b2 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -294,8 +294,6 @@ int qemu_openpty_raw(int *aslave, char *pty_name);
     sendto(sockfd, buf, len, flags, destaddr, addrlen)
 #endif
 
-typedef int (*DMA_transfer_handler) (void *opaque, int nchan, int pos, int size);
-
 void tcg_exec_init(unsigned long tb_size);
 bool tcg_enabled(void);
 
-- 
2.4.3

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

* [Qemu-devel] [PATCH 13/15] include/crypto: Include qapi-types.h instead of qemu-common.h
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
                   ` (11 preceding siblings ...)
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 12/15] isa: Move DMA_transfer_handler from qemu-common.h to hw/isa/isa.h Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:51   ` Daniel P. Berrange
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers Markus Armbruster
                   ` (2 subsequent siblings)
  15 siblings, 1 reply; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

qemu-common.h should only be included by .c files.  Its file comment
explains why: "No header file should depend on qemu-common.h, as this
would easily lead to circular header dependencies."

Several include/crypto/ headers include qemu-common.h, but either need
just qapi-types.h from it, or nothing at all.  Replace or drop the
include accordingly.  tests/test-crypto-secret.c now misses
qemu/module.h, so include it there.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/crypto/cipher.h    | 2 +-
 include/crypto/hash.h      | 2 +-
 include/crypto/init.h      | 2 --
 include/crypto/secret.h    | 1 -
 include/crypto/tlscreds.h  | 1 -
 tests/test-crypto-secret.c | 1 +
 6 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/include/crypto/cipher.h b/include/crypto/cipher.h
index c04c3ac..d770c48 100644
--- a/include/crypto/cipher.h
+++ b/include/crypto/cipher.h
@@ -21,7 +21,7 @@
 #ifndef QCRYPTO_CIPHER_H__
 #define QCRYPTO_CIPHER_H__
 
-#include "qemu-common.h"
+#include "qapi-types.h"
 
 typedef struct QCryptoCipher QCryptoCipher;
 
diff --git a/include/crypto/hash.h b/include/crypto/hash.h
index aebccd1..f38caed 100644
--- a/include/crypto/hash.h
+++ b/include/crypto/hash.h
@@ -21,7 +21,7 @@
 #ifndef QCRYPTO_HASH_H__
 #define QCRYPTO_HASH_H__
 
-#include "qemu-common.h"
+#include "qapi-types.h"
 
 /* See also "QCryptoHashAlgorithm" defined in qapi/crypto.json */
 
diff --git a/include/crypto/init.h b/include/crypto/init.h
index 4836a37..2513ed0 100644
--- a/include/crypto/init.h
+++ b/include/crypto/init.h
@@ -21,8 +21,6 @@
 #ifndef QCRYPTO_INIT_H__
 #define QCRYPTO_INIT_H__
 
-#include "qemu-common.h"
-
 int qcrypto_init(Error **errp);
 
 #endif /* QCRYPTO_INIT_H__ */
diff --git a/include/crypto/secret.h b/include/crypto/secret.h
index 60f2a50..b7392c6 100644
--- a/include/crypto/secret.h
+++ b/include/crypto/secret.h
@@ -21,7 +21,6 @@
 #ifndef QCRYPTO_SECRET_H__
 #define QCRYPTO_SECRET_H__
 
-#include "qemu-common.h"
 #include "qom/object.h"
 
 #define TYPE_QCRYPTO_SECRET "secret"
diff --git a/include/crypto/tlscreds.h b/include/crypto/tlscreds.h
index 4bf1d2e..8e2babd 100644
--- a/include/crypto/tlscreds.h
+++ b/include/crypto/tlscreds.h
@@ -21,7 +21,6 @@
 #ifndef QCRYPTO_TLSCRED_H__
 #define QCRYPTO_TLSCRED_H__
 
-#include "qemu-common.h"
 #include "qom/object.h"
 
 #ifdef CONFIG_GNUTLS
diff --git a/tests/test-crypto-secret.c b/tests/test-crypto-secret.c
index 43e2952..aa26c20 100644
--- a/tests/test-crypto-secret.c
+++ b/tests/test-crypto-secret.c
@@ -24,6 +24,7 @@
 #include "crypto/init.h"
 #include "crypto/secret.h"
 #include "qapi/error.h"
+#include "qemu/module.h"
 
 static void test_secret_direct(void)
 {
-- 
2.4.3

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

* [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
                   ` (12 preceding siblings ...)
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 13/15] include/crypto: Include qapi-types.h instead of qemu-common.h Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:54   ` Daniel P. Berrange
  2016-03-15 15:55   ` Paolo Bonzini
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 15/15] Drop superfluous qemu-common.h inclusions Markus Armbruster
  2016-03-15 15:30 ` [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Paolo Bonzini
  15 siblings, 2 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

qemu-common.h should only be included by .c files.  Its file comment
explains why: "No header file should depend on qemu-common.h, as this
would easily lead to circular header dependencies."

We include it in many headers anyway.  Fix that.

Dropping these ill-advised includes requires including
qemu/fprintf-fn.h, cpu.h or exec/hwaddr.h instead in a few headers
that actually need those, and of course including qemu-common.h in .c
files that need it, except some of them need only qemu/module.h.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 arch_init.c                              | 2 ++
 audio/audio.c                            | 2 ++
 backends/hostmem-ram.c                   | 2 ++
 backends/rng-random.c                    | 1 +
 backends/rng.c                           | 1 +
 backends/tpm.c                           | 1 +
 block/backup.c                           | 2 +-
 block/blkverify.c                        | 1 +
 block/block-backend.c                    | 1 +
 block/gluster.c                          | 2 ++
 block/io.c                               | 1 +
 block/nbd-client.h                       | 1 -
 block/nbd.c                              | 1 +
 block/null.c                             | 1 +
 block/qapi.c                             | 1 +
 block/qed.c                              | 1 +
 block/quorum.c                           | 1 +
 block/raw_bsd.c                          | 1 +
 block/ssh.c                              | 3 +--
 block/throttle-groups.c                  | 1 +
 blockdev.c                               | 1 +
 cpu-exec.c                               | 1 +
 cpus.c                                   | 3 +--
 cputlb.c                                 | 1 +
 crypto/secret.c                          | 1 +
 crypto/tlscreds.c                        | 1 +
 crypto/tlscredsanon.c                    | 1 +
 crypto/tlscredsx509.c                    | 1 +
 hmp.c                                    | 1 +
 hmp.h                                    | 1 -
 hw/9pfs/9p-handle.c                      | 1 +
 hw/9pfs/9p-local.c                       | 1 +
 hw/9pfs/9p-proxy.c                       | 1 +
 hw/9pfs/9p-synth.c                       | 1 +
 hw/alpha/dp264.c                         | 1 +
 hw/arm/boot.c                            | 1 +
 hw/arm/digic_boards.c                    | 1 +
 hw/arm/highbank.c                        | 1 +
 hw/arm/omap1.c                           | 1 +
 hw/arm/pxa2xx.c                          | 1 +
 hw/arm/strongarm.c                       | 1 +
 hw/arm/vexpress.c                        | 1 +
 hw/arm/virt.c                            | 1 +
 hw/block/nvme.c                          | 1 +
 hw/core/fw-path-provider.c               | 1 +
 hw/core/loader.c                         | 1 +
 hw/core/machine.c                        | 1 +
 hw/core/nmi.c                            | 1 +
 hw/core/ptimer.c                         | 2 ++
 hw/core/qdev-properties.c                | 1 +
 hw/core/qdev.c                           | 1 +
 hw/core/stream.c                         | 1 +
 hw/display/qxl.h                         | 2 --
 hw/dma/pl330.c                           | 1 +
 hw/i386/pc.c                             | 2 ++
 hw/i386/pc_sysfw.c                       | 1 +
 hw/ide/core.c                            | 1 +
 hw/lm32/lm32_boards.c                    | 1 +
 hw/lm32/lm32_hwsetup.h                   | 1 -
 hw/lm32/milkymist.c                      | 1 +
 hw/mips/mips_fulong2e.c                  | 1 +
 hw/mips/mips_jazz.c                      | 1 +
 hw/mips/mips_malta.c                     | 1 +
 hw/mips/mips_mipssim.c                   | 2 ++
 hw/mips/mips_r4k.c                       | 2 ++
 hw/misc/ivshmem.c                        | 2 ++
 hw/misc/macio/cuda.c                     | 1 +
 hw/net/allwinner_emac.c                  | 1 +
 hw/nvram/fw_cfg.c                        | 1 +
 hw/nvram/mac_nvram.c                     | 2 ++
 hw/pci-bridge/dec.h                      | 2 --
 hw/pci-host/prep.c                       | 1 +
 hw/pci/msix.c                            | 1 +
 hw/pci/pci.c                             | 2 ++
 hw/ppc/mac_newworld.c                    | 2 ++
 hw/ppc/mac_oldworld.c                    | 2 ++
 hw/ppc/ppc405_boards.c                   | 2 ++
 hw/ppc/spapr_drc.c                       | 1 +
 hw/ppc/spapr_events.c                    | 2 ++
 hw/ppc/spapr_rtas.c                      | 2 ++
 hw/ppc/spapr_rtc.c                       | 2 ++
 hw/ppc/virtex_ml507.c                    | 1 +
 hw/s390x/ipl.c                           | 1 +
 hw/scsi/megasas.c                        | 1 +
 hw/scsi/scsi-bus.c                       | 1 +
 hw/scsi/vhost-scsi.c                     | 1 +
 hw/sd/core.c                             | 1 +
 hw/smbios/smbios.c                       | 1 +
 hw/sparc/leon3.c                         | 2 ++
 hw/sparc/sun4m.c                         | 2 ++
 hw/sparc64/sun4u.c                       | 2 ++
 hw/timer/ds1338.c                        | 1 +
 hw/timer/m48t59.c                        | 1 +
 hw/timer/mc146818rtc.c                   | 2 ++
 hw/timer/pl031.c                         | 1 +
 hw/timer/twl92230.c                      | 1 +
 hw/tpm/tpm_tis.h                         | 1 -
 hw/usb/bus.c                             | 1 +
 hw/usb/ccid-card-passthru.c              | 1 +
 hw/vfio/pci.h                            | 1 -
 hw/virtio/vhost-user.c                   | 1 +
 hw/xen/xen_pt.h                          | 1 -
 include/block/aio.h                      | 1 -
 include/block/nbd.h                      | 2 --
 include/block/qapi.h                     | 1 +
 include/block/snapshot.h                 | 1 -
 include/block/write-threshold.h          | 2 --
 include/disas/bfd.h                      | 2 +-
 include/disas/disas.h                    | 2 --
 include/exec/cpu-all.h                   | 1 -
 include/exec/exec-all.h                  | 2 --
 include/exec/ioport.h                    | 1 -
 include/hw/acpi/tco.h                    | 1 -
 include/hw/arm/allwinner-a10.h           | 1 -
 include/hw/arm/bcm2835_peripherals.h     | 1 -
 include/hw/arm/exynos4210.h              | 1 -
 include/hw/arm/omap.h                    | 1 +
 include/hw/arm/sysbus-fdt.h              | 1 -
 include/hw/arm/virt-acpi-build.h         | 1 -
 include/hw/arm/virt.h                    | 2 +-
 include/hw/arm/xlnx-zynqmp.h             | 1 -
 include/hw/block/block.h                 | 1 -
 include/hw/fw-path-provider.h            | 1 -
 include/hw/hw.h                          | 1 +
 include/hw/i386/apic.h                   | 2 +-
 include/hw/i386/pc.h                     | 1 -
 include/hw/ipmi/ipmi.h                   | 1 -
 include/hw/isa/apm.h                     | 1 -
 include/hw/lm32/lm32_pic.h               | 1 -
 include/hw/nmi.h                         | 1 -
 include/hw/pci-host/apb.h                | 1 -
 include/hw/pci-host/pam.h                | 1 -
 include/hw/pci/msi.h                     | 1 -
 include/hw/pci/msix.h                    | 1 -
 include/hw/pci/shpc.h                    | 1 -
 include/hw/pci/slotid_cap.h              | 1 -
 include/hw/ppc/openpic.h                 | 1 -
 include/hw/ptimer.h                      | 1 -
 include/hw/sd/sdhci.h                    | 1 -
 include/hw/sh4/sh_intc.h                 | 1 -
 include/hw/sparc/sun4m.h                 | 1 -
 include/hw/stream.h                      | 1 -
 include/hw/timer/m48t59.h                | 1 -
 include/hw/vfio/vfio-common.h            | 1 -
 include/hw/virtio/vhost-scsi.h           | 1 -
 include/hw/xen/xen.h                     | 1 -
 include/io/channel.h                     | 1 -
 include/io/task.h                        | 1 -
 include/migration/migration.h            | 1 -
 include/monitor/monitor.h                | 1 -
 include/net/filter.h                     | 1 -
 include/net/net.h                        | 1 -
 include/net/queue.h                      | 2 --
 include/net/slirp.h                      | 1 -
 include/net/tap.h                        | 1 -
 include/qapi/qmp/json-parser.h           | 1 -
 include/qemu-io.h                        | 2 --
 include/qemu/base64.h                    | 3 ---
 include/qemu/buffer.h                    | 2 --
 include/qemu/crc32c.h                    | 2 --
 include/qemu/event_notifier.h            | 2 --
 include/qemu/mmap-alloc.h                | 2 --
 include/qemu/throttle.h                  | 1 -
 include/qemu/timer.h                     | 1 -
 include/sysemu/char.h                    | 1 -
 include/sysemu/cpus.h                    | 2 ++
 include/sysemu/kvm.h                     | 4 ++++
 include/sysemu/qtest.h                   | 2 --
 include/sysemu/rng.h                     | 1 -
 include/sysemu/tpm_backend.h             | 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-util.c                        | 1 +
 io/channel-websock.c                     | 1 +
 io/channel.c                             | 1 +
 ioport.c                                 | 1 +
 linux-user/elfload.c                     | 2 ++
 linux-user/uaccess.c                     | 2 +-
 memory.c                                 | 1 +
 migration/qemu-file-internal.h           | 1 -
 migration/ram.c                          | 1 +
 monitor.c                                | 2 ++
 net/hub.h                                | 2 --
 net/slirp.c                              | 1 +
 net/tap_int.h                            | 1 -
 os-posix.c                               | 1 +
 qdev-monitor.c                           | 1 +
 qemu-io-cmds.c                           | 1 +
 qemu-io.c                                | 1 +
 qemu-timer.c                             | 1 +
 qga/commands-posix.c                     | 1 +
 qga/commands.c                           | 1 +
 qga/guest-agent-core.h                   | 1 -
 qga/main.c                               | 1 +
 qobject/qjson.c                          | 1 +
 qtest.c                                  | 1 +
 scripts/tracetool/format/h.py            | 2 --
 scripts/tracetool/format/ust_events_h.py | 1 -
 slirp/ip_icmp.c                          | 1 +
 slirp/libslirp.h                         | 2 --
 slirp/misc.c                             | 2 +-
 slirp/tcp_subr.c                         | 1 +
 spice-qemu-char.c                        | 1 +
 target-alpha/cpu.h                       | 1 -
 target-alpha/translate.c                 | 1 +
 target-arm/cpu.h                         | 1 -
 target-cris/cpu.h                        | 1 -
 target-i386/cpu.c                        | 3 ++-
 target-i386/cpu.h                        | 1 -
 target-i386/machine.c                    | 1 +
 target-lm32/cpu.h                        | 1 -
 target-m68k/cpu.h                        | 1 -
 target-microblaze/cpu.h                  | 1 -
 target-mips/cpu.h                        | 1 -
 target-moxie/cpu.h                       | 1 -
 target-openrisc/cpu.h                    | 1 -
 target-openrisc/exception.h              | 1 -
 target-ppc/cpu-models.c                  | 1 +
 target-ppc/cpu.h                         | 1 -
 target-ppc/translate_init.c              | 1 +
 target-s390x/cpu.h                       | 1 -
 target-s390x/helper.c                    | 1 +
 target-s390x/misc_helper.c               | 1 +
 target-sh4/cpu.h                         | 1 -
 target-sparc/cpu.c                       | 2 ++
 target-sparc/cpu.h                       | 1 -
 target-tilegx/cpu.h                      | 1 -
 target-tricore/cpu.h                     | 1 -
 target-unicore32/cpu.h                   | 1 -
 target-xtensa/cpu.h                      | 1 -
 tcg/tcg.h                                | 2 +-
 tests/crypto-tls-x509-helpers.h          | 2 --
 tests/test-crypto-tlscredsx509.c         | 1 +
 tests/test-crypto-tlssession.c           | 1 +
 tests/test-io-channel-buffer.c           | 2 +-
 tests/test-io-channel-command.c          | 1 +
 tests/test-io-channel-file.c             | 1 +
 tests/test-io-channel-socket.c           | 1 +
 tests/test-io-channel-tls.c              | 1 +
 tests/test-io-task.c                     | 1 +
 tests/vhost-user-test.c                  | 1 +
 trace/control.c                          | 1 +
 trace/control.h                          | 1 -
 ui/keymaps.c                             | 1 +
 ui/keymaps.h                             | 2 --
 ui/vnc.c                                 | 1 +
 ui/vnc.h                                 | 1 -
 util/buffer.c                            | 1 +
 util/mmap-alloc.c                        | 2 ++
 util/oslib-posix.c                       | 2 +-
 util/qemu-sockets.c                      | 3 ++-
 vl.c                                     | 1 +
 255 files changed, 188 insertions(+), 133 deletions(-)

diff --git a/arch_init.c b/arch_init.c
index f6aba02..4ec96b2 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -21,7 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/arch_init.h"
 #include "hw/pci/pci.h"
diff --git a/audio/audio.c b/audio/audio.c
index e841532..a905a0e 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -21,7 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "audio.h"
 #include "monitor/monitor.h"
diff --git a/backends/hostmem-ram.c b/backends/hostmem-ram.c
index 04a7ac3..78de9b1 100644
--- a/backends/hostmem-ram.c
+++ b/backends/hostmem-ram.c
@@ -9,9 +9,11 @@
  * 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 "qapi/error.h"
+#include "qemu/module.h"
 #include "qom/object_interfaces.h"
 
 #define TYPE_MEMORY_BACKEND_RAM "memory-backend-ram"
diff --git a/backends/rng-random.c b/backends/rng-random.c
index 2e44e25..c214a85 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -16,6 +16,7 @@
 #include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/main-loop.h"
+#include "qemu/module.h"
 
 struct RndRandom
 {
diff --git a/backends/rng.c b/backends/rng.c
index 398ebe4..391888b 100644
--- a/backends/rng.c
+++ b/backends/rng.c
@@ -14,6 +14,7 @@
 #include "sysemu/rng.h"
 #include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
+#include "qemu/module.h"
 #include "qom/object_interfaces.h"
 
 void rng_backend_request_entropy(RngBackend *s, size_t size,
diff --git a/backends/tpm.c b/backends/tpm.c
index 536f262..84c4e37 100644
--- a/backends/tpm.c
+++ b/backends/tpm.c
@@ -17,6 +17,7 @@
 #include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
 #include "sysemu/tpm.h"
+#include "qemu/module.h"
 #include "qemu/thread.h"
 #include "sysemu/tpm_backend_int.h"
 
diff --git a/block/backup.c b/block/backup.c
index 0e59471..6fc5c09 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -12,7 +12,7 @@
  */
 
 #include "qemu/osdep.h"
-
+#include "qemu-common.h"
 #include "trace.h"
 #include "block/block.h"
 #include "block/block_int.h"
diff --git a/block/blkverify.c b/block/blkverify.c
index 41432e5..11c9b9f 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "qemu/sockets.h" /* for EINPROGRESS on Windows */
 #include "block/block_int.h"
diff --git a/block/block-backend.c b/block/block-backend.c
index ebdf78a..a8b0d96 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "sysemu/block-backend.h"
 #include "block/block_int.h"
 #include "block/blockjob.h"
diff --git a/block/gluster.c b/block/gluster.c
index 51e154c..a5595db 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -7,10 +7,12 @@
  * See the COPYING file in the top-level directory.
  *
  */
+
 #include "qemu/osdep.h"
 #include <glusterfs/api/glfs.h>
 #include "block/block_int.h"
 #include "qapi/error.h"
+#include "qemu/module.h"
 #include "qemu/uri.h"
 
 typedef struct GlusterAIOCB {
diff --git a/block/io.c b/block/io.c
index d636bf7..69d1134 100644
--- a/block/io.c
+++ b/block/io.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "trace.h"
 #include "sysemu/block-backend.h"
 #include "block/blockjob.h"
diff --git a/block/nbd-client.h b/block/nbd-client.h
index 53f116d..218f003 100644
--- a/block/nbd-client.h
+++ b/block/nbd-client.h
@@ -1,7 +1,6 @@
 #ifndef NBD_CLIENT_H
 #define NBD_CLIENT_H
 
-#include "qemu-common.h"
 #include "block/nbd.h"
 #include "block/block_int.h"
 #include "io/channel-socket.h"
diff --git a/block/nbd.c b/block/nbd.c
index 673f4a9..bf8d44b 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -27,6 +27,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "block/nbd-client.h"
 #include "qapi/error.h"
 #include "qemu/uri.h"
diff --git a/block/null.c b/block/null.c
index 00bc6e4..8a1c8fa 100644
--- a/block/null.c
+++ b/block/null.c
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "block/block_int.h"
+#include "qemu/module.h"
 
 #define NULL_OPT_LATENCY "latency-ns"
 
diff --git a/block/qapi.c b/block/qapi.c
index db2d3fb..979ca8d 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "block/qapi.h"
 #include "block/block_int.h"
 #include "block/throttle-groups.h"
diff --git a/block/qed.c b/block/qed.c
index 3679a32..3709d7b 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
 #include "trace.h"
diff --git a/block/quorum.c b/block/quorum.c
index 11cc60b..548de0d 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -23,6 +23,7 @@
 #include "qapi/qmp/qlist.h"
 #include "qapi/qmp/qstring.h"
 #include "qapi-event.h"
+#include "qemu/module.h"
 #include "crypto/hash.h"
 
 #define HASH_LENGTH 32
diff --git a/block/raw_bsd.c b/block/raw_bsd.c
index 41dddf8..f127445 100644
--- a/block/raw_bsd.c
+++ b/block/raw_bsd.c
@@ -27,6 +27,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/module.h"
 #include "block/block_int.h"
 #include "qapi/error.h"
 #include "qemu/option.h"
diff --git a/block/ssh.c b/block/ssh.c
index 06928ed..93ca45b 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -23,10 +23,9 @@
  */
 
 #include "qemu/osdep.h"
-
 #include <libssh2.h>
 #include <libssh2_sftp.h>
-
+#include "qemu-common.h"
 #include "block/block_int.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
diff --git a/block/throttle-groups.c b/block/throttle-groups.c
index 4920e09..ca708fe 100644
--- a/block/throttle-groups.c
+++ b/block/throttle-groups.c
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "block/throttle-groups.h"
 #include "qemu/queue.h"
+#include "qemu/module.h"
 #include "qemu/thread.h"
 #include "sysemu/qtest.h"
 
diff --git a/blockdev.c b/blockdev.c
index 0f20c65..9cc9866 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -31,6 +31,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "hw/block/block.h"
diff --git a/cpu-exec.c b/cpu-exec.c
index fd92452..dd6eb80 100644
--- a/cpu-exec.c
+++ b/cpu-exec.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 "cpu.h"
 #include "trace.h"
 #include "disas/disas.h"
diff --git a/cpus.c b/cpus.c
index bc774e2..c50723a 100644
--- a/cpus.c
+++ b/cpus.c
@@ -22,9 +22,8 @@
  * THE SOFTWARE.
  */
 
-/* Needed early for CONFIG_BSD etc. */
 #include "qemu/osdep.h"
-
+#include "qemu-common.h"
 #include "monitor/monitor.h"
 #include "qapi/qmp/qerror.h"
 #include "qemu/error-report.h"
diff --git a/cputlb.c b/cputlb.c
index 2f7a166..d78b62a 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/memory.h"
diff --git a/crypto/secret.c b/crypto/secret.c
index 285ab7a..65929ac 100644
--- a/crypto/secret.c
+++ b/crypto/secret.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/module.h"
 #include "crypto/secret.h"
 #include "crypto/cipher.h"
 #include "qapi/error.h"
diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c
index 1620e12..edc7f88 100644
--- a/crypto/tlscreds.c
+++ b/crypto/tlscreds.c
@@ -20,6 +20,7 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
+#include "qemu/module.h"
 #include "crypto/tlscredspriv.h"
 #include "trace.h"
 
diff --git a/crypto/tlscredsanon.c b/crypto/tlscredsanon.c
index 1464220..50df4f0 100644
--- a/crypto/tlscredsanon.c
+++ b/crypto/tlscredsanon.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/module.h"
 #include "crypto/tlscredsanon.h"
 #include "crypto/tlscredspriv.h"
 #include "qapi/error.h"
diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c
index 6a0179c..2709b2b 100644
--- a/crypto/tlscredsx509.c
+++ b/crypto/tlscredsx509.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/module.h"
 #include "crypto/tlscredsx509.h"
 #include "crypto/tlscredspriv.h"
 #include "crypto/secret.h"
diff --git a/hmp.c b/hmp.c
index 5b6084a..4fb2da6 100644
--- a/hmp.c
+++ b/hmp.c
@@ -14,6 +14,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hmp.h"
 #include "net/net.h"
 #include "net/eth.h"
diff --git a/hmp.h b/hmp.h
index 093d65f..eefd80f 100644
--- a/hmp.h
+++ b/hmp.h
@@ -14,7 +14,6 @@
 #ifndef HMP_H
 #define HMP_H
 
-#include "qemu-common.h"
 #include "qemu/readline.h"
 #include "qapi-types.h"
 #include "qapi/qmp/qdict.h"
diff --git a/hw/9pfs/9p-handle.c b/hw/9pfs/9p-handle.c
index 5088ef5..85da2a7 100644
--- a/hw/9pfs/9p-handle.c
+++ b/hw/9pfs/9p-handle.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "9p.h"
 #include "9p-xattr.h"
 #include <arpa/inet.h>
diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
index ca995a7..8d9d00f 100644
--- a/hw/9pfs/9p-local.c
+++ b/hw/9pfs/9p-local.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "9p.h"
 #include "9p-xattr.h"
 #include "fsdev/qemu-fsdev.h"   /* local_ops */
diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c
index 0805c9c..211bf47 100644
--- a/hw/9pfs/9p-proxy.c
+++ b/hw/9pfs/9p-proxy.c
@@ -10,6 +10,7 @@
  * the COPYING file in the top-level directory.
  */
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include <sys/socket.h>
 #include <sys/un.h>
 #include "9p.h"
diff --git a/hw/9pfs/9p-synth.c b/hw/9pfs/9p-synth.c
index 365623e..8bb8fe4 100644
--- a/hw/9pfs/9p-synth.c
+++ b/hw/9pfs/9p-synth.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/virtio/virtio.h"
 #include "9p.h"
 #include "9p-xattr.h"
diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 7c5989b..077adf6 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -7,6 +7,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "elf.h"
 #include "hw/loader.h"
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 5975fbf..246cfb0 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/arm/arm.h"
diff --git a/hw/arm/digic_boards.c b/hw/arm/digic_boards.c
index c4bec42..f2edba4 100644
--- a/hw/arm/digic_boards.c
+++ b/hw/arm/digic_boards.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/boards.h"
 #include "exec/address-spaces.h"
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index a482396..4e86f15 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/arm/arm.h"
diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c
index 387a776..94510bf 100644
--- a/hw/arm/omap1.c
+++ b/hw/arm/omap1.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/boards.h"
 #include "hw/hw.h"
diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index 2410909..3f7d3cb 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/arm/pxa.h"
diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c
index 3b17a21..718d1f6 100644
--- a/hw/arm/strongarm.c
+++ b/hw/arm/strongarm.c
@@ -28,6 +28,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/boards.h"
 #include "hw/sysbus.h"
 #include "strongarm.h"
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 83fc0e9..e0d53b5 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -22,6 +22,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/arm/arm.h"
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index a0937bb..8be25f3 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -29,6 +29,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "hw/arm/arm.h"
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 173988e..e14ab5a 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -21,6 +21,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include <hw/block/block.h>
 #include <hw/hw.h>
 #include <hw/pci/msix.h>
diff --git a/hw/core/fw-path-provider.c b/hw/core/fw-path-provider.c
index 33b9983..4840fae 100644
--- a/hw/core/fw-path-provider.c
+++ b/hw/core/fw-path-provider.c
@@ -17,6 +17,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/fw-path-provider.h"
+#include "qemu/module.h"
 
 char *fw_path_provider_get_dev_path(FWPathProvider *p, BusState *bus,
                                     DeviceState *dev)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 93410e3..87e760e 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -43,6 +43,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "disas/disas.h"
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 136bf27..c209736 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/boards.h"
 #include "qapi/error.h"
 #include "qapi-visit.h"
diff --git a/hw/core/nmi.c b/hw/core/nmi.c
index e8bcc41..77ea204 100644
--- a/hw/core/nmi.c
+++ b/hw/core/nmi.c
@@ -23,6 +23,7 @@
 #include "hw/nmi.h"
 #include "qapi/error.h"
 #include "qapi/qmp/qerror.h"
+#include "qemu/module.h"
 #include "monitor/monitor.h"
 
 struct do_nmi_s {
diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c
index 153c835..9db6c60 100644
--- a/hw/core/ptimer.c
+++ b/hw/core/ptimer.c
@@ -5,7 +5,9 @@
  *
  * This code is licensed under the GNU LGPL.
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "qemu/timer.h"
 #include "hw/ptimer.h"
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index a8c77ec..baac1e2 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -1,4 +1,5 @@
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "net/net.h"
 #include "hw/qdev.h"
 #include "qapi/error.h"
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index db41aa1..3d3eb84 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -26,6 +26,7 @@
    this API directly.  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/qdev.h"
 #include "hw/fw-path-provider.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/core/stream.c b/hw/core/stream.c
index 4439ecd..39b1e59 100644
--- a/hw/core/stream.c
+++ b/hw/core/stream.c
@@ -1,5 +1,6 @@
 #include "qemu/osdep.h"
 #include "hw/stream.h"
+#include "qemu/module.h"
 
 size_t
 stream_push(StreamSlave *sink, uint8_t *buf, size_t len)
diff --git a/hw/display/qxl.h b/hw/display/qxl.h
index 2ddf065..f97845c 100644
--- a/hw/display/qxl.h
+++ b/hw/display/qxl.h
@@ -1,8 +1,6 @@
 #ifndef HW_QXL_H
 #define HW_QXL_H 1
 
-#include "qemu-common.h"
-
 #include "ui/console.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c
index ea89ecb..2d6b497 100644
--- a/hw/dma/pl330.c
+++ b/hw/dma/pl330.c
@@ -15,6 +15,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/sysbus.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 56ec6cd..d8e56c0 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -21,7 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "hw/char/serial.h"
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
index f915ad0..33d9673 100644
--- a/hw/i386/pc_sysfw.c
+++ b/hw/i386/pc_sysfw.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "sysemu/block-backend.h"
 #include "qemu/error-report.h"
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 241e840..18e9191 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include <hw/hw.h>
 #include <hw/i386/pc.h>
 #include <hw/pci/pci.h>
diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c
index c5a848b..a4ca40d 100644
--- a/hw/lm32/lm32_boards.c
+++ b/hw/lm32/lm32_boards.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "hw/block/flash.h"
diff --git a/hw/lm32/lm32_hwsetup.h b/hw/lm32/lm32_hwsetup.h
index 838754d..b730bd1 100644
--- a/hw/lm32/lm32_hwsetup.h
+++ b/hw/lm32/lm32_hwsetup.h
@@ -25,7 +25,6 @@
 #ifndef QEMU_HW_LM32_HWSETUP_H
 #define QEMU_HW_LM32_HWSETUP_H
 
-#include "qemu-common.h"
 #include "hw/loader.h"
 
 typedef struct {
diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c
index f71492e..efd0200 100644
--- a/hw/lm32/milkymist.c
+++ b/hw/lm32/milkymist.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "hw/block/flash.h"
diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c
index bdb716e..fbff7e7 100644
--- a/hw/mips/mips_fulong2e.c
+++ b/hw/mips/mips_fulong2e.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index d6d8058..fd5a981 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/mips/mips.h"
 #include "hw/mips/cpudevs.h"
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index f5173c4..1454ad4 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
 #include "hw/char/serial.h"
diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
index 23b2dca..2f8b660 100644
--- a/hw/mips/mips_mipssim.c
+++ b/hw/mips/mips_mipssim.c
@@ -24,7 +24,9 @@
  * 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 "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/mips/mips.h"
diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index 0ef2fb1..fd6ba10 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -7,7 +7,9 @@
  * All peripherial devices are attached to this "bus" with
  * the standard PC ISA addresses.
 */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/mips/mips.h"
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 55071dc..967a9f2 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -16,7 +16,9 @@
  * 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 "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c
index 481abdb..0eb5bc4 100644
--- a/hw/misc/macio/cuda.c
+++ b/hw/misc/macio/cuda.c
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/ppc/mac.h"
 #include "hw/input/adb.h"
diff --git a/hw/net/allwinner_emac.c b/hw/net/allwinner_emac.c
index 16d4b63..8059509 100644
--- a/hw/net/allwinner_emac.c
+++ b/hw/net/allwinner_emac.c
@@ -17,6 +17,7 @@
  *
  */
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/sysbus.h"
 #include "net/net.h"
 #include "qemu/fifo8.h"
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 7866248..47d6c42 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/dma.h"
diff --git a/hw/nvram/mac_nvram.c b/hw/nvram/mac_nvram.c
index 1671f46..5e6cbf2 100644
--- a/hw/nvram/mac_nvram.c
+++ b/hw/nvram/mac_nvram.c
@@ -22,7 +22,9 @@
  * 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 "hw/hw.h"
 #include "hw/nvram/openbios_firmware_abi.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/pci-bridge/dec.h b/hw/pci-bridge/dec.h
index 17dc0c2..8a16f47 100644
--- a/hw/pci-bridge/dec.h
+++ b/hw/pci-bridge/dec.h
@@ -1,8 +1,6 @@
 #ifndef DEC_PCI_H
 #define DEC_PCI_H
 
-#include "qemu-common.h"
-
 #define TYPE_DEC_21154 "dec-21154-sysbus"
 
 PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn);
diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c
index 487e32e..3a08009 100644
--- a/hw/pci-host/prep.c
+++ b/hw/pci-host/prep.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
diff --git a/hw/pci/msix.c b/hw/pci/msix.c
index 537fdba..6f05ced 100644
--- a/hw/pci/msix.c
+++ b/hw/pci/msix.c
@@ -15,6 +15,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index e67664d..c7a0591 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -21,7 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bridge.h"
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 1086f88..97966f0 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -46,7 +46,9 @@
  * 0001:05:0c.0 IDE interface [0101]: Broadcom K2 SATA [1166:0240]
  *
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/ppc/ppc.h"
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 9bfa02e..850b4e2 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -23,7 +23,9 @@
  * 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 "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/ppc/ppc.h"
diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 1d51587..bbd0c99 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -21,7 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/ppc/ppc.h"
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index b94b44a..7af1062 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/ppc/spapr_drc.h"
 #include "qom/object.h"
diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c
index 61204f0..bb29553 100644
--- a/hw/ppc/spapr_events.c
+++ b/hw/ppc/spapr_events.c
@@ -24,7 +24,9 @@
  * THE SOFTWARE.
  *
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "cpu.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index b7c5ebd..16aa618 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -24,7 +24,9 @@
  * THE SOFTWARE.
  *
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "cpu.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/char.h"
diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c
index 02fa373..57f80e6 100644
--- a/hw/ppc/spapr_rtc.c
+++ b/hw/ppc/spapr_rtc.c
@@ -25,7 +25,9 @@
  * THE SOFTWARE.
  *
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "cpu.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index b807a08..bed71c2 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/sysbus.h"
 #include "hw/hw.h"
 #include "hw/char/serial.h"
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index f104200..cae2e6b 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "sysemu/sysemu.h"
 #include "cpu.h"
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index a63a581..addd980 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
 #include "sysemu/dma.h"
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index a5ad3c7..6723da5 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -1,4 +1,5 @@
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 97a0dd1..9238cc4 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -17,6 +17,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include <sys/ioctl.h>
+#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/queue.h"
 #include "monitor/monitor.h"
diff --git a/hw/sd/core.c b/hw/sd/core.c
index 14c2bdf..3c31ad3 100644
--- a/hw/sd/core.c
+++ b/hw/sd/core.c
@@ -21,6 +21,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/qdev-core.h"
+#include "qemu/module.h"
 #include "sysemu/block-backend.h"
 #include "hw/sd/sd.h"
 
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index b688b94..13f000b 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -16,6 +16,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index 9f085ec..a4d6bbf 100644
--- a/hw/sparc/leon3.c
+++ b/hw/sparc/leon3.c
@@ -21,7 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "qemu/timer.h"
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 28182c3..8646fc5 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -21,7 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/sysbus.h"
 #include "qemu/error-report.h"
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 2e03a28..abf9493 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -21,7 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/hw.h"
 #include "hw/pci/pci.h"
diff --git a/hw/timer/ds1338.c b/hw/timer/ds1338.c
index ff31561..385b7d3 100644
--- a/hw/timer/ds1338.c
+++ b/hw/timer/ds1338.c
@@ -11,6 +11,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/i2c/i2c.h"
 
 /* Size of NVRAM including both the user-accessible area and the
diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c
index c4db0e6..c037618 100644
--- a/hw/timer/m48t59.c
+++ b/hw/timer/m48t59.c
@@ -23,6 +23,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/timer/m48t59.h"
 #include "qapi/error.h"
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index eb0100a..6083b4d 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -21,7 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/timer/pl031.c b/hw/timer/pl031.c
index 3ccb2cb..ea355ee 100644
--- a/hw/timer/pl031.c
+++ b/hw/timer/pl031.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/timer/twl92230.c b/hw/timer/twl92230.c
index 1c92438..7443b74 100644
--- a/hw/timer/twl92230.c
+++ b/hw/timer/twl92230.c
@@ -20,6 +20,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "qemu/timer.h"
 #include "hw/i2c/i2c.h"
diff --git a/hw/tpm/tpm_tis.h b/hw/tpm/tpm_tis.h
index a1df41f..eadde52 100644
--- a/hw/tpm/tpm_tis.h
+++ b/hw/tpm/tpm_tis.h
@@ -19,7 +19,6 @@
 
 #include "hw/isa/isa.h"
 #include "hw/acpi/tpm.h"
-#include "qemu-common.h"
 
 #define TPM_TIS_NUM_LOCALITIES      5     /* per spec */
 #define TPM_TIS_LOCALITY_SHIFT      12
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index a9a6f9e..b09196f 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -1,4 +1,5 @@
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/usb.h"
 #include "hw/qdev.h"
diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c
index c0e90e5..a50b310 100644
--- a/hw/usb/ccid-card-passthru.c
+++ b/hw/usb/ccid-card-passthru.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "sysemu/char.h"
 #include "qemu/error-report.h"
 #include "qemu/sockets.h"
diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
index 3976f68..5529ae9 100644
--- a/hw/vfio/pci.h
+++ b/hw/vfio/pci.h
@@ -12,7 +12,6 @@
 #ifndef HW_VFIO_VFIO_PCI_H
 #define HW_VFIO_VFIO_PCI_H
 
-#include "qemu-common.h"
 #include "exec/memory.h"
 #include "hw/pci/pci.h"
 #include "hw/vfio/vfio-common.h"
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 5914e85..26c88a6 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "hw/virtio/vhost.h"
 #include "hw/virtio/vhost-backend.h"
diff --git a/hw/xen/xen_pt.h b/hw/xen/xen_pt.h
index c2f8e1f..af200de 100644
--- a/hw/xen/xen_pt.h
+++ b/hw/xen/xen_pt.h
@@ -1,7 +1,6 @@
 #ifndef XEN_PT_H
 #define XEN_PT_H
 
-#include "qemu-common.h"
 #include "hw/xen/xen_common.h"
 #include "hw/pci/pci.h"
 #include "xen-host-pci-device.h"
diff --git a/include/block/aio.h b/include/block/aio.h
index 88a64ee..fb5dc56 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -14,7 +14,6 @@
 #ifndef QEMU_AIO_H
 #define QEMU_AIO_H
 
-#include "qemu-common.h"
 #include "qemu/queue.h"
 #include "qemu/event_notifier.h"
 #include "qemu/thread.h"
diff --git a/include/block/nbd.h b/include/block/nbd.h
index b86a976..6f9d77e 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -19,8 +19,6 @@
 #ifndef NBD_H
 #define NBD_H
 
-
-#include "qemu-common.h"
 #include "qemu/option.h"
 #include "io/channel-socket.h"
 #include "crypto/tlscreds.h"
diff --git a/include/block/qapi.h b/include/block/qapi.h
index 327549d..b14bde4 100644
--- a/include/block/qapi.h
+++ b/include/block/qapi.h
@@ -26,6 +26,7 @@
 #define BLOCK_QAPI_H
 
 #include "qapi-types.h"
+#include "qemu/fprintf-fn.h"
 #include "block/block.h"
 #include "block/snapshot.h"
 
diff --git a/include/block/snapshot.h b/include/block/snapshot.h
index e5c0553..84ab79c 100644
--- a/include/block/snapshot.h
+++ b/include/block/snapshot.h
@@ -25,7 +25,6 @@
 #ifndef SNAPSHOT_H
 #define SNAPSHOT_H
 
-#include "qemu-common.h"
 #include "qemu/option.h"
 
 
diff --git a/include/block/write-threshold.h b/include/block/write-threshold.h
index 234d219..df7290b 100644
--- a/include/block/write-threshold.h
+++ b/include/block/write-threshold.h
@@ -12,8 +12,6 @@
 #ifndef BLOCK_WRITE_THRESHOLD_H
 #define BLOCK_WRITE_THRESHOLD_H
 
-#include "qemu-common.h"
-
 /*
  * bdrv_write_threshold_set:
  *
diff --git a/include/disas/bfd.h b/include/disas/bfd.h
index a112e9c..a87b8a1 100644
--- a/include/disas/bfd.h
+++ b/include/disas/bfd.h
@@ -9,7 +9,7 @@
 #ifndef DIS_ASM_H
 #define DIS_ASM_H
 
-#include "qemu-common.h"
+#include "qemu/fprintf-fn.h"
 
 typedef void *PTR;
 typedef uint64_t bfd_vma;
diff --git a/include/disas/disas.h b/include/disas/disas.h
index 2b9293b..6371b01 100644
--- a/include/disas/disas.h
+++ b/include/disas/disas.h
@@ -1,8 +1,6 @@
 #ifndef _QEMU_DISAS_H
 #define _QEMU_DISAS_H
 
-#include "qemu-common.h"
-
 #ifdef NEED_CPU_H
 /* Disassemble this for me please... (debugging). */
 void disas(FILE *out, void *code, unsigned long size);
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 08e5093..c074840 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -19,7 +19,6 @@
 #ifndef CPU_ALL_H
 #define CPU_ALL_H
 
-#include "qemu-common.h"
 #include "exec/cpu-common.h"
 #include "exec/memory.h"
 #include "qemu/thread.h"
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 05a151d..92d2bbb 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -20,8 +20,6 @@
 #ifndef _EXEC_ALL_H_
 #define _EXEC_ALL_H_
 
-#include "qemu-common.h"
-
 /* allow to see translation results - the slowdown should be negligible, so we leave it */
 #define DEBUG_DISAS
 
diff --git a/include/exec/ioport.h b/include/exec/ioport.h
index 3bd6722..3009c45 100644
--- a/include/exec/ioport.h
+++ b/include/exec/ioport.h
@@ -24,7 +24,6 @@
 #ifndef IOPORT_H
 #define IOPORT_H
 
-#include "qemu-common.h"
 #include "qom/object.h"
 #include "exec/memory.h"
 
diff --git a/include/hw/acpi/tco.h b/include/hw/acpi/tco.h
index 52ad767..d19dd59 100644
--- a/include/hw/acpi/tco.h
+++ b/include/hw/acpi/tco.h
@@ -9,7 +9,6 @@
 #ifndef HW_ACPI_TCO_H
 #define HW_ACPI_TCO_H
 
-#include "qemu-common.h"
 
 /* As per ICH9 spec, the internal timer has an error of ~0.6s on every tick */
 #define TCO_TICK_NSEC 600000000LL
diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h
index 6b32a99..42d581b 100644
--- a/include/hw/arm/allwinner-a10.h
+++ b/include/hw/arm/allwinner-a10.h
@@ -1,6 +1,5 @@
 #ifndef ALLWINNER_H_
 
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "hw/char/serial.h"
 #include "hw/arm/arm.h"
diff --git a/include/hw/arm/bcm2835_peripherals.h b/include/hw/arm/bcm2835_peripherals.h
index 5d888dc..28b6938 100644
--- a/include/hw/arm/bcm2835_peripherals.h
+++ b/include/hw/arm/bcm2835_peripherals.h
@@ -11,7 +11,6 @@
 #ifndef BCM2835_PERIPHERALS_H
 #define BCM2835_PERIPHERALS_H
 
-#include "qemu-common.h"
 #include "exec/address-spaces.h"
 #include "hw/sysbus.h"
 #include "hw/intc/bcm2835_ic.h"
diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h
index 5c1820f..754c306 100644
--- a/include/hw/arm/exynos4210.h
+++ b/include/hw/arm/exynos4210.h
@@ -26,7 +26,6 @@
 #ifndef EXYNOS4210_H_
 #define EXYNOS4210_H_
 
-#include "qemu-common.h"
 #include "exec/memory.h"
 
 #define EXYNOS4210_NCPUS                    2
diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h
index 0ad5fb8..a40f7d4 100644
--- a/include/hw/arm/omap.h
+++ b/include/hw/arm/omap.h
@@ -20,6 +20,7 @@
 #include "exec/memory.h"
 # define hw_omap_h		"omap.h"
 #include "hw/irq.h"
+#include "cpu.h"
 
 # define OMAP_EMIFS_BASE	0x00000000
 # define OMAP2_Q0_BASE		0x00000000
diff --git a/include/hw/arm/sysbus-fdt.h b/include/hw/arm/sysbus-fdt.h
index e15bb81..ba0fcc7 100644
--- a/include/hw/arm/sysbus-fdt.h
+++ b/include/hw/arm/sysbus-fdt.h
@@ -25,7 +25,6 @@
 #define HW_ARM_SYSBUS_FDT_H
 
 #include "hw/arm/arm.h"
-#include "qemu-common.h"
 #include "hw/sysbus.h"
 
 /*
diff --git a/include/hw/arm/virt-acpi-build.h b/include/hw/arm/virt-acpi-build.h
index 7d3700e..d57566d 100644
--- a/include/hw/arm/virt-acpi-build.h
+++ b/include/hw/arm/virt-acpi-build.h
@@ -20,7 +20,6 @@
 #ifndef QEMU_VIRT_ACPI_BUILD_H
 #define QEMU_VIRT_ACPI_BUILD_H
 
-#include "qemu-common.h"
 #include "hw/arm/virt.h"
 
 #define ACPI_GICC_ENABLED 1
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
index ecd8589..dde33f5 100644
--- a/include/hw/arm/virt.h
+++ b/include/hw/arm/virt.h
@@ -30,7 +30,7 @@
 #ifndef QEMU_ARM_VIRT_H
 #define QEMU_ARM_VIRT_H
 
-#include "qemu-common.h"
+#include "exec/hwaddr.h"
 
 #define NUM_GICV2M_SPIS       64
 #define NUM_VIRTIO_TRANSPORTS 32
diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h
index 2332596..2b02283 100644
--- a/include/hw/arm/xlnx-zynqmp.h
+++ b/include/hw/arm/xlnx-zynqmp.h
@@ -17,7 +17,6 @@
 
 #ifndef XLNX_ZYNQMP_H
 
-#include "qemu-common.h"
 #include "hw/arm/arm.h"
 #include "hw/intc/arm_gic.h"
 #include "hw/net/cadence_gem.h"
diff --git a/include/hw/block/block.h b/include/hw/block/block.h
index 984660e..a11f3e0 100644
--- a/include/hw/block/block.h
+++ b/include/hw/block/block.h
@@ -11,7 +11,6 @@
 #ifndef HW_BLOCK_COMMON_H
 #define HW_BLOCK_COMMON_H
 
-#include "qemu-common.h"
 
 /* Configuration */
 
diff --git a/include/hw/fw-path-provider.h b/include/hw/fw-path-provider.h
index 7afaec0..43727ec 100644
--- a/include/hw/fw-path-provider.h
+++ b/include/hw/fw-path-provider.h
@@ -18,7 +18,6 @@
 #ifndef FW_PATH_PROVIDER_H
 #define FW_PATH_PROVIDER_H 1
 
-#include "qemu-common.h"
 #include "qom/object.h"
 
 #define TYPE_FW_PATH_PROVIDER "fw-path-provider"
diff --git a/include/hw/hw.h b/include/hw/hw.h
index 2cb69d5..151d65e 100644
--- a/include/hw/hw.h
+++ b/include/hw/hw.h
@@ -15,6 +15,7 @@
 #include "qemu/module.h"
 
 #ifdef NEED_CPU_H
+#include "cpu.h"
 #if TARGET_LONG_BITS == 64
 #define qemu_put_betl qemu_put_be64
 #define qemu_get_betl qemu_get_be64
diff --git a/include/hw/i386/apic.h b/include/hw/i386/apic.h
index 51eb6d3..9efec6f 100644
--- a/include/hw/i386/apic.h
+++ b/include/hw/i386/apic.h
@@ -1,7 +1,7 @@
 #ifndef APIC_H
 #define APIC_H
 
-#include "qemu-common.h"
+#include "cpu.h"
 
 /* apic.c */
 void apic_deliver_irq(uint8_t dest, uint8_t dest_mode, uint8_t delivery_mode,
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 4f6ce10..8f2acfd 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -1,7 +1,6 @@
 #ifndef HW_PC_H
 #define HW_PC_H
 
-#include "qemu-common.h"
 #include "exec/memory.h"
 #include "hw/boards.h"
 #include "hw/isa/isa.h"
diff --git a/include/hw/ipmi/ipmi.h b/include/hw/ipmi/ipmi.h
index 74a2b5a..b5f01be 100644
--- a/include/hw/ipmi/ipmi.h
+++ b/include/hw/ipmi/ipmi.h
@@ -26,7 +26,6 @@
 #define HW_IPMI_H
 
 #include "exec/memory.h"
-#include "qemu-common.h"
 #include "hw/qdev.h"
 
 #define MAX_IPMI_MSG_SIZE 300
diff --git a/include/hw/isa/apm.h b/include/hw/isa/apm.h
index 4839ff1..d65faea 100644
--- a/include/hw/isa/apm.h
+++ b/include/hw/isa/apm.h
@@ -1,7 +1,6 @@
 #ifndef APM_H
 #define APM_H
 
-#include "qemu-common.h"
 #include "hw/hw.h"
 #include "exec/memory.h"
 
diff --git a/include/hw/lm32/lm32_pic.h b/include/hw/lm32/lm32_pic.h
index 189fa38..9aa3fc4 100644
--- a/include/hw/lm32/lm32_pic.h
+++ b/include/hw/lm32/lm32_pic.h
@@ -1,7 +1,6 @@
 #ifndef QEMU_HW_LM32_PIC_H
 #define QEMU_HW_LM32_PIC_H
 
-#include "qemu-common.h"
 
 uint32_t lm32_pic_get_ip(DeviceState *d);
 uint32_t lm32_pic_get_im(DeviceState *d);
diff --git a/include/hw/nmi.h b/include/hw/nmi.h
index f4cec62..ff6a7a6 100644
--- a/include/hw/nmi.h
+++ b/include/hw/nmi.h
@@ -22,7 +22,6 @@
 #ifndef NMI_H
 #define NMI_H 1
 
-#include "qemu-common.h"
 #include "qom/object.h"
 
 #define TYPE_NMI "nmi"
diff --git a/include/hw/pci-host/apb.h b/include/hw/pci-host/apb.h
index 736db61..5f04048 100644
--- a/include/hw/pci-host/apb.h
+++ b/include/hw/pci-host/apb.h
@@ -1,7 +1,6 @@
 #ifndef APB_PCI_H
 #define APB_PCI_H
 
-#include "qemu-common.h"
 
 PCIBus *pci_apb_init(hwaddr special_base,
                      hwaddr mem_base,
diff --git a/include/hw/pci-host/pam.h b/include/hw/pci-host/pam.h
index 6116c63..fec5cd3 100644
--- a/include/hw/pci-host/pam.h
+++ b/include/hw/pci-host/pam.h
@@ -50,7 +50,6 @@
  * 0xf0000 - 0xfffff System BIOS Area Memory Segments
  */
 
-#include "qemu-common.h"
 #include "exec/memory.h"
 
 #define SMRAM_C_BASE    0xa0000
diff --git a/include/hw/pci/msi.h b/include/hw/pci/msi.h
index 50e452b..f52cbbd 100644
--- a/include/hw/pci/msi.h
+++ b/include/hw/pci/msi.h
@@ -21,7 +21,6 @@
 #ifndef QEMU_MSI_H
 #define QEMU_MSI_H
 
-#include "qemu-common.h"
 #include "hw/pci/pci.h"
 
 struct MSIMessage {
diff --git a/include/hw/pci/msix.h b/include/hw/pci/msix.h
index 72e5f93..14fb80d 100644
--- a/include/hw/pci/msix.h
+++ b/include/hw/pci/msix.h
@@ -1,7 +1,6 @@
 #ifndef QEMU_MSIX_H
 #define QEMU_MSIX_H
 
-#include "qemu-common.h"
 #include "hw/pci/pci.h"
 
 void msix_set_message(PCIDevice *dev, int vector, MSIMessage msg);
diff --git a/include/hw/pci/shpc.h b/include/hw/pci/shpc.h
index b208554..52522c6 100644
--- a/include/hw/pci/shpc.h
+++ b/include/hw/pci/shpc.h
@@ -1,7 +1,6 @@
 #ifndef SHPC_H
 #define SHPC_H
 
-#include "qemu-common.h"
 #include "exec/memory.h"
 #include "migration/vmstate.h"
 #include "hw/hotplug.h"
diff --git a/include/hw/pci/slotid_cap.h b/include/hw/pci/slotid_cap.h
index 70db047..98edc53 100644
--- a/include/hw/pci/slotid_cap.h
+++ b/include/hw/pci/slotid_cap.h
@@ -1,7 +1,6 @@
 #ifndef PCI_SLOTID_CAP_H
 #define PCI_SLOTID_CAP_H
 
-#include "qemu-common.h"
 
 int slotid_cap_init(PCIDevice *dev, int nslots,
                     uint8_t chassis,
diff --git a/include/hw/ppc/openpic.h b/include/hw/ppc/openpic.h
index ee67098..02c2fb1 100644
--- a/include/hw/ppc/openpic.h
+++ b/include/hw/ppc/openpic.h
@@ -1,7 +1,6 @@
 #if !defined(__OPENPIC_H__)
 #define __OPENPIC_H__
 
-#include "qemu-common.h"
 #include "hw/qdev.h"
 
 #define TYPE_OPENPIC "openpic"
diff --git a/include/hw/ptimer.h b/include/hw/ptimer.h
index 8ebacbb..a3d090f 100644
--- a/include/hw/ptimer.h
+++ b/include/hw/ptimer.h
@@ -8,7 +8,6 @@
 #ifndef PTIMER_H
 #define PTIMER_H
 
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "migration/vmstate.h"
 
diff --git a/include/hw/sd/sdhci.h b/include/hw/sd/sdhci.h
index 0f0c3f1..b739552 100644
--- a/include/hw/sd/sdhci.h
+++ b/include/hw/sd/sdhci.h
@@ -25,7 +25,6 @@
 #ifndef SDHCI_H
 #define SDHCI_H
 
-#include "qemu-common.h"
 #include "hw/block/block.h"
 #include "hw/pci/pci.h"
 #include "hw/sysbus.h"
diff --git a/include/hw/sh4/sh_intc.h b/include/hw/sh4/sh_intc.h
index b7ddcb0..cf24236 100644
--- a/include/hw/sh4/sh_intc.h
+++ b/include/hw/sh4/sh_intc.h
@@ -1,7 +1,6 @@
 #ifndef __SH_INTC_H__
 #define __SH_INTC_H__
 
-#include "qemu-common.h"
 #include "hw/irq.h"
 #include "exec/address-spaces.h"
 
diff --git a/include/hw/sparc/sun4m.h b/include/hw/sparc/sun4m.h
index 9c17425..5e724d3 100644
--- a/include/hw/sparc/sun4m.h
+++ b/include/hw/sparc/sun4m.h
@@ -1,7 +1,6 @@
 #ifndef SUN4M_H
 #define SUN4M_H
 
-#include "qemu-common.h"
 #include "exec/hwaddr.h"
 #include "qapi/qmp/types.h"
 
diff --git a/include/hw/stream.h b/include/hw/stream.h
index 30ccc56..ec7bc35 100644
--- a/include/hw/stream.h
+++ b/include/hw/stream.h
@@ -1,7 +1,6 @@
 #ifndef STREAM_H
 #define STREAM_H 1
 
-#include "qemu-common.h"
 #include "qom/object.h"
 
 /* stream slave. Used until qdev provides a generic way.  */
diff --git a/include/hw/timer/m48t59.h b/include/hw/timer/m48t59.h
index 3367923..700a097 100644
--- a/include/hw/timer/m48t59.h
+++ b/include/hw/timer/m48t59.h
@@ -1,7 +1,6 @@
 #ifndef NVRAM_H
 #define NVRAM_H
 
-#include "qemu-common.h"
 #include "qom/object.h"
 
 #define TYPE_NVRAM "nvram"
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index eb0e1b0..7d193b9 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -20,7 +20,6 @@
 #ifndef HW_VFIO_VFIO_COMMON_H
 #define HW_VFIO_VFIO_COMMON_H
 
-#include "qemu-common.h"
 #include "exec/address-spaces.h"
 #include "exec/memory.h"
 #include "qemu/queue.h"
diff --git a/include/hw/virtio/vhost-scsi.h b/include/hw/virtio/vhost-scsi.h
index 9fd63df..8aa0f8b 100644
--- a/include/hw/virtio/vhost-scsi.h
+++ b/include/hw/virtio/vhost-scsi.h
@@ -14,7 +14,6 @@
 #ifndef VHOST_SCSI_H
 #define VHOST_SCSI_H
 
-#include "qemu-common.h"
 #include "hw/qdev.h"
 #include "hw/virtio/virtio-scsi.h"
 #include "hw/virtio/vhost.h"
diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h
index 6eb815a..5279211 100644
--- a/include/hw/xen/xen.h
+++ b/include/hw/xen/xen.h
@@ -8,7 +8,6 @@
  */
 
 #include "hw/irq.h"
-#include "qemu-common.h"
 
 /* xen-machine.c */
 enum xen_mode {
diff --git a/include/io/channel.h b/include/io/channel.h
index d37acd2..1294152 100644
--- a/include/io/channel.h
+++ b/include/io/channel.h
@@ -21,7 +21,6 @@
 #ifndef QIO_CHANNEL_H__
 #define QIO_CHANNEL_H__
 
-#include "qemu-common.h"
 #include "qom/object.h"
 
 #define TYPE_QIO_CHANNEL "qio-channel"
diff --git a/include/io/task.h b/include/io/task.h
index 2e69d8a..bf42b23 100644
--- a/include/io/task.h
+++ b/include/io/task.h
@@ -21,7 +21,6 @@
 #ifndef QIO_TASK_H__
 #define QIO_TASK_H__
 
-#include "qemu-common.h"
 #include "qom/object.h"
 
 typedef struct QIOTask QIOTask;
diff --git a/include/migration/migration.h b/include/migration/migration.h
index ac2c12c..69b5409 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -15,7 +15,6 @@
 #define QEMU_MIGRATION_H
 
 #include "qapi/qmp/qdict.h"
-#include "qemu-common.h"
 #include "qemu/thread.h"
 #include "qemu/notify.h"
 #include "migration/vmstate.h"
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index aa0f373..27a4d4f 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -1,7 +1,6 @@
 #ifndef MONITOR_H
 #define MONITOR_H
 
-#include "qemu-common.h"
 #include "qapi/qmp/qdict.h"
 #include "block/block.h"
 #include "qemu/readline.h"
diff --git a/include/net/filter.h b/include/net/filter.h
index 0c4a2ea..6ca4e27 100644
--- a/include/net/filter.h
+++ b/include/net/filter.h
@@ -10,7 +10,6 @@
 #define QEMU_NET_FILTER_H
 
 #include "qom/object.h"
-#include "qemu-common.h"
 #include "net/queue.h"
 
 #define TYPE_NETFILTER "netfilter"
diff --git a/include/net/net.h b/include/net/net.h
index 73e4c46..c6f8d8e 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -2,7 +2,6 @@
 #define QEMU_NET_H
 
 #include "qemu/queue.h"
-#include "qemu-common.h"
 #include "qapi/qmp/qdict.h"
 #include "qemu/option.h"
 #include "net/queue.h"
diff --git a/include/net/queue.h b/include/net/queue.h
index 5469fdb..ea5386c 100644
--- a/include/net/queue.h
+++ b/include/net/queue.h
@@ -24,8 +24,6 @@
 #ifndef QEMU_NET_QUEUE_H
 #define QEMU_NET_QUEUE_H
 
-#include "qemu-common.h"
-
 typedef struct NetPacket NetPacket;
 typedef struct NetQueue NetQueue;
 
diff --git a/include/net/slirp.h b/include/net/slirp.h
index 64b795c..69f0d5e 100644
--- a/include/net/slirp.h
+++ b/include/net/slirp.h
@@ -24,7 +24,6 @@
 #ifndef QEMU_NET_SLIRP_H
 #define QEMU_NET_SLIRP_H
 
-#include "qemu-common.h"
 #include "qapi/qmp/qdict.h"
 #include "qemu/option.h"
 #include "qapi-types.h"
diff --git a/include/net/tap.h b/include/net/tap.h
index 5da4edc..af00904 100644
--- a/include/net/tap.h
+++ b/include/net/tap.h
@@ -26,7 +26,6 @@
 #ifndef QEMU_NET_TAP_H
 #define QEMU_NET_TAP_H
 
-#include "qemu-common.h"
 #include "qapi-types.h"
 #include "standard-headers/linux/virtio_net.h"
 
diff --git a/include/qapi/qmp/json-parser.h b/include/qapi/qmp/json-parser.h
index 9987f8c..e7621fe 100644
--- a/include/qapi/qmp/json-parser.h
+++ b/include/qapi/qmp/json-parser.h
@@ -14,7 +14,6 @@
 #ifndef QEMU_JSON_PARSER_H
 #define QEMU_JSON_PARSER_H
 
-#include "qemu-common.h"
 #include "qapi/qmp/qlist.h"
 
 QObject *json_parser_parse(GQueue *tokens, va_list *ap);
diff --git a/include/qemu-io.h b/include/qemu-io.h
index 4d402b9..e5d2140 100644
--- a/include/qemu-io.h
+++ b/include/qemu-io.h
@@ -18,8 +18,6 @@
 #ifndef QEMU_IO_H
 #define QEMU_IO_H
 
-#include "qemu-common.h"
-
 #define CMD_FLAG_GLOBAL ((int)0x80000000) /* don't iterate "args" */
 
 typedef int (*cfunc_t)(BlockBackend *blk, int argc, char **argv);
diff --git a/include/qemu/base64.h b/include/qemu/base64.h
index 793708d..161914d 100644
--- a/include/qemu/base64.h
+++ b/include/qemu/base64.h
@@ -21,9 +21,6 @@
 #ifndef QEMU_BASE64_H__
 #define QEMU_BASE64_H__
 
-#include "qemu-common.h"
-
-
 /**
  * qbase64_decode:
  * @input: the (possibly) base64 encoded text
diff --git a/include/qemu/buffer.h b/include/qemu/buffer.h
index dead9b7..f6f6ce3 100644
--- a/include/qemu/buffer.h
+++ b/include/qemu/buffer.h
@@ -21,8 +21,6 @@
 #ifndef QEMU_BUFFER_H__
 #define QEMU_BUFFER_H__
 
-#include "qemu-common.h"
-
 typedef struct Buffer Buffer;
 
 /**
diff --git a/include/qemu/crc32c.h b/include/qemu/crc32c.h
index dafb6a1..a58ee1e 100644
--- a/include/qemu/crc32c.h
+++ b/include/qemu/crc32c.h
@@ -28,8 +28,6 @@
 #ifndef QEMU_CRC32C_H
 #define QEMU_CRC32C_H
 
-#include "qemu-common.h"
-
 uint32_t crc32c(uint32_t crc, const uint8_t *data, unsigned int length);
 
 #endif
diff --git a/include/qemu/event_notifier.h b/include/qemu/event_notifier.h
index a8f2854..b1b4fd1 100644
--- a/include/qemu/event_notifier.h
+++ b/include/qemu/event_notifier.h
@@ -13,8 +13,6 @@
 #ifndef QEMU_EVENT_NOTIFIER_H
 #define QEMU_EVENT_NOTIFIER_H
 
-#include "qemu-common.h"
-
 #ifdef _WIN32
 #include <windows.h>
 #endif
diff --git a/include/qemu/mmap-alloc.h b/include/qemu/mmap-alloc.h
index 0899b2f..3bc9ce6 100644
--- a/include/qemu/mmap-alloc.h
+++ b/include/qemu/mmap-alloc.h
@@ -1,8 +1,6 @@
 #ifndef QEMU_MMAP_ALLOC
 #define QEMU_MMAP_ALLOC
 
-#include "qemu-common.h"
-
 size_t qemu_fd_getpagesize(int fd);
 
 void *qemu_ram_mmap(int fd, size_t size, size_t align, bool shared);
diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h
index 9109657..d218753 100644
--- a/include/qemu/throttle.h
+++ b/include/qemu/throttle.h
@@ -25,7 +25,6 @@
 #ifndef THROTTLE_H
 #define THROTTLE_H
 
-#include "qemu-common.h"
 #include "qemu/timer.h"
 
 #define THROTTLE_VALUE_MAX 1000000000000000LL
diff --git a/include/qemu/timer.h b/include/qemu/timer.h
index 59a7169..655d69f 100644
--- a/include/qemu/timer.h
+++ b/include/qemu/timer.h
@@ -1,7 +1,6 @@
 #ifndef QEMU_TIMER_H
 #define QEMU_TIMER_H
 
-#include "qemu-common.h"
 #include "qemu/notify.h"
 #include "qemu/host-utils.h"
 
diff --git a/include/sysemu/char.h b/include/sysemu/char.h
index 7aac3b6..09894bd 100644
--- a/include/sysemu/char.h
+++ b/include/sysemu/char.h
@@ -1,7 +1,6 @@
 #ifndef QEMU_CHAR_H
 #define QEMU_CHAR_H
 
-#include "qemu-common.h"
 #include "qemu/queue.h"
 #include "qemu/option.h"
 #include "qemu/config-file.h"
diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h
index 3d1e5ba..a228648 100644
--- a/include/sysemu/cpus.h
+++ b/include/sysemu/cpus.h
@@ -1,6 +1,8 @@
 #ifndef QEMU_CPUS_H
 #define QEMU_CPUS_H
 
+#include "qemu/fprintf-fn.h"
+
 /* cpus.c */
 bool qemu_in_vcpu_thread(void);
 void qemu_init_cpu_loop(void);
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 6695fa7..fa3d52d 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -19,6 +19,10 @@
 #include "exec/memattrs.h"
 #include "hw/irq.h"
 
+#ifdef NEED_CPU_H
+#include "cpu.h"
+#endif
+
 #ifdef CONFIG_KVM
 #include <linux/kvm.h>
 #include <linux/kvm_para.h>
diff --git a/include/sysemu/qtest.h b/include/sysemu/qtest.h
index 70aa40a..eb57518 100644
--- a/include/sysemu/qtest.h
+++ b/include/sysemu/qtest.h
@@ -14,8 +14,6 @@
 #ifndef QTEST_H
 #define QTEST_H
 
-#include "qemu-common.h"
-
 extern bool qtest_allowed;
 
 static inline bool qtest_enabled(void)
diff --git a/include/sysemu/rng.h b/include/sysemu/rng.h
index 45629c4..9b5a1c6 100644
--- a/include/sysemu/rng.h
+++ b/include/sysemu/rng.h
@@ -14,7 +14,6 @@
 #define QEMU_RNG_H
 
 #include "qom/object.h"
-#include "qemu-common.h"
 
 #define TYPE_RNG_BACKEND "rng-backend"
 #define RNG_BACKEND(obj) \
diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h
index e3ec800..0a8baec 100644
--- a/include/sysemu/tpm_backend.h
+++ b/include/sysemu/tpm_backend.h
@@ -14,7 +14,6 @@
 #define _QEMU_TPM_H
 
 #include "qom/object.h"
-#include "qemu-common.h"
 #include "qapi-types.h"
 #include "qemu/option.h"
 #include "sysemu/tpm.h"
diff --git a/io/channel-buffer.c b/io/channel-buffer.c
index 3e5117b..e9f4479 100644
--- a/io/channel-buffer.c
+++ b/io/channel-buffer.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/module.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 ad25313..138877a 100644
--- a/io/channel-command.c
+++ b/io/channel-command.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/module.h"
 #include "io/channel-command.h"
 #include "io/channel-watch.h"
 #include "qapi/error.h"
diff --git a/io/channel-file.c b/io/channel-file.c
index e1da243..38a4b4d 100644
--- a/io/channel-file.c
+++ b/io/channel-file.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/module.h"
 #include "io/channel-file.h"
 #include "io/channel-watch.h"
 #include "qapi/error.h"
diff --git a/io/channel-socket.c b/io/channel-socket.c
index ca8bc20..e880234 100644
--- a/io/channel-socket.c
+++ b/io/channel-socket.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "io/channel-socket.h"
 #include "io/channel-watch.h"
diff --git a/io/channel-tls.c b/io/channel-tls.c
index 9a8525c..857bb6c 100644
--- a/io/channel-tls.c
+++ b/io/channel-tls.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/module.h"
 #include "qapi/error.h"
 #include "io/channel-tls.h"
 #include "trace.h"
diff --git a/io/channel-util.c b/io/channel-util.c
index 0fb4bd0..bb78c98 100644
--- a/io/channel-util.c
+++ b/io/channel-util.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "io/channel-util.h"
 #include "io/channel-file.h"
 #include "io/channel-socket.h"
diff --git a/io/channel-websock.c b/io/channel-websock.c
index 7081787..fe7956e 100644
--- a/io/channel-websock.c
+++ b/io/channel-websock.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "io/channel-websock.h"
 #include "crypto/hash.h"
diff --git a/io/channel.c b/io/channel.c
index 692eb17..0d4b852 100644
--- a/io/channel.c
+++ b/io/channel.c
@@ -22,6 +22,7 @@
 #include "io/channel.h"
 #include "qapi/error.h"
 #include "qemu/coroutine.h"
+#include "qemu/module.h"
 
 bool qio_channel_has_feature(QIOChannel *ioc,
                              QIOChannelFeature feature)
diff --git a/ioport.c b/ioport.c
index 7a84d54..1eb336d 100644
--- a/ioport.c
+++ b/ioport.c
@@ -26,6 +26,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "exec/ioport.h"
 #include "trace.h"
 #include "exec/memory.h"
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 19dc7f5..f336dd4 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1,5 +1,7 @@
 /* This is the Linux kernel elf-loading code, ported into user space */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include <sys/param.h>
 
 #include <sys/mman.h>
diff --git a/linux-user/uaccess.c b/linux-user/uaccess.c
index 75d890d..1ef8647 100644
--- a/linux-user/uaccess.c
+++ b/linux-user/uaccess.c
@@ -1,6 +1,6 @@
 /* User memory access */
 #include "qemu/osdep.h"
-
+#include "qemu-common.h"
 #include "qemu.h"
 
 /* copy_from_user() and copy_to_user() are usually used to copy data
diff --git a/memory.c b/memory.c
index 44bf93e..f576226 100644
--- a/memory.c
+++ b/memory.c
@@ -14,6 +14,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "exec/memory.h"
 #include "exec/address-spaces.h"
diff --git a/migration/qemu-file-internal.h b/migration/qemu-file-internal.h
index d95e853..c7dfff1 100644
--- a/migration/qemu-file-internal.h
+++ b/migration/qemu-file-internal.h
@@ -25,7 +25,6 @@
 #ifndef QEMU_FILE_INTERNAL_H
 #define QEMU_FILE_INTERNAL_H 1
 
-#include "qemu-common.h"
 #include "qemu/iov.h"
 
 #define IO_BUF_SIZE 32768
diff --git a/migration/ram.c b/migration/ram.c
index 704f6a9..d2315e8 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -27,6 +27,7 @@
  */
 #include "qemu/osdep.h"
 #include <zlib.h>
+#include "qemu-common.h"
 #include "qapi-event.h"
 #include "qemu/bitops.h"
 #include "qemu/bitmap.h"
diff --git a/monitor.c b/monitor.c
index e99ca8c..0e13907 100644
--- a/monitor.c
+++ b/monitor.c
@@ -21,7 +21,9 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
+
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include <dirent.h>
 #include "hw/hw.h"
 #include "monitor/qdev.h"
diff --git a/net/hub.h b/net/hub.h
index a625eff..53a6bc5 100644
--- a/net/hub.h
+++ b/net/hub.h
@@ -15,8 +15,6 @@
 #ifndef NET_HUB_H
 #define NET_HUB_H
 
-#include "qemu-common.h"
-
 NetClientState *net_hub_add_port(int hub_id, const char *name);
 NetClientState *net_hub_find_client_by_name(int hub_id, const char *name);
 void net_hub_info(Monitor *mon);
diff --git a/net/slirp.c b/net/slirp.c
index 6b51fbc..68d29f7 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "net/slirp.h"
 
 
diff --git a/net/tap_int.h b/net/tap_int.h
index 2378021..e4ef1f2 100644
--- a/net/tap_int.h
+++ b/net/tap_int.h
@@ -26,7 +26,6 @@
 #ifndef QEMU_TAP_H
 #define QEMU_TAP_H
 
-#include "qemu-common.h"
 #include "qapi-types.h"
 
 int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
diff --git a/os-posix.c b/os-posix.c
index 92fa3ba..3bfab01 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -24,6 +24,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include <sys/wait.h>
 /*needed for MAP_POPULATE before including qemu-options.h */
 #include <sys/mman.h>
diff --git a/qdev-monitor.c b/qdev-monitor.c
index 81e3ff3..84b47d3 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/qdev.h"
 #include "hw/sysbus.h"
 #include "monitor/monitor.h"
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index 13fbb59..cecc5d9 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -9,6 +9,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "qemu-io.h"
 #include "sysemu/block-backend.h"
diff --git a/qemu-io.c b/qemu-io.c
index f5b3058..6ebc352 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -15,6 +15,7 @@
 #include "qemu-io.h"
 #include "qemu/error-report.h"
 #include "qemu/main-loop.h"
+#include "qemu/module.h"
 #include "qemu/option.h"
 #include "qemu/config-file.h"
 #include "qemu/readline.h"
diff --git a/qemu-timer.c b/qemu-timer.c
index e98ecc9..51a23d4 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qemu/main-loop.h"
 #include "qemu/timer.h"
 #include "sysemu/replay.h"
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 9f51fae..f4f491b 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -16,6 +16,7 @@
 #include <sys/ioctl.h>
 #include <sys/wait.h>
 #include <dirent.h>
+#include "qemu-common.h"
 #include "qga/guest-agent-core.h"
 #include "qga-qmp-commands.h"
 #include "qapi/qmp/qerror.h"
diff --git a/qga/commands.c b/qga/commands.c
index e091ee1..0a4cabf 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -12,6 +12,7 @@
 
 #include "qemu/osdep.h"
 #include <glib.h>
+#include "qemu-common.h"
 #include "qga/guest-agent-core.h"
 #include "qga-qmp-commands.h"
 #include "qapi/qmp/qerror.h"
diff --git a/qga/guest-agent-core.h b/qga/guest-agent-core.h
index 0a49516..e8c1fdf 100644
--- a/qga/guest-agent-core.h
+++ b/qga/guest-agent-core.h
@@ -11,7 +11,6 @@
  * See the COPYING file in the top-level directory.
  */
 #include "qapi/qmp/dispatch.h"
-#include "qemu-common.h"
 #include "qga-qmp-commands.h"
 
 #define QGA_READ_COUNT_DEFAULT 4096
diff --git a/qga/main.c b/qga/main.c
index fb2f663..b526482 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -18,6 +18,7 @@
 #include <syslog.h>
 #include <sys/wait.h>
 #endif
+#include "qemu-common.h"
 #include "qapi/qmp/json-streamer.h"
 #include "qapi/qmp/json-parser.h"
 #include "qapi/qmp/qint.h"
diff --git a/qobject/qjson.c b/qobject/qjson.c
index 06dc210..b2601bc 100644
--- a/qobject/qjson.c
+++ b/qobject/qjson.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/qmp/json-lexer.h"
 #include "qapi/qmp/json-parser.h"
 #include "qapi/qmp/json-streamer.h"
diff --git a/qtest.c b/qtest.c
index 87575bc..6f2bd8a 100644
--- a/qtest.c
+++ b/qtest.c
@@ -12,6 +12,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "sysemu/qtest.h"
 #include "hw/qdev.h"
diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py
index 0835406..32f1371 100644
--- a/scripts/tracetool/format/h.py
+++ b/scripts/tracetool/format/h.py
@@ -21,8 +21,6 @@ def generate(events, backend):
         '',
         '#ifndef TRACE__GENERATED_TRACERS_H',
         '#define TRACE__GENERATED_TRACERS_H',
-        '',
-        '#include "qemu-common.h"',
         '')
 
     backend.generate_begin(events)
diff --git a/scripts/tracetool/format/ust_events_h.py b/scripts/tracetool/format/ust_events_h.py
index 3e8a7cd..c171e6c 100644
--- a/scripts/tracetool/format/ust_events_h.py
+++ b/scripts/tracetool/format/ust_events_h.py
@@ -31,7 +31,6 @@ def generate(events, backend):
         '#if !defined (TRACE__GENERATED_UST_H) || defined(TRACEPOINT_HEADER_MULTI_READ)',
         '#define TRACE__GENERATED_UST_H',
         '',
-        '#include "qemu-common.h"',
         '#include <lttng/tracepoint.h>',
         '',
         '/*',
diff --git a/slirp/ip_icmp.c b/slirp/ip_icmp.c
index ace3982..0c6b526 100644
--- a/slirp/ip_icmp.c
+++ b/slirp/ip_icmp.c
@@ -31,6 +31,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "slirp.h"
 #include "ip_icmp.h"
 
diff --git a/slirp/libslirp.h b/slirp/libslirp.h
index 5bdcbd5..0198fd8 100644
--- a/slirp/libslirp.h
+++ b/slirp/libslirp.h
@@ -1,8 +1,6 @@
 #ifndef _LIBSLIRP_H
 #define _LIBSLIRP_H
 
-#include "qemu-common.h"
-
 struct Slirp;
 typedef struct Slirp Slirp;
 
diff --git a/slirp/misc.c b/slirp/misc.c
index e2eea2e..eb380ba 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -8,7 +8,7 @@
 #include "qemu/osdep.h"
 #include <slirp.h>
 #include <libslirp.h>
-
+#include "qemu-common.h"
 #include "monitor/monitor.h"
 #include "qemu/error-report.h"
 #include "qemu/main-loop.h"
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
index b1aa1f2..9438f23 100644
--- a/slirp/tcp_subr.c
+++ b/slirp/tcp_subr.c
@@ -39,6 +39,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include <slirp.h>
 
 /* patchable/settable parameters for tcp */
diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index 21885c5..d7248b2 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -1,4 +1,5 @@
 #include "qemu/osdep.h"
+#include "qemu/module.h"
 #include "trace.h"
 #include "ui/qemu-spice.h"
 #include "sysemu/char.h"
diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h
index 420f2a5..8824c5c 100644
--- a/target-alpha/cpu.h
+++ b/target-alpha/cpu.h
@@ -20,7 +20,6 @@
 #if !defined (__CPU_ALPHA_H__)
 #define __CPU_ALPHA_H__
 
-#include "qemu-common.h"
 
 #define TARGET_LONG_BITS 64
 #define ALIGNED_ONLY
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index 5b86992..d07f6bf 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -18,6 +18,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "cpu.h"
 #include "disas/disas.h"
 #include "qemu/host-utils.h"
diff --git a/target-arm/cpu.h b/target-arm/cpu.h
index 066ff67..8ba6475 100644
--- a/target-arm/cpu.h
+++ b/target-arm/cpu.h
@@ -33,7 +33,6 @@
 
 #define CPUArchState struct CPUARMState
 
-#include "qemu-common.h"
 #include "exec/cpu-defs.h"
 
 #include "fpu/softfloat.h"
diff --git a/target-cris/cpu.h b/target-cris/cpu.h
index 415cf91..6bb7e44 100644
--- a/target-cris/cpu.h
+++ b/target-cris/cpu.h
@@ -20,7 +20,6 @@
 #ifndef CPU_CRIS_H
 #define CPU_CRIS_H
 
-#include "qemu-common.h"
 
 #define TARGET_LONG_BITS 32
 
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 0f38d1e..5cd7d85 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -16,8 +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 "qemu/osdep.h"
-
+#include "qemu-common.h"
 #include "cpu.h"
 #include "sysemu/kvm.h"
 #include "sysemu/cpus.h"
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
index 5148c82..8aa0e8a 100644
--- a/target-i386/cpu.h
+++ b/target-i386/cpu.h
@@ -19,7 +19,6 @@
 #ifndef CPU_I386_H
 #define CPU_I386_H
 
-#include "qemu-common.h"
 #include "standard-headers/asm-x86/hyperv.h"
 
 #ifdef TARGET_X86_64
diff --git a/target-i386/machine.c b/target-i386/machine.c
index ee5b949..962185e 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -1,4 +1,5 @@
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 #include "hw/i386/pc.h"
diff --git a/target-lm32/cpu.h b/target-lm32/cpu.h
index f220fc0..c689608 100644
--- a/target-lm32/cpu.h
+++ b/target-lm32/cpu.h
@@ -24,7 +24,6 @@
 
 #define CPUArchState struct CPULM32State
 
-#include "qemu-common.h"
 #include "exec/cpu-defs.h"
 struct CPULM32State;
 typedef struct CPULM32State CPULM32State;
diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h
index 48b4c87..f9f7f7d 100644
--- a/target-m68k/cpu.h
+++ b/target-m68k/cpu.h
@@ -24,7 +24,6 @@
 
 #define CPUArchState struct CPUM68KState
 
-#include "qemu-common.h"
 #include "exec/cpu-defs.h"
 
 #include "fpu/softfloat.h"
diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
index 2f7335e..b39f4cf 100644
--- a/target-microblaze/cpu.h
+++ b/target-microblaze/cpu.h
@@ -19,7 +19,6 @@
 #ifndef CPU_MICROBLAZE_H
 #define CPU_MICROBLAZE_H
 
-#include "qemu-common.h"
 
 #define TARGET_LONG_BITS 32
 
diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index 1e2b070..7a65845 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -7,7 +7,6 @@
 
 #define CPUArchState struct CPUMIPSState
 
-#include "qemu-common.h"
 #include "mips-defs.h"
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
diff --git a/target-moxie/cpu.h b/target-moxie/cpu.h
index 4ee2077..f8d23d2 100644
--- a/target-moxie/cpu.h
+++ b/target-moxie/cpu.h
@@ -19,7 +19,6 @@
 #ifndef _CPU_MOXIE_H
 #define _CPU_MOXIE_H
 
-#include "qemu-common.h"
 
 #define TARGET_LONG_BITS 32
 
diff --git a/target-openrisc/cpu.h b/target-openrisc/cpu.h
index 4b63f25..9f88ef7 100644
--- a/target-openrisc/cpu.h
+++ b/target-openrisc/cpu.h
@@ -27,7 +27,6 @@
 /* cpu_openrisc_map_address_* in CPUOpenRISCTLBContext need this decl.  */
 struct OpenRISCCPU;
 
-#include "qemu-common.h"
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
 #include "qom/cpu.h"
diff --git a/target-openrisc/exception.h b/target-openrisc/exception.h
index 4b64430..490500e 100644
--- a/target-openrisc/exception.h
+++ b/target-openrisc/exception.h
@@ -21,7 +21,6 @@
 #define QEMU_OPENRISC_EXCP_H
 
 #include "cpu.h"
-#include "qemu-common.h"
 
 void QEMU_NORETURN raise_exception(OpenRISCCPU *cpu, uint32_t excp);
 
diff --git a/target-ppc/cpu-models.c b/target-ppc/cpu-models.c
index ed005d7..b65b504 100644
--- a/target-ppc/cpu-models.c
+++ b/target-ppc/cpu-models.c
@@ -25,6 +25,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "cpu.h"
 #include "cpu-models.h"
 
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index 2b10597..c79d76f 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -19,7 +19,6 @@
 #if !defined (__CPU_PPC_H__)
 #define __CPU_PPC_H__
 
-#include "qemu-common.h"
 
 //#define PPC_EMULATE_32BITS_HYPV
 
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index bd0cffc..2ae5b09 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "disas/bfd.h"
 #include "exec/gdbstub.h"
 #include <sysemu/kvm.h>
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index 6d97c08..f2d36b6 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -22,7 +22,6 @@
 #ifndef CPU_S390X_H
 #define CPU_S390X_H
 
-#include "qemu-common.h"
 
 #define TARGET_LONG_BITS 64
 
diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index 92abe7e..bc9f10d 100644
--- a/target-s390x/helper.c
+++ b/target-s390x/helper.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "cpu.h"
 #include "exec/gdbstub.h"
diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c
index 71cbe34..a5c268b 100644
--- a/target-s390x/misc_helper.c
+++ b/target-s390x/misc_helper.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "cpu.h"
 #include "exec/memory.h"
 #include "qemu/host-utils.h"
diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h
index 3b23e96..44b6b08 100644
--- a/target-sh4/cpu.h
+++ b/target-sh4/cpu.h
@@ -19,7 +19,6 @@
 #ifndef _CPU_SH4_H
 #define _CPU_SH4_H
 
-#include "qemu-common.h"
 
 #define TARGET_LONG_BITS 32
 
diff --git a/target-sparc/cpu.c b/target-sparc/cpu.c
index fe4119e..58218db 100644
--- a/target-sparc/cpu.c
+++ b/target-sparc/cpu.c
@@ -18,9 +18,11 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qapi/error.h"
 #include "cpu.h"
 #include "qemu/error-report.h"
+#include "qemu/module.h"
 
 //#define DEBUG_FEATURES
 
diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h
index dc46122..cb4fd12 100644
--- a/target-sparc/cpu.h
+++ b/target-sparc/cpu.h
@@ -1,7 +1,6 @@
 #ifndef CPU_SPARC_H
 #define CPU_SPARC_H
 
-#include "qemu-common.h"
 #include "qemu/bswap.h"
 
 #define ALIGNED_ONLY
diff --git a/target-tilegx/cpu.h b/target-tilegx/cpu.h
index 022cad1..899aef8 100644
--- a/target-tilegx/cpu.h
+++ b/target-tilegx/cpu.h
@@ -19,7 +19,6 @@
 #ifndef CPU_TILEGX_H
 #define CPU_TILEGX_H
 
-#include "qemu-common.h"
 
 #define TARGET_LONG_BITS 64
 
diff --git a/target-tricore/cpu.h b/target-tricore/cpu.h
index 5fee376..a56db44 100644
--- a/target-tricore/cpu.h
+++ b/target-tricore/cpu.h
@@ -20,7 +20,6 @@
 #define __TRICORE_CPU_H__
 
 #include "tricore-defs.h"
-#include "qemu-common.h"
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
 
diff --git a/target-unicore32/cpu.h b/target-unicore32/cpu.h
index 9c1fbf9..85acdd2 100644
--- a/target-unicore32/cpu.h
+++ b/target-unicore32/cpu.h
@@ -19,7 +19,6 @@
 
 #define CPUArchState                struct CPUUniCore32State
 
-#include "qemu-common.h"
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
 
diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h
index d0bd9da..118db74 100644
--- a/target-xtensa/cpu.h
+++ b/target-xtensa/cpu.h
@@ -33,7 +33,6 @@
 
 #define CPUArchState struct CPUXtensaState
 
-#include "qemu-common.h"
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
 
diff --git a/tcg/tcg.h b/tcg/tcg.h
index b83f763..5a7d43f 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -25,7 +25,7 @@
 #ifndef TCG_H
 #define TCG_H
 
-#include "qemu-common.h"
+#include "cpu.h"
 #include "qemu/bitops.h"
 #include "tcg-target.h"
 
diff --git a/tests/crypto-tls-x509-helpers.h b/tests/crypto-tls-x509-helpers.h
index 356b49c..bad1e53 100644
--- a/tests/crypto-tls-x509-helpers.h
+++ b/tests/crypto-tls-x509-helpers.h
@@ -34,8 +34,6 @@
 #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
 # include <libtasn1.h>
 
-# include "qemu-common.h"
-
 /*
  * This contains parameter about how to generate
  * certificates.
diff --git a/tests/test-crypto-tlscredsx509.c b/tests/test-crypto-tlscredsx509.c
index af2f80e..a8a0ebd 100644
--- a/tests/test-crypto-tlscredsx509.c
+++ b/tests/test-crypto-tlscredsx509.c
@@ -23,6 +23,7 @@
 #include "crypto-tls-x509-helpers.h"
 #include "crypto/tlscredsx509.h"
 #include "qapi/error.h"
+#include "qemu/module.h"
 
 #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
 
diff --git a/tests/test-crypto-tlssession.c b/tests/test-crypto-tlssession.c
index 1a4a066..a5ce55d 100644
--- a/tests/test-crypto-tlssession.c
+++ b/tests/test-crypto-tlssession.c
@@ -25,6 +25,7 @@
 #include "crypto/tlssession.h"
 #include "qom/object_interfaces.h"
 #include "qapi/error.h"
+#include "qemu/module.h"
 #include "qemu/sockets.h"
 #include "qemu/acl.h"
 
diff --git a/tests/test-io-channel-buffer.c b/tests/test-io-channel-buffer.c
index 64722a2..c9cf623 100644
--- a/tests/test-io-channel-buffer.c
+++ b/tests/test-io-channel-buffer.c
@@ -21,7 +21,7 @@
 #include "qemu/osdep.h"
 #include "io/channel-buffer.h"
 #include "io-channel-helpers.h"
-
+#include "qemu/module.h"
 
 static void test_io_channel_buf(void)
 {
diff --git a/tests/test-io-channel-command.c b/tests/test-io-channel-command.c
index 1d1f461..bec9409 100644
--- a/tests/test-io-channel-command.c
+++ b/tests/test-io-channel-command.c
@@ -22,6 +22,7 @@
 #include "io/channel-command.h"
 #include "io-channel-helpers.h"
 #include "qapi/error.h"
+#include "qemu/module.h"
 
 #ifndef WIN32
 static void test_io_channel_command_fifo(bool async)
diff --git a/tests/test-io-channel-file.c b/tests/test-io-channel-file.c
index 6bfede6..a944298 100644
--- a/tests/test-io-channel-file.c
+++ b/tests/test-io-channel-file.c
@@ -23,6 +23,7 @@
 #include "io/channel-util.h"
 #include "io-channel-helpers.h"
 #include "qapi/error.h"
+#include "qemu/module.h"
 
 static void test_io_channel_file(void)
 {
diff --git a/tests/test-io-channel-socket.c b/tests/test-io-channel-socket.c
index d0664fb..1c1d52d 100644
--- a/tests/test-io-channel-socket.c
+++ b/tests/test-io-channel-socket.c
@@ -23,6 +23,7 @@
 #include "io/channel-util.h"
 #include "io-channel-helpers.h"
 #include "qapi/error.h"
+#include "qemu/module.h"
 
 static int check_bind(struct sockaddr *sa, socklen_t salen, bool *has_proto)
 {
diff --git a/tests/test-io-channel-tls.c b/tests/test-io-channel-tls.c
index 3c361a7..749c1b7 100644
--- a/tests/test-io-channel-tls.c
+++ b/tests/test-io-channel-tls.c
@@ -29,6 +29,7 @@
 #include "io-channel-helpers.h"
 #include "crypto/tlscredsx509.h"
 #include "qemu/acl.h"
+#include "qemu/module.h"
 #include "qom/object_interfaces.h"
 
 #ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
diff --git a/tests/test-io-task.c b/tests/test-io-task.c
index 5a97750..beaea24 100644
--- a/tests/test-io-task.c
+++ b/tests/test-io-task.c
@@ -23,6 +23,7 @@
 
 #include "io/task.h"
 #include "qapi/error.h"
+#include "qemu/module.h"
 
 #define TYPE_DUMMY "qemu:dummy"
 
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 6961596..efb0cf6 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -12,6 +12,7 @@
 #include <glib.h>
 
 #include "libqtest.h"
+#include "qemu/module.h"
 #include "qemu/option.h"
 #include "qemu/range.h"
 #include "sysemu/char.h"
diff --git a/trace/control.c b/trace/control.c
index 20d3370..d4ca9a6 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -8,6 +8,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "trace/control.h"
 #ifdef CONFIG_TRACE_SIMPLE
 #include "trace/simple.h"
diff --git a/trace/control.h b/trace/control.h
index e2ba6d4..5bd92f3 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -10,7 +10,6 @@
 #ifndef TRACE__CONTROL_H
 #define TRACE__CONTROL_H
 
-#include "qemu-common.h"
 #include "trace/generated-events.h"
 
 
diff --git a/ui/keymaps.c b/ui/keymaps.c
index 8899a0b..6b6901c 100644
--- a/ui/keymaps.c
+++ b/ui/keymaps.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "keymaps.h"
 #include "sysemu/sysemu.h"
 
diff --git a/ui/keymaps.h b/ui/keymaps.h
index a7600d5..536632d 100644
--- a/ui/keymaps.h
+++ b/ui/keymaps.h
@@ -25,8 +25,6 @@
 #ifndef __QEMU_KEYMAPS_H__
 #define __QEMU_KEYMAPS_H__
 
-#include "qemu-common.h"
-
 typedef struct {
 	const char* name;
 	int keysym;
diff --git a/ui/vnc.c b/ui/vnc.c
index 729f630..674dace 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -25,6 +25,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "vnc.h"
 #include "vnc-jobs.h"
 #include "trace.h"
diff --git a/ui/vnc.h b/ui/vnc.h
index 81a3261..ab6e486 100644
--- a/ui/vnc.h
+++ b/ui/vnc.h
@@ -27,7 +27,6 @@
 #ifndef __QEMU_VNC_H
 #define __QEMU_VNC_H
 
-#include "qemu-common.h"
 #include "qemu/queue.h"
 #include "qemu/thread.h"
 #include "ui/console.h"
diff --git a/util/buffer.c b/util/buffer.c
index a6118bf..be58643 100644
--- a/util/buffer.c
+++ b/util/buffer.c
@@ -19,6 +19,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu-common.h"
 #include "qemu/buffer.h"
 #include "trace.h"
 
diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
index 0b4cc7f..a4ae464 100644
--- a/util/mmap-alloc.c
+++ b/util/mmap-alloc.c
@@ -9,9 +9,11 @@
  * 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/mman.h>
+#include "qemu-common.h"
 
 #define HUGETLBFS_MAGIC       0x958458f6
 
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index dcc3c7e..15e66e9 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -39,7 +39,7 @@
 #endif
 
 #include "qemu/osdep.h"
-#include <termios.h>
+#include "qemu-common.h"
 #include <termios.h>
 
 #include <glib/gprintf.h>
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index d9cf1eb..58c06f3 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -15,8 +15,9 @@
  * 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 "monitor/monitor.h"
 #include "qapi/error.h"
 #include "qemu/sockets.h"
diff --git a/vl.c b/vl.c
index 7a28982..5e8e4dc 100644
--- a/vl.c
+++ b/vl.c
@@ -52,6 +52,7 @@ int main(int argc, char **argv)
 
 #include <glib.h>
 
+#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/sockets.h"
 #include "hw/hw.h"
-- 
2.4.3

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

* [Qemu-devel] [PATCH 15/15] Drop superfluous qemu-common.h inclusions
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
                   ` (13 preceding siblings ...)
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers Markus Armbruster
@ 2016-03-15 15:03 ` Markus Armbruster
  2016-03-15 15:30 ` [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Paolo Bonzini
  15 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 15:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, pbonzini

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 aio-posix.c                             | 1 -
 aio-win32.c                             | 1 -
 async.c                                 | 1 -
 audio/alsaaudio.c                       | 1 -
 audio/audio_pt_int.c                    | 1 -
 audio/audio_win_int.c                   | 1 -
 audio/coreaudio.c                       | 1 -
 audio/dsoundaudio.c                     | 1 -
 audio/noaudio.c                         | 1 -
 audio/ossaudio.c                        | 1 -
 audio/paaudio.c                         | 1 -
 audio/sdlaudio.c                        | 1 -
 backends/baum.c                         | 1 -
 block/archipelago.c                     | 1 -
 block/bochs.c                           | 1 -
 block/cloop.c                           | 1 -
 block/dmg.c                             | 1 -
 block/linux-aio.c                       | 1 -
 block/nfs.c                             | 1 -
 block/parallels.c                       | 1 -
 block/qcow.c                            | 1 -
 block/qcow2-cache.c                     | 1 -
 block/qcow2-cluster.c                   | 1 -
 block/qcow2-refcount.c                  | 1 -
 block/raw-win32.c                       | 1 -
 block/vhdx-endian.c                     | 1 -
 block/vhdx-log.c                        | 1 -
 block/vhdx.c                            | 1 -
 block/vpc.c                             | 1 -
 block/win32-aio.c                       | 1 -
 blockjob.c                              | 1 -
 bsd-user/main.c                         | 1 -
 bsd-user/mmap.c                         | 1 -
 bsd-user/syscall.c                      | 1 -
 bt-vhci.c                               | 1 -
 contrib/ivshmem-client/ivshmem-client.c | 1 -
 contrib/ivshmem-client/main.c           | 1 -
 crypto/aes.c                            | 1 -
 device_tree.c                           | 1 -
 disas.c                                 | 1 -
 disas/cris.c                            | 1 -
 disas/s390.c                            | 1 -
 disas/tci.c                             | 1 -
 fsdev/qemu-fsdev.c                      | 1 -
 fsdev/virtfs-proxy-helper.c             | 1 -
 hw/9pfs/coth.c                          | 1 -
 hw/acpi/bios-linker-loader.c            | 1 -
 hw/acpi/tco.c                           | 1 -
 hw/arm/sysbus-fdt.c                     | 1 -
 hw/block/cdrom.c                        | 1 -
 hw/block/onenand.c                      | 1 -
 hw/block/virtio-blk.c                   | 1 -
 hw/bt/core.c                            | 1 -
 hw/bt/hci-csr.c                         | 1 -
 hw/bt/hid.c                             | 1 -
 hw/bt/l2cap.c                           | 1 -
 hw/core/null-machine.c                  | 1 -
 hw/display/blizzard.c                   | 1 -
 hw/display/exynos4210_fimd.c            | 1 -
 hw/display/jazz_led.c                   | 1 -
 hw/display/qxl.c                        | 1 -
 hw/display/virtio-gpu-3d.c              | 1 -
 hw/display/virtio-gpu.c                 | 1 -
 hw/dma/etraxfs_dma.c                    | 1 -
 hw/dma/omap_dma.c                       | 1 -
 hw/dma/soc_dma.c                        | 1 -
 hw/i386/acpi-build.c                    | 1 -
 hw/i386/kvm/clock.c                     | 1 -
 hw/input/virtio-input-host.c            | 1 -
 hw/intc/exynos4210_gic.c                | 1 -
 hw/isa/lpc_ich9.c                       | 1 -
 hw/net/allwinner_emac.c                 | 1 -
 hw/net/rocker/qmp-norocker.c            | 1 -
 hw/net/vmxnet3.c                        | 1 -
 hw/net/vmxnet_rx_pkt.c                  | 1 -
 hw/net/vmxnet_tx_pkt.c                  | 1 -
 hw/pci/msix.c                           | 1 -
 hw/pci/pcie.c                           | 1 -
 hw/pci/shpc.c                           | 1 -
 hw/pcmcia/pcmcia.c                      | 1 -
 hw/ppc/e500plat.c                       | 1 -
 hw/ppc/mpc8544ds.c                      | 1 -
 hw/scsi/scsi-generic.c                  | 1 -
 hw/timer/arm_timer.c                    | 1 -
 hw/timer/exynos4210_mct.c               | 1 -
 hw/timer/exynos4210_pwm.c               | 1 -
 hw/tpm/tpm_passthrough.c                | 1 -
 hw/tpm/tpm_tis.c                        | 1 -
 hw/unicore32/puv3.c                     | 1 -
 hw/usb/combined-packet.c                | 1 -
 hw/usb/core.c                           | 1 -
 hw/usb/dev-audio.c                      | 1 -
 hw/usb/dev-bluetooth.c                  | 1 -
 hw/usb/dev-hub.c                        | 1 -
 hw/usb/dev-mtp.c                        | 1 -
 hw/usb/dev-uas.c                        | 1 -
 hw/usb/hcd-musb.c                       | 1 -
 hw/usb/host-legacy.c                    | 1 -
 hw/usb/host-libusb.c                    | 1 -
 hw/usb/host-stub.c                      | 1 -
 hw/usb/libhw.c                          | 1 -
 hw/usb/tusb6010.c                       | 1 -
 hw/virtio/virtio-balloon.c              | 1 -
 hw/watchdog/wdt_i6300esb.c              | 1 -
 hw/watchdog/wdt_ib700.c                 | 1 -
 iohandler.c                             | 1 -
 kvm-stub.c                              | 1 -
 linux-user/mmap.c                       | 1 -
 linux-user/signal.c                     | 1 -
 memory_mapping.c                        | 1 -
 migration/exec.c                        | 1 -
 migration/fd.c                          | 1 -
 migration/postcopy-ram.c                | 1 -
 migration/qemu-file-buf.c               | 1 -
 migration/qemu-file-stdio.c             | 1 -
 migration/qemu-file.c                   | 1 -
 migration/tcp.c                         | 1 -
 migration/unix.c                        | 1 -
 migration/vmstate.c                     | 1 -
 net/checksum.c                          | 1 -
 net/eth.c                               | 1 -
 net/l2tpv3.c                            | 1 -
 net/tap-bsd.c                           | 1 -
 net/tap-win32.c                         | 1 -
 net/vde.c                               | 1 -
 qapi/qapi-dealloc-visitor.c             | 1 -
 qapi/qapi-util.c                        | 1 -
 qapi/qapi-visit-core.c                  | 1 -
 qapi/qmp-event.c                        | 1 -
 qapi/qmp-input-visitor.c                | 1 -
 qapi/qmp-output-visitor.c               | 1 -
 qapi/string-input-visitor.c             | 1 -
 qapi/string-output-visitor.c            | 1 -
 qobject/json-lexer.c                    | 1 -
 qobject/json-streamer.c                 | 1 -
 qobject/qbool.c                         | 1 -
 qobject/qfloat.c                        | 1 -
 qobject/qint.c                          | 1 -
 qobject/qlist.c                         | 1 -
 qobject/qnull.c                         | 1 -
 qobject/qobject.c                       | 1 -
 qobject/qstring.c                       | 1 -
 qom/qom-qobject.c                       | 1 -
 replay/replay-events.c                  | 1 -
 replay/replay-input.c                   | 1 -
 replay/replay-internal.c                | 1 -
 replay/replay-time.c                    | 1 -
 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/get-fd.c                          | 1 -
 stubs/get-next-serial.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/set-fd-handler.c                  | 1 -
 stubs/slirp.c                           | 1 -
 stubs/uuid.c                            | 1 -
 stubs/vm-stop.c                         | 1 -
 stubs/vmstate.c                         | 1 -
 target-arm/kvm-stub.c                   | 1 -
 target-arm/kvm.c                        | 1 -
 target-arm/kvm32.c                      | 1 -
 target-arm/kvm64.c                      | 1 -
 target-i386/kvm-stub.c                  | 1 -
 target-i386/kvm.c                       | 1 -
 target-m68k/m68k-semi.c                 | 1 -
 target-mips/kvm.c                       | 1 -
 target-openrisc/interrupt.c             | 1 -
 target-openrisc/mmu.c                   | 1 -
 target-openrisc/translate.c             | 1 -
 target-ppc/kvm-stub.c                   | 1 -
 target-ppc/kvm.c                        | 1 -
 target-s390x/kvm.c                      | 1 -
 target-tilegx/helper.c                  | 1 -
 target-tilegx/simd_helper.c             | 1 -
 target-xtensa/core-dc233c.c             | 1 -
 tcg/optimize.c                          | 1 -
 tci.c                                   | 1 -
 tests/ahci-test.c                       | 1 -
 tests/boot-sector.c                     | 1 -
 tests/check-qdict.c                     | 1 -
 tests/check-qfloat.c                    | 1 -
 tests/check-qint.c                      | 1 -
 tests/check-qjson.c                     | 1 -
 tests/check-qstring.c                   | 1 -
 tests/device-introspect-test.c          | 1 -
 tests/fdc-test.c                        | 1 -
 tests/hd-geo-test.c                     | 1 -
 tests/ipmi-bt-test.c                    | 1 -
 tests/libqos/ahci.c                     | 1 -
 tests/libqos/malloc-pc.c                | 1 -
 tests/libqos/pci-pc.c                   | 1 -
 tests/pc-cpu-test.c                     | 1 -
 tests/pxe-test.c                        | 1 -
 tests/rtl8139-test.c                    | 1 -
 tests/test-iov.c                        | 1 -
 tests/test-qmp-commands.c               | 1 -
 tests/test-qmp-event.c                  | 1 -
 tests/test-qmp-input-strict.c           | 1 -
 tests/test-qmp-input-visitor.c          | 1 -
 tests/test-qmp-output-visitor.c         | 1 -
 tests/test-string-input-visitor.c       | 1 -
 tests/test-string-output-visitor.c      | 1 -
 tests/test-thread-pool.c                | 1 -
 tests/test-visitor-serialization.c      | 1 -
 tests/test-vmstate.c                    | 1 -
 tests/virtio-9p-test.c                  | 1 -
 thread-pool.c                           | 1 -
 ui/console-gl.c                         | 1 -
 ui/curses.c                             | 1 -
 ui/cursor.c                             | 1 -
 ui/egl-context.c                        | 1 -
 ui/gtk-egl.c                            | 1 -
 ui/gtk-gl-area.c                        | 1 -
 ui/qemu-pixman.c                        | 1 -
 ui/sdl2-2d.c                            | 1 -
 ui/sdl2-gl.c                            | 1 -
 ui/sdl2-input.c                         | 1 -
 ui/sdl2.c                               | 1 -
 ui/shader.c                             | 1 -
 ui/spice-core.c                         | 1 -
 ui/spice-display.c                      | 1 -
 ui/spice-input.c                        | 1 -
 ui/vnc-enc-tight.c                      | 1 -
 ui/x_keymap.c                           | 1 -
 util/acl.c                              | 1 -
 util/compatfd.c                         | 1 -
 util/coroutine-gthread.c                | 1 -
 util/coroutine-sigaltstack.c            | 1 -
 util/coroutine-ucontext.c               | 1 -
 util/coroutine-win32.c                  | 1 -
 util/crc32c.c                           | 1 -
 util/envlist.c                          | 1 -
 util/error.c                            | 1 -
 util/event_notifier-win32.c             | 1 -
 util/fifo8.c                            | 1 -
 util/getauxval.c                        | 1 -
 util/log.c                              | 1 -
 util/mmap-alloc.c                       | 1 -
 util/module.c                           | 1 -
 util/notify.c                           | 1 -
 util/qemu-config.c                      | 1 -
 util/qemu-coroutine-lock.c              | 1 -
 util/qemu-coroutine.c                   | 1 -
 util/qemu-thread-win32.c                | 1 -
 util/rcu.c                              | 1 -
 262 files changed, 262 deletions(-)

diff --git a/aio-posix.c b/aio-posix.c
index fa7f8ab..5fbc837 100644
--- a/aio-posix.c
+++ b/aio-posix.c
@@ -14,7 +14,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "block/block.h"
 #include "qemu/queue.h"
 #include "qemu/sockets.h"
diff --git a/aio-win32.c b/aio-win32.c
index 6aaa32a..ec29ca3 100644
--- a/aio-win32.c
+++ b/aio-win32.c
@@ -16,7 +16,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "block/block.h"
 #include "qemu/queue.h"
 #include "qemu/sockets.h"
diff --git a/async.c b/async.c
index b4bf205..e5093a7 100644
--- a/async.c
+++ b/async.c
@@ -24,7 +24,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "block/aio.h"
 #include "block/thread-pool.h"
 #include "qemu/main-loop.h"
diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c
index 3652a7b..08148a1 100644
--- a/audio/alsaaudio.c
+++ b/audio/alsaaudio.c
@@ -23,7 +23,6 @@
  */
 #include "qemu/osdep.h"
 #include <alsa/asoundlib.h>
-#include "qemu-common.h"
 #include "qemu/main-loop.h"
 #include "audio.h"
 #include "trace.h"
diff --git a/audio/audio_pt_int.c b/audio/audio_pt_int.c
index 21ff9c5..c8b3f42 100644
--- a/audio/audio_pt_int.c
+++ b/audio/audio_pt_int.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "audio.h"
 
 #define AUDIO_CAP "audio-pt"
diff --git a/audio/audio_win_int.c b/audio/audio_win_int.c
index 6900008..34e7071 100644
--- a/audio/audio_win_int.c
+++ b/audio/audio_win_int.c
@@ -1,7 +1,6 @@
 /* public domain */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 
 #define AUDIO_CAP "win-int"
 #include <windows.h>
diff --git a/audio/coreaudio.c b/audio/coreaudio.c
index d4ad224..f626883 100644
--- a/audio/coreaudio.c
+++ b/audio/coreaudio.c
@@ -26,7 +26,6 @@
 #include <CoreAudio/CoreAudio.h>
 #include <pthread.h>            /* pthread_X */
 
-#include "qemu-common.h"
 #include "audio.h"
 
 #define AUDIO_CAP "coreaudio"
diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c
index 516846e..24ae95f 100644
--- a/audio/dsoundaudio.c
+++ b/audio/dsoundaudio.c
@@ -27,7 +27,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "audio.h"
 
 #define AUDIO_CAP "dsound"
diff --git a/audio/noaudio.c b/audio/noaudio.c
index 09588b9..7c33cc0 100644
--- a/audio/noaudio.c
+++ b/audio/noaudio.c
@@ -22,7 +22,6 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "audio.h"
 #include "qemu/timer.h"
 
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index 349e9dd..57a5087 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -25,7 +25,6 @@
 #include <sys/mman.h>
 #include <sys/ioctl.h>
 #include <sys/soundcard.h>
-#include "qemu-common.h"
 #include "qemu/main-loop.h"
 #include "qemu/host-utils.h"
 #include "audio.h"
diff --git a/audio/paaudio.c b/audio/paaudio.c
index 57678e7..651ef8d 100644
--- a/audio/paaudio.c
+++ b/audio/paaudio.c
@@ -1,6 +1,5 @@
 /* public domain */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "audio.h"
 
 #include <pulse/pulseaudio.h>
diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index db69fe1..14f1413 100644
--- a/audio/sdlaudio.c
+++ b/audio/sdlaudio.c
@@ -24,7 +24,6 @@
 #include "qemu/osdep.h"
 #include <SDL.h>
 #include <SDL_thread.h>
-#include "qemu-common.h"
 #include "audio.h"
 
 #ifndef _WIN32
diff --git a/backends/baum.c b/backends/baum.c
index 7644f72..7ee8aa3 100644
--- a/backends/baum.c
+++ b/backends/baum.c
@@ -23,7 +23,6 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "sysemu/char.h"
 #include "qemu/timer.h"
 #include "hw/usb.h"
diff --git a/block/archipelago.c b/block/archipelago.c
index 0507589..6bc5850 100644
--- a/block/archipelago.c
+++ b/block/archipelago.c
@@ -51,7 +51,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/error-report.h"
 #include "qemu/thread.h"
diff --git a/block/bochs.c b/block/bochs.c
index af8b7ab..1334297 100644
--- a/block/bochs.c
+++ b/block/bochs.c
@@ -24,7 +24,6 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
 
diff --git a/block/cloop.c b/block/cloop.c
index a84f140..fc32bd2 100644
--- a/block/cloop.c
+++ b/block/cloop.c
@@ -23,7 +23,6 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
 #include <zlib.h>
diff --git a/block/dmg.c b/block/dmg.c
index a496eb7..8452e54 100644
--- a/block/dmg.c
+++ b/block/dmg.c
@@ -23,7 +23,6 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/bswap.h"
 #include "qemu/error-report.h"
diff --git a/block/linux-aio.c b/block/linux-aio.c
index 805757e..042c93d 100644
--- a/block/linux-aio.c
+++ b/block/linux-aio.c
@@ -8,7 +8,6 @@
  * See the COPYING file in the top-level directory.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "block/aio.h"
 #include "qemu/queue.h"
 #include "block/raw-aio.h"
diff --git a/block/nfs.c b/block/nfs.c
index 7220e89..ee00cb6 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -25,7 +25,6 @@
 #include "qemu/osdep.h"
 
 #include <poll.h>
-#include "qemu-common.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
 #include "block/block_int.h"
diff --git a/block/parallels.c b/block/parallels.c
index dfba8d4..74e7cce 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -29,7 +29,6 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
 #include "qemu/bitmap.h"
diff --git a/block/qcow.c b/block/qcow.c
index 4485819..f0d833d 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -23,7 +23,6 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
 #include <zlib.h>
diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c
index 0fe8eda..e5ececb 100644
--- a/block/qcow2-cache.c
+++ b/block/qcow2-cache.c
@@ -30,7 +30,6 @@
 #endif
 
 #include "block/block_int.h"
-#include "qemu-common.h"
 #include "qcow2.h"
 #include "trace.h"
 
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 31ecc10..836c56f 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -26,7 +26,6 @@
 #include <zlib.h>
 
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "block/block_int.h"
 #include "block/qcow2.h"
 #include "trace.h"
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index ca6094f..f5a2eb7 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -24,7 +24,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "block/block_int.h"
 #include "block/qcow2.h"
 #include "qemu/range.h"
diff --git a/block/raw-win32.c b/block/raw-win32.c
index 21a6cb8..a0b9610 100644
--- a/block/raw-win32.c
+++ b/block/raw-win32.c
@@ -22,7 +22,6 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
diff --git a/block/vhdx-endian.c b/block/vhdx-endian.c
index da33cd3..d619652 100644
--- a/block/vhdx-endian.c
+++ b/block/vhdx-endian.c
@@ -16,7 +16,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "block/block_int.h"
 #include "block/vhdx.h"
 
diff --git a/block/vhdx-log.c b/block/vhdx-log.c
index 7ea7187..c250486 100644
--- a/block/vhdx-log.c
+++ b/block/vhdx-log.c
@@ -19,7 +19,6 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
diff --git a/block/vhdx.c b/block/vhdx.c
index cbb54d8..f92b283 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -17,7 +17,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
 #include "qemu/crc32c.h"
diff --git a/block/vpc.c b/block/vpc.c
index d60f692..c4d69b4 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -24,7 +24,6 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
 #include "migration/migration.h"
diff --git a/block/win32-aio.c b/block/win32-aio.c
index 2d509a9..c4432b0 100644
--- a/block/win32-aio.c
+++ b/block/win32-aio.c
@@ -22,7 +22,6 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
diff --git a/blockjob.c b/blockjob.c
index 9fc37ca..08c1fac 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -24,7 +24,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "trace.h"
 #include "block/block.h"
 #include "block/blockjob.h"
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 287ec1d..1f2f4af 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -21,7 +21,6 @@
 #include <sys/mman.h>
 
 #include "qemu.h"
-#include "qemu-common.h"
 /* For tb_lock */
 #include "cpu.h"
 #include "tcg.h"
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index 6ab5334..a7028af 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -20,7 +20,6 @@
 #include <sys/mman.h>
 
 #include "qemu.h"
-#include "qemu-common.h"
 #include "bsd-mman.h"
 
 //#define DEBUG_MMAP
diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c
index 35f784c..bbe4ed8 100644
--- a/bsd-user/syscall.c
+++ b/bsd-user/syscall.c
@@ -24,7 +24,6 @@
 #include <utime.h>
 
 #include "qemu.h"
-#include "qemu-common.h"
 
 //#define DEBUG
 
diff --git a/bt-vhci.c b/bt-vhci.c
index 9d277c3..886e146 100644
--- a/bt-vhci.c
+++ b/bt-vhci.c
@@ -18,7 +18,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "sysemu/bt.h"
 #include "hw/bt.h"
 #include "qemu/main-loop.h"
diff --git a/contrib/ivshmem-client/ivshmem-client.c b/contrib/ivshmem-client/ivshmem-client.c
index 44ae364..b1274b2 100644
--- a/contrib/ivshmem-client/ivshmem-client.c
+++ b/contrib/ivshmem-client/ivshmem-client.c
@@ -10,7 +10,6 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 
-#include "qemu-common.h"
 #include "qemu/queue.h"
 
 #include "ivshmem-client.h"
diff --git a/contrib/ivshmem-client/main.c b/contrib/ivshmem-client/main.c
index 33ae1da..21f38f3 100644
--- a/contrib/ivshmem-client/main.c
+++ b/contrib/ivshmem-client/main.c
@@ -7,7 +7,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 
 #include "ivshmem-client.h"
 
diff --git a/crypto/aes.c b/crypto/aes.c
index 3456eac..0dcaf0b 100644
--- a/crypto/aes.c
+++ b/crypto/aes.c
@@ -28,7 +28,6 @@
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "crypto/aes.h"
 
 typedef uint32_t u32;
diff --git a/device_tree.c b/device_tree.c
index ccba1fd..f3ce6c1 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -18,7 +18,6 @@
 #endif
 
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/sysemu.h"
diff --git a/disas.c b/disas.c
index 05a7a12..11995e4 100644
--- a/disas.c
+++ b/disas.c
@@ -1,6 +1,5 @@
 /* General "disassemble this chunk" code.  Used for debugging. */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "disas/bfd.h"
 #include "elf.h"
 
diff --git a/disas/cris.c b/disas/cris.c
index 7f35bc0..8d2ce2c 100644
--- a/disas/cris.c
+++ b/disas/cris.c
@@ -19,7 +19,6 @@
    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 "sysdep.h"
 #include "target-cris/opcode-cris.h"
diff --git a/disas/s390.c b/disas/s390.c
index 1f167d2..4608764 100644
--- a/disas/s390.c
+++ b/disas/s390.c
@@ -21,7 +21,6 @@
    02110-1301, USA.  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "disas/bfd.h"
 
 /* include/opcode/s390.h revision 1.9 */
diff --git a/disas/tci.c b/disas/tci.c
index 1cdf5ee..9ee2f04 100644
--- a/disas/tci.c
+++ b/disas/tci.c
@@ -18,7 +18,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "disas/bfd.h"
 #include "tcg/tcg.h"
 
diff --git a/fsdev/qemu-fsdev.c b/fsdev/qemu-fsdev.c
index bf7f0b0..e7fe060 100644
--- a/fsdev/qemu-fsdev.c
+++ b/fsdev/qemu-fsdev.c
@@ -13,7 +13,6 @@
 #include "qemu/osdep.h"
 #include "qemu-fsdev.h"
 #include "qemu/queue.h"
-#include "qemu-common.h"
 #include "qemu/config-file.h"
 #include "qemu/error-report.h"
 
diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
index 54f7ad1..ddbd694 100644
--- a/fsdev/virtfs-proxy-helper.c
+++ b/fsdev/virtfs-proxy-helper.c
@@ -21,7 +21,6 @@
 #ifdef CONFIG_LINUX_MAGIC_H
 #include <linux/magic.h>
 #endif
-#include "qemu-common.h"
 #include "qemu/sockets.h"
 #include "qemu/xattr.h"
 #include "9p-iov-marshal.h"
diff --git a/hw/9pfs/coth.c b/hw/9pfs/coth.c
index 464293e..3a08517 100644
--- a/hw/9pfs/coth.c
+++ b/hw/9pfs/coth.c
@@ -13,7 +13,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "block/thread-pool.h"
 #include "qemu/coroutine.h"
 #include "qemu/main-loop.h"
diff --git a/hw/acpi/bios-linker-loader.c b/hw/acpi/bios-linker-loader.c
index ace9abb..8db2f2d 100644
--- a/hw/acpi/bios-linker-loader.c
+++ b/hw/acpi/bios-linker-loader.c
@@ -19,7 +19,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/acpi/bios-linker-loader.h"
 #include "hw/nvram/fw_cfg.h"
 
diff --git a/hw/acpi/tco.c b/hw/acpi/tco.c
index 8ce7daf..958628d 100644
--- a/hw/acpi/tco.c
+++ b/hw/acpi/tco.c
@@ -7,7 +7,6 @@
  * See the COPYING file in the top-level directory.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "sysemu/watchdog.h"
 #include "hw/i386/ich9.h"
 
diff --git a/hw/arm/sysbus-fdt.c b/hw/arm/sysbus-fdt.c
index 5debb33..428c476 100644
--- a/hw/arm/sysbus-fdt.c
+++ b/hw/arm/sysbus-fdt.c
@@ -24,7 +24,6 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include <libfdt.h>
-#include "qemu-common.h"
 #ifdef CONFIG_LINUX
 #include <linux/vfio.h>
 #endif
diff --git a/hw/block/cdrom.c b/hw/block/cdrom.c
index da937fe..c6bfa50 100644
--- a/hw/block/cdrom.c
+++ b/hw/block/cdrom.c
@@ -26,7 +26,6 @@
    here.  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/scsi/scsi.h"
 
 static void lba_to_msf(uint8_t *buf, int lba)
diff --git a/hw/block/onenand.c b/hw/block/onenand.c
index 883f4b1..a2be757 100644
--- a/hw/block/onenand.c
+++ b/hw/block/onenand.c
@@ -20,7 +20,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/block/flash.h"
 #include "hw/irq.h"
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 870d345..bae581d 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -13,7 +13,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qemu/iov.h"
 #include "qemu/error-report.h"
 #include "trace.h"
diff --git a/hw/bt/core.c b/hw/bt/core.c
index 615f0af..c566df4 100644
--- a/hw/bt/core.c
+++ b/hw/bt/core.c
@@ -18,7 +18,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "sysemu/bt.h"
 #include "hw/bt.h"
 
diff --git a/hw/bt/hci-csr.c b/hw/bt/hci-csr.c
index 0189b0a..616d7d0 100644
--- a/hw/bt/hci-csr.c
+++ b/hw/bt/hci-csr.c
@@ -19,7 +19,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "sysemu/char.h"
 #include "qemu/timer.h"
 #include "hw/irq.h"
diff --git a/hw/bt/hid.c b/hw/bt/hid.c
index f6affbb..258780a 100644
--- a/hw/bt/hid.c
+++ b/hw/bt/hid.c
@@ -19,7 +19,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "ui/console.h"
 #include "hw/input/hid.h"
diff --git a/hw/bt/l2cap.c b/hw/bt/l2cap.c
index 8065251..1b0d9ad 100644
--- a/hw/bt/l2cap.c
+++ b/hw/bt/l2cap.c
@@ -18,7 +18,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "hw/bt.h"
 
diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
index 0351ba7..f2937dd 100644
--- a/hw/core/null-machine.c
+++ b/hw/core/null-machine.c
@@ -12,7 +12,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/boards.h"
 
diff --git a/hw/display/blizzard.c b/hw/display/blizzard.c
index c231960..daf0437 100644
--- a/hw/display/blizzard.c
+++ b/hw/display/blizzard.c
@@ -19,7 +19,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "ui/console.h"
 #include "hw/devices.h"
 #include "ui/pixel_ops.h"
diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c
index 728eb21..71435ce 100644
--- a/hw/display/exynos4210_fimd.c
+++ b/hw/display/exynos4210_fimd.c
@@ -23,7 +23,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/sysbus.h"
 #include "ui/console.h"
 #include "ui/pixel_ops.h"
diff --git a/hw/display/jazz_led.c b/hw/display/jazz_led.c
index 09dcdb4..8389e41 100644
--- a/hw/display/jazz_led.c
+++ b/hw/display/jazz_led.c
@@ -23,7 +23,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "ui/console.h"
 #include "ui/pixel_ops.h"
 #include "trace.h"
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 919dc5c..767e4c4 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -21,7 +21,6 @@
 #include "qemu/osdep.h"
 #include <zlib.h>
 
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "qemu/queue.h"
 #include "qemu/atomic.h"
diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c
index fa19294..757ac19 100644
--- a/hw/display/virtio-gpu-3d.c
+++ b/hw/display/virtio-gpu-3d.c
@@ -12,7 +12,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/iov.h"
 #include "trace.h"
 #include "hw/virtio/virtio.h"
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index ddf3bfb..4bac082 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -12,7 +12,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/iov.h"
 #include "ui/console.h"
 #include "trace.h"
diff --git a/hw/dma/etraxfs_dma.c b/hw/dma/etraxfs_dma.c
index d5650eb..85783eb 100644
--- a/hw/dma/etraxfs_dma.c
+++ b/hw/dma/etraxfs_dma.c
@@ -24,7 +24,6 @@
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "exec/address-spaces.h"
-#include "qemu-common.h"
 #include "sysemu/sysemu.h"
 
 #include "hw/cris/etraxfs_dma.h"
diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c
index 700cd6b..1129c8f 100644
--- a/hw/dma/omap_dma.c
+++ b/hw/dma/omap_dma.c
@@ -18,7 +18,6 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "hw/arm/omap.h"
 #include "hw/irq.h"
diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c
index 9bb499b..95c9e8b 100644
--- a/hw/dma/soc_dma.c
+++ b/hw/dma/soc_dma.c
@@ -18,7 +18,6 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "hw/arm/soc_dma.h"
 
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 2af5a6b..b575d75 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -24,7 +24,6 @@
 #include "qapi/error.h"
 #include "acpi-build.h"
 #include <glib.h>
-#include "qemu-common.h"
 #include "qemu/bitmap.h"
 #include "qemu/error-report.h"
 #include "hw/pci/pci.h"
diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c
index a3b300c..378bf7f 100644
--- a/hw/i386/kvm/clock.c
+++ b/hw/i386/kvm/clock.c
@@ -14,7 +14,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/host-utils.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
diff --git a/hw/input/virtio-input-host.c b/hw/input/virtio-input-host.c
index 9e0f46d..7b44b26 100644
--- a/hw/input/virtio-input-host.c
+++ b/hw/input/virtio-input-host.c
@@ -6,7 +6,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qemu/sockets.h"
 
 #include "hw/qdev.h"
diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c
index 4f7e89f..d3af9f0 100644
--- a/hw/intc/exynos4210_gic.c
+++ b/hw/intc/exynos4210_gic.c
@@ -22,7 +22,6 @@
 
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
-#include "qemu-common.h"
 #include "hw/irq.h"
 #include "hw/arm/exynos4210.h"
 
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 4e896b2..6b45a8d 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -28,7 +28,6 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/hw.h"
 #include "qapi/visitor.h"
 #include "qemu/range.h"
diff --git a/hw/net/allwinner_emac.c b/hw/net/allwinner_emac.c
index 8059509..16d4b63 100644
--- a/hw/net/allwinner_emac.c
+++ b/hw/net/allwinner_emac.c
@@ -17,7 +17,6 @@
  *
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/sysbus.h"
 #include "net/net.h"
 #include "qemu/fifo8.h"
diff --git a/hw/net/rocker/qmp-norocker.c b/hw/net/rocker/qmp-norocker.c
index 6acbcdb..3b28d7b 100644
--- a/hw/net/rocker/qmp-norocker.c
+++ b/hw/net/rocker/qmp-norocker.c
@@ -16,7 +16,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qmp-commands.h"
 #include "qapi/qmp/qerror.h"
 
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 093a71e..24851d5 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -22,7 +22,6 @@
 #include "net/tap.h"
 #include "net/checksum.h"
 #include "sysemu/sysemu.h"
-#include "qemu-common.h"
 #include "qemu/bswap.h"
 #include "hw/pci/msix.h"
 #include "hw/pci/msi.h"
diff --git a/hw/net/vmxnet_rx_pkt.c b/hw/net/vmxnet_rx_pkt.c
index 21bb46e..0174a52 100644
--- a/hw/net/vmxnet_rx_pkt.c
+++ b/hw/net/vmxnet_rx_pkt.c
@@ -18,7 +18,6 @@
 #include "qemu/osdep.h"
 #include "vmxnet_rx_pkt.h"
 #include "net/eth.h"
-#include "qemu-common.h"
 #include "qemu/iov.h"
 #include "net/checksum.h"
 #include "net/tap.h"
diff --git a/hw/net/vmxnet_tx_pkt.c b/hw/net/vmxnet_tx_pkt.c
index 91e1e08..5ae09f3 100644
--- a/hw/net/vmxnet_tx_pkt.c
+++ b/hw/net/vmxnet_tx_pkt.c
@@ -19,7 +19,6 @@
 #include "hw/hw.h"
 #include "vmxnet_tx_pkt.h"
 #include "net/eth.h"
-#include "qemu-common.h"
 #include "qemu/iov.h"
 #include "net/checksum.h"
 #include "net/tap.h"
diff --git a/hw/pci/msix.c b/hw/pci/msix.c
index 6f05ced..537fdba 100644
--- a/hw/pci/msix.c
+++ b/hw/pci/msix.c
@@ -15,7 +15,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 728386a..9d3ba28 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -20,7 +20,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pcie.h"
 #include "hw/pci/msix.h"
diff --git a/hw/pci/shpc.c b/hw/pci/shpc.c
index 3dcd472..998839a 100644
--- a/hw/pci/shpc.c
+++ b/hw/pci/shpc.c
@@ -1,6 +1,5 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qemu/range.h"
 #include "qemu/error-report.h"
 #include "hw/pci/shpc.h"
diff --git a/hw/pcmcia/pcmcia.c b/hw/pcmcia/pcmcia.c
index 1956721..594b37c 100644
--- a/hw/pcmcia/pcmcia.c
+++ b/hw/pcmcia/pcmcia.c
@@ -5,7 +5,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/pcmcia.h"
 
diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c
index b00565c..4c72edc 100644
--- a/hw/ppc/e500plat.c
+++ b/hw/ppc/e500plat.c
@@ -10,7 +10,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "e500.h"
 #include "hw/boards.h"
 #include "sysemu/device_tree.h"
diff --git a/hw/ppc/mpc8544ds.c b/hw/ppc/mpc8544ds.c
index 27b8289..57ebc88 100644
--- a/hw/ppc/mpc8544ds.c
+++ b/hw/ppc/mpc8544ds.c
@@ -10,7 +10,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "e500.h"
 #include "hw/boards.h"
 #include "sysemu/device_tree.h"
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 7459465..cba5047 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -13,7 +13,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "hw/scsi/scsi.h"
 #include "sysemu/block-backend.h"
diff --git a/hw/timer/arm_timer.c b/hw/timer/arm_timer.c
index f1ede5f..0e2fc83 100644
--- a/hw/timer/arm_timer.c
+++ b/hw/timer/arm_timer.c
@@ -10,7 +10,6 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
-#include "qemu-common.h"
 #include "hw/qdev.h"
 #include "hw/ptimer.h"
 #include "qemu/main-loop.h"
diff --git a/hw/timer/exynos4210_mct.c b/hw/timer/exynos4210_mct.c
index ae69345..263d298 100644
--- a/hw/timer/exynos4210_mct.c
+++ b/hw/timer/exynos4210_mct.c
@@ -56,7 +56,6 @@
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
 #include "qemu/main-loop.h"
-#include "qemu-common.h"
 #include "hw/ptimer.h"
 
 #include "hw/arm/exynos4210.h"
diff --git a/hw/timer/exynos4210_pwm.c b/hw/timer/exynos4210_pwm.c
index 0e9e2e9..ad24b15 100644
--- a/hw/timer/exynos4210_pwm.c
+++ b/hw/timer/exynos4210_pwm.c
@@ -23,7 +23,6 @@
 #include "qemu/osdep.h"
 #include "hw/sysbus.h"
 #include "qemu/timer.h"
-#include "qemu-common.h"
 #include "qemu/main-loop.h"
 #include "hw/ptimer.h"
 
diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
index e98efb7..c36358c 100644
--- a/hw/tpm/tpm_passthrough.c
+++ b/hw/tpm/tpm_passthrough.c
@@ -23,7 +23,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/sockets.h"
 #include "sysemu/tpm_backend.h"
diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c
index 381e726..c300513 100644
--- a/hw/tpm/tpm_tis.c
+++ b/hw/tpm/tpm_tis.c
@@ -32,7 +32,6 @@
 #include "hw/pci/pci_ids.h"
 #include "tpm_tis.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qemu/main-loop.h"
 #include "sysemu/tpm_backend.h"
 
diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c
index d2933cb..f5554a9 100644
--- a/hw/unicore32/puv3.c
+++ b/hw/unicore32/puv3.c
@@ -11,7 +11,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "ui/console.h"
 #include "elf.h"
 #include "exec/address-spaces.h"
diff --git a/hw/usb/combined-packet.c b/hw/usb/combined-packet.c
index 48cac87..05ee9b0 100644
--- a/hw/usb/combined-packet.c
+++ b/hw/usb/combined-packet.c
@@ -20,7 +20,6 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/usb.h"
 #include "qemu/iov.h"
 #include "trace.h"
diff --git a/hw/usb/core.c b/hw/usb/core.c
index 45fa00c..10d19d1 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -24,7 +24,6 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/usb.h"
 #include "qemu/iov.h"
 #include "trace.h"
diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c
index 87cab0a..81fa91d 100644
--- a/hw/usb/dev-audio.c
+++ b/hw/usb/dev-audio.c
@@ -30,7 +30,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/usb.h"
 #include "hw/usb/desc.h"
 #include "hw/hw.h"
diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c
index 91a4a0b..aa7314e 100644
--- a/hw/usb/dev-bluetooth.c
+++ b/hw/usb/dev-bluetooth.c
@@ -19,7 +19,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "hw/usb.h"
 #include "hw/usb/desc.h"
diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c
index a33f21c..49b5c8b 100644
--- a/hw/usb/dev-hub.c
+++ b/hw/usb/dev-hub.c
@@ -23,7 +23,6 @@
  */
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "trace.h"
 #include "hw/usb.h"
 #include "hw/usb/desc.h"
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 0be4135..52389dc 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -20,7 +20,6 @@
 #include "qemu/main-loop.h"
 #endif
 
-#include "qemu-common.h"
 #include "qemu/iov.h"
 #include "trace.h"
 #include "hw/usb.h"
diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c
index 0678b1b..3b7ea80 100644
--- a/hw/usb/dev-uas.c
+++ b/hw/usb/dev-uas.c
@@ -10,7 +10,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/option.h"
 #include "qemu/config-file.h"
 #include "trace.h"
diff --git a/hw/usb/hcd-musb.c b/hw/usb/hcd-musb.c
index cd23197..80efe50 100644
--- a/hw/usb/hcd-musb.c
+++ b/hw/usb/hcd-musb.c
@@ -21,7 +21,6 @@
  * Only host-mode and non-DMA accesses are currently supported.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "hw/usb.h"
 #include "hw/irq.h"
diff --git a/hw/usb/host-legacy.c b/hw/usb/host-legacy.c
index 3b57e21..4a30f6e 100644
--- a/hw/usb/host-legacy.c
+++ b/hw/usb/host-legacy.c
@@ -31,7 +31,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/usb.h"
 #include "hw/usb/host.h"
 
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 6458a94..6229618 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -38,7 +38,6 @@
 #include <libusb.h>
 
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "monitor/monitor.h"
 #include "qemu/error-report.h"
 #include "sysemu/sysemu.h"
diff --git a/hw/usb/host-stub.c b/hw/usb/host-stub.c
index 6ba65a1..210e060 100644
--- a/hw/usb/host-stub.c
+++ b/hw/usb/host-stub.c
@@ -31,7 +31,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "ui/console.h"
 #include "hw/usb.h"
 #include "monitor/monitor.h"
diff --git a/hw/usb/libhw.c b/hw/usb/libhw.c
index 73cdf0c..adbee2f 100644
--- a/hw/usb/libhw.c
+++ b/hw/usb/libhw.c
@@ -20,7 +20,6 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/hw.h"
 #include "hw/usb.h"
 #include "sysemu/dma.h"
diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c
index 9f6af90..e377057 100644
--- a/hw/usb/tusb6010.c
+++ b/hw/usb/tusb6010.c
@@ -19,7 +19,6 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "hw/usb.h"
 #include "hw/arm/omap.h"
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index e9c30e9..940c0ca 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -16,7 +16,6 @@
 #include "qemu/osdep.h"
 #include "qemu/iov.h"
 #include "qemu/timer.h"
-#include "qemu-common.h"
 #include "hw/virtio/virtio.h"
 #include "hw/i386/pc.h"
 #include "cpu.h"
diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c
index a83d951..3846592 100644
--- a/hw/watchdog/wdt_i6300esb.c
+++ b/hw/watchdog/wdt_i6300esb.c
@@ -21,7 +21,6 @@
 
 #include "qemu/osdep.h"
 
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "sysemu/watchdog.h"
 #include "hw/hw.h"
diff --git a/hw/watchdog/wdt_ib700.c b/hw/watchdog/wdt_ib700.c
index 532530b..0488648 100644
--- a/hw/watchdog/wdt_ib700.c
+++ b/hw/watchdog/wdt_ib700.c
@@ -20,7 +20,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "sysemu/watchdog.h"
 #include "hw/hw.h"
diff --git a/iohandler.c b/iohandler.c
index 3f23433..5bd79f8 100644
--- a/iohandler.c
+++ b/iohandler.c
@@ -24,7 +24,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qemu/queue.h"
 #include "block/aio.h"
 #include "qemu/main-loop.h"
diff --git a/kvm-stub.c b/kvm-stub.c
index b962b24..c623417 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -11,7 +11,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/hw.h"
 #include "cpu.h"
 #include "sysemu/kvm.h"
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 3519147..17d5b17 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -22,7 +22,6 @@
 #include <linux/unistd.h>
 
 #include "qemu.h"
-#include "qemu-common.h"
 #include "translate-all.h"
 
 //#define DEBUG_MMAP
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 96e86c0..fa13d49 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -21,7 +21,6 @@
 #include <sys/resource.h>
 
 #include "qemu.h"
-#include "qemu-common.h"
 #include "target_signal.h"
 #include "trace.h"
 
diff --git a/memory_mapping.c b/memory_mapping.c
index 2354b2b..4e9b305 100644
--- a/memory_mapping.c
+++ b/memory_mapping.c
@@ -15,7 +15,6 @@
 #include "qapi/error.h"
 #include <glib.h>
 
-#include "qemu-common.h"
 #include "cpu.h"
 #include "sysemu/memory_mapping.h"
 #include "exec/memory.h"
diff --git a/migration/exec.c b/migration/exec.c
index 5594209..a213dba 100644
--- a/migration/exec.c
+++ b/migration/exec.c
@@ -17,7 +17,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qemu/sockets.h"
 #include "qemu/main-loop.h"
 #include "migration/migration.h"
diff --git a/migration/fd.c b/migration/fd.c
index 3d788bb..5384275 100644
--- a/migration/fd.c
+++ b/migration/fd.c
@@ -15,7 +15,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qemu/main-loop.h"
 #include "qemu/sockets.h"
 #include "migration/migration.h"
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index fbd0064..b1f0fc7 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -19,7 +19,6 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 
-#include "qemu-common.h"
 #include "migration/migration.h"
 #include "migration/postcopy-ram.h"
 #include "sysemu/sysemu.h"
diff --git a/migration/qemu-file-buf.c b/migration/qemu-file-buf.c
index 7b8e78e..67e5d78 100644
--- a/migration/qemu-file-buf.c
+++ b/migration/qemu-file-buf.c
@@ -26,7 +26,6 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/iov.h"
 #include "qemu/sockets.h"
diff --git a/migration/qemu-file-stdio.c b/migration/qemu-file-stdio.c
index f402e8f..a9a8929 100644
--- a/migration/qemu-file-stdio.c
+++ b/migration/qemu-file-stdio.c
@@ -22,7 +22,6 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/coroutine.h"
 #include "migration/qemu-file.h"
 
diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index 6f4a129..b80a1dd 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -23,7 +23,6 @@
  */
 #include "qemu/osdep.h"
 #include <zlib.h>
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/iov.h"
 #include "qemu/sockets.h"
diff --git a/migration/tcp.c b/migration/tcp.c
index e1fa7f8..eeddbdc 100644
--- a/migration/tcp.c
+++ b/migration/tcp.c
@@ -15,7 +15,6 @@
 
 #include "qemu/osdep.h"
 
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/sockets.h"
 #include "migration/migration.h"
diff --git a/migration/unix.c b/migration/unix.c
index d9aac36..986a0ad 100644
--- a/migration/unix.c
+++ b/migration/unix.c
@@ -15,7 +15,6 @@
 
 #include "qemu/osdep.h"
 
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/sockets.h"
 #include "qemu/main-loop.h"
diff --git a/migration/vmstate.c b/migration/vmstate.c
index bf3d5db..3c1f7aa 100644
--- a/migration/vmstate.c
+++ b/migration/vmstate.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "migration/migration.h"
 #include "migration/qemu-file.h"
 #include "migration/vmstate.h"
diff --git a/net/checksum.c b/net/checksum.c
index d0fa424..689a584 100644
--- a/net/checksum.c
+++ b/net/checksum.c
@@ -16,7 +16,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "net/checksum.h"
 
 #define PROTO_TCP  6
diff --git a/net/eth.c b/net/eth.c
index 7e32d27..8301e4c 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -18,7 +18,6 @@
 #include "qemu/osdep.h"
 #include "net/eth.h"
 #include "net/checksum.h"
-#include "qemu-common.h"
 #include "net/tap.h"
 
 void eth_setup_vlan_headers(struct eth_header *ehdr, uint16_t vlan_tag,
diff --git a/net/l2tpv3.c b/net/l2tpv3.c
index 824161c..d50de5b 100644
--- a/net/l2tpv3.c
+++ b/net/l2tpv3.c
@@ -28,7 +28,6 @@
 #include <netdb.h>
 #include "net/net.h"
 #include "clients.h"
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/option.h"
 #include "qemu/sockets.h"
diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index 83de19a..b6503b5 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -24,7 +24,6 @@
 
 #include "qemu/osdep.h"
 #include "tap_int.h"
-#include "qemu-common.h"
 #include "sysemu/sysemu.h"
 #include "qemu/error-report.h"
 
diff --git a/net/tap-win32.c b/net/tap-win32.c
index 38bbac0..db591bc 100644
--- a/net/tap-win32.c
+++ b/net/tap-win32.c
@@ -29,7 +29,6 @@
 #include "qemu/osdep.h"
 #include "tap_int.h"
 
-#include "qemu-common.h"
 #include "clients.h"            /* net_init_tap */
 #include "net/net.h"
 #include "net/tap.h"            /* tap_has_ufo, ... */
diff --git a/net/vde.c b/net/vde.c
index 973faf5..0498ed7 100644
--- a/net/vde.c
+++ b/net/vde.c
@@ -27,7 +27,6 @@
 
 #include "net/net.h"
 #include "clients.h"
-#include "qemu-common.h"
 #include "qemu/option.h"
 #include "qemu/main-loop.h"
 
diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
index 6922179..590be89 100644
--- a/qapi/qapi-dealloc-visitor.c
+++ b/qapi/qapi-dealloc-visitor.c
@@ -15,7 +15,6 @@
 #include "qemu/osdep.h"
 #include "qapi/dealloc-visitor.h"
 #include "qemu/queue.h"
-#include "qemu-common.h"
 #include "qapi/qmp/types.h"
 #include "qapi/visitor-impl.h"
 
diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c
index 818730a..8803bed 100644
--- a/qapi/qapi-util.c
+++ b/qapi/qapi-util.c
@@ -12,7 +12,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.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 fa680c9..60ee5cf 100644
--- a/qapi/qapi-visit-core.c
+++ b/qapi/qapi-visit-core.c
@@ -14,7 +14,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qapi/qmp/qobject.h"
 #include "qapi/qmp/qerror.h"
 #include "qapi/visitor.h"
diff --git a/qapi/qmp-event.c b/qapi/qmp-event.c
index 8bba165..1e99af8 100644
--- a/qapi/qmp-event.c
+++ b/qapi/qmp-event.c
@@ -13,7 +13,6 @@
 
 #include "qemu/osdep.h"
 
-#include "qemu-common.h"
 #include "qapi/qmp-event.h"
 #include "qapi/qmp/qstring.h"
 #include "qapi/qmp/qjson.h"
diff --git a/qapi/qmp-input-visitor.c b/qapi/qmp-input-visitor.c
index 7cd1b77..b83bc53 100644
--- a/qapi/qmp-input-visitor.c
+++ b/qapi/qmp-input-visitor.c
@@ -17,7 +17,6 @@
 #include "qapi/qmp-input-visitor.h"
 #include "qapi/visitor-impl.h"
 #include "qemu/queue.h"
-#include "qemu-common.h"
 #include "qapi/qmp/types.h"
 #include "qapi/qmp/qerror.h"
 
diff --git a/qapi/qmp-output-visitor.c b/qapi/qmp-output-visitor.c
index d44c676..257ccc1 100644
--- a/qapi/qmp-output-visitor.c
+++ b/qapi/qmp-output-visitor.c
@@ -16,7 +16,6 @@
 #include "qapi/qmp-output-visitor.h"
 #include "qapi/visitor-impl.h"
 #include "qemu/queue.h"
-#include "qemu-common.h"
 #include "qapi/qmp/types.h"
 
 typedef struct QStackEntry
diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c
index ab12953..0a46c19 100644
--- a/qapi/string-input-visitor.c
+++ b/qapi/string-input-visitor.c
@@ -12,7 +12,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qapi/string-input-visitor.h"
 #include "qapi/visitor-impl.h"
 #include "qapi/qmp/qerror.h"
diff --git a/qapi/string-output-visitor.c b/qapi/string-output-visitor.c
index c2e5c5b..f4183fe 100644
--- a/qapi/string-output-visitor.c
+++ b/qapi/string-output-visitor.c
@@ -11,7 +11,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qapi/string-output-visitor.h"
 #include "qapi/visitor-impl.h"
 #include "qemu/host-utils.h"
diff --git a/qobject/json-lexer.c b/qobject/json-lexer.c
index 496374d..b21ce88 100644
--- a/qobject/json-lexer.c
+++ b/qobject/json-lexer.c
@@ -12,7 +12,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qapi/qmp/json-lexer.h"
 
 #define MAX_TOKEN_SIZE (64ULL << 20)
diff --git a/qobject/json-streamer.c b/qobject/json-streamer.c
index 0251685..a3ebe15 100644
--- a/qobject/json-streamer.c
+++ b/qobject/json-streamer.c
@@ -12,7 +12,6 @@
  */
 
 #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 0606bbd..0f67462 100644
--- a/qobject/qbool.c
+++ b/qobject/qbool.c
@@ -14,7 +14,6 @@
 #include "qemu/osdep.h"
 #include "qapi/qmp/qbool.h"
 #include "qapi/qmp/qobject.h"
-#include "qemu-common.h"
 
 /**
  * qbool_from_bool(): Create a new QBool from a bool
diff --git a/qobject/qfloat.c b/qobject/qfloat.c
index d5da847..3fa0177 100644
--- a/qobject/qfloat.c
+++ b/qobject/qfloat.c
@@ -14,7 +14,6 @@
 #include "qemu/osdep.h"
 #include "qapi/qmp/qfloat.h"
 #include "qapi/qmp/qobject.h"
-#include "qemu-common.h"
 
 /**
  * qfloat_from_int(): Create a new QFloat from a float
diff --git a/qobject/qint.c b/qobject/qint.c
index d7d1b30..fd2ed36 100644
--- a/qobject/qint.c
+++ b/qobject/qint.c
@@ -13,7 +13,6 @@
 #include "qemu/osdep.h"
 #include "qapi/qmp/qint.h"
 #include "qapi/qmp/qobject.h"
-#include "qemu-common.h"
 
 /**
  * qint_from_int(): Create a new QInt from an int64_t
diff --git a/qobject/qlist.c b/qobject/qlist.c
index 1ec74de..226cd32 100644
--- a/qobject/qlist.c
+++ b/qobject/qlist.c
@@ -14,7 +14,6 @@
 #include "qapi/qmp/qlist.h"
 #include "qapi/qmp/qobject.h"
 #include "qemu/queue.h"
-#include "qemu-common.h"
 
 /**
  * qlist_new(): Create a new QList
diff --git a/qobject/qnull.c b/qobject/qnull.c
index c124d05..979722c 100644
--- a/qobject/qnull.c
+++ b/qobject/qnull.c
@@ -11,7 +11,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qapi/qmp/qobject.h"
 
 QObject qnull_ = {
diff --git a/qobject/qobject.c b/qobject/qobject.c
index cd41fb9..5d51e1a 100644
--- a/qobject/qobject.c
+++ b/qobject/qobject.c
@@ -8,7 +8,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qapi/qmp/qbool.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qfloat.h"
diff --git a/qobject/qstring.c b/qobject/qstring.c
index 5da7b5f..fa8dd05 100644
--- a/qobject/qstring.c
+++ b/qobject/qstring.c
@@ -13,7 +13,6 @@
 #include "qemu/osdep.h"
 #include "qapi/qmp/qobject.h"
 #include "qapi/qmp/qstring.h"
-#include "qemu-common.h"
 
 /**
  * qstring_new(): Create a new empty QString
diff --git a/qom/qom-qobject.c b/qom/qom-qobject.c
index e6b17c1..5102ff9 100644
--- a/qom/qom-qobject.c
+++ b/qom/qom-qobject.c
@@ -11,7 +11,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qom/object.h"
 #include "qom/qom-qobject.h"
 #include "qapi/visitor.h"
diff --git a/replay/replay-events.c b/replay/replay-events.c
index 2628109..3cbfe46 100644
--- a/replay/replay-events.c
+++ b/replay/replay-events.c
@@ -10,7 +10,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "sysemu/replay.h"
 #include "replay-internal.h"
diff --git a/replay/replay-input.c b/replay/replay-input.c
index 43afc78..3dfeeb8 100644
--- a/replay/replay-input.c
+++ b/replay/replay-input.c
@@ -11,7 +11,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "sysemu/replay.h"
 #include "replay-internal.h"
 #include "qemu/notify.h"
diff --git a/replay/replay-internal.c b/replay/replay-internal.c
index 5835e8d..edc6dd1 100644
--- a/replay/replay-internal.c
+++ b/replay/replay-internal.c
@@ -10,7 +10,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "sysemu/replay.h"
 #include "replay-internal.h"
 #include "qemu/error-report.h"
diff --git a/replay/replay-time.c b/replay/replay-time.c
index fffe072..5f0e444 100644
--- a/replay/replay-time.c
+++ b/replay/replay-time.c
@@ -10,7 +10,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "sysemu/replay.h"
 #include "replay-internal.h"
 #include "qemu/error-report.h"
diff --git a/stubs/arch-query-cpu-def.c b/stubs/arch-query-cpu-def.c
index cefe4be..d506d54 100644
--- a/stubs/arch-query-cpu-def.c
+++ b/stubs/arch-query-cpu-def.c
@@ -1,5 +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 bf84a1d..41318da 100644
--- a/stubs/bdrv-commit-all.c
+++ b/stubs/bdrv-commit-all.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "block/block.h"
 
 int bdrv_commit_all(void)
diff --git a/stubs/clock-warp.c b/stubs/clock-warp.c
index 5ae32b9..e7496e3 100644
--- a/stubs/clock-warp.c
+++ b/stubs/clock-warp.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/timer.h"
 
 void qemu_clock_warp(QEMUClockType type)
diff --git a/stubs/cpu-get-clock.c b/stubs/cpu-get-clock.c
index 1d07523..5a92810 100644
--- a/stubs/cpu-get-clock.c
+++ b/stubs/cpu-get-clock.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/timer.h"
 
 int64_t cpu_get_clock(void)
diff --git a/stubs/cpu-get-icount.c b/stubs/cpu-get-icount.c
index 3a6f2ab..65f92b7 100644
--- a/stubs/cpu-get-icount.c
+++ b/stubs/cpu-get-icount.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/timer.h"
 
 int use_icount;
diff --git a/stubs/cpus.c b/stubs/cpus.c
index e192722..b414b5a 100644
--- a/stubs/cpus.c
+++ b/stubs/cpus.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qom/cpu.h"
 
 void cpu_resume(CPUState *cpu)
diff --git a/stubs/dump.c b/stubs/dump.c
index d9ee23f..a7bbdd1 100644
--- a/stubs/dump.c
+++ b/stubs/dump.c
@@ -12,7 +12,6 @@
  */
 
 #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 f91aa34..63a4abd 100644
--- a/stubs/fd-register.c
+++ b/stubs/fd-register.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/main-loop.h"
 
 void qemu_fd_register(int fd)
diff --git a/stubs/fdset-add-fd.c b/stubs/fdset-add-fd.c
index bf9e60a..78d0b0b 100644
--- a/stubs/fdset-add-fd.c
+++ b/stubs/fdset-add-fd.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "monitor/monitor.h"
 
 int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd)
diff --git a/stubs/fdset-find-fd.c b/stubs/fdset-find-fd.c
index 1d9caf3..0c6ff73 100644
--- a/stubs/fdset-find-fd.c
+++ b/stubs/fdset-find-fd.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "monitor/monitor.h"
 
 int monitor_fdset_dup_fd_find(int dup_fd)
diff --git a/stubs/fdset-get-fd.c b/stubs/fdset-get-fd.c
index 5325044..82ed37b 100644
--- a/stubs/fdset-get-fd.c
+++ b/stubs/fdset-get-fd.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "monitor/monitor.h"
 
 int monitor_fdset_get_fd(int64_t fdset_id, int flags)
diff --git a/stubs/fdset-remove-fd.c b/stubs/fdset-remove-fd.c
index 47ea297..4046a5c 100644
--- a/stubs/fdset-remove-fd.c
+++ b/stubs/fdset-remove-fd.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "monitor/monitor.h"
 
 void monitor_fdset_dup_fd_remove(int dupfd)
diff --git a/stubs/get-fd.c b/stubs/get-fd.c
index 7dfdfb5..cbec2f3 100644
--- a/stubs/get-fd.c
+++ b/stubs/get-fd.c
@@ -1,6 +1,5 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "monitor/monitor.h"
 
 int monitor_get_fd(Monitor *mon, const char *name, Error **errp)
diff --git a/stubs/get-next-serial.c b/stubs/get-next-serial.c
index 6ff6a6d..b2b5f74 100644
--- a/stubs/get-next-serial.c
+++ b/stubs/get-next-serial.c
@@ -1,4 +1,3 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 
 CharDriverState *serial_hds[0];
diff --git a/stubs/iothread-lock.c b/stubs/iothread-lock.c
index 9b6db2e..853ee23 100644
--- a/stubs/iothread-lock.c
+++ b/stubs/iothread-lock.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/main-loop.h"
 
 bool qemu_mutex_iothread_locked(void)
diff --git a/stubs/is-daemonized.c b/stubs/is-daemonized.c
index d5cd1dc..8f63325 100644
--- a/stubs/is-daemonized.c
+++ b/stubs/is-daemonized.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 
 /* Win32 has its own inline stub */
 #ifndef _WIN32
diff --git a/stubs/kvm.c b/stubs/kvm.c
index ddd6204..bc22625 100644
--- a/stubs/kvm.c
+++ b/stubs/kvm.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "sysemu/kvm.h"
 
 int kvm_arch_irqchip_create(MachineState *ms, KVMState *s)
diff --git a/stubs/machine-init-done.c b/stubs/machine-init-done.c
index 9a0d625..d164ecc 100644
--- a/stubs/machine-init-done.c
+++ b/stubs/machine-init-done.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "sysemu/sysemu.h"
 
 void qemu_add_machine_init_done_notifier(Notifier *notify)
diff --git a/stubs/migr-blocker.c b/stubs/migr-blocker.c
index 8ab3604..98f44e6 100644
--- a/stubs/migr-blocker.c
+++ b/stubs/migr-blocker.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "migration/migration.h"
 
 void migrate_add_blocker(Error *reason)
diff --git a/stubs/mon-is-qmp.c b/stubs/mon-is-qmp.c
index a8344ce..34ac5e5 100644
--- a/stubs/mon-is-qmp.c
+++ b/stubs/mon-is-qmp.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "monitor/monitor.h"
 
 Monitor *cur_mon;
diff --git a/stubs/mon-printf.c b/stubs/mon-printf.c
index e7c1e0c..7968e0f 100644
--- a/stubs/mon-printf.c
+++ b/stubs/mon-printf.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "monitor/monitor.h"
 
 void monitor_printf(Monitor *mon, const char *fmt, ...)
diff --git a/stubs/monitor-init.c b/stubs/monitor-init.c
index de1bc7c..f2e37c0 100644
--- a/stubs/monitor-init.c
+++ b/stubs/monitor-init.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "monitor/monitor.h"
 
 void monitor_init(CharDriverState *chr, int flags)
diff --git a/stubs/notify-event.c b/stubs/notify-event.c
index 14e5226..827bb52 100644
--- a/stubs/notify-event.c
+++ b/stubs/notify-event.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/main-loop.h"
 
 void qemu_notify_event(void)
diff --git a/stubs/set-fd-handler.c b/stubs/set-fd-handler.c
index 26965de..bff7e0a 100644
--- a/stubs/set-fd-handler.c
+++ b/stubs/set-fd-handler.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/main-loop.h"
 
 void qemu_set_fd_handler(int fd,
diff --git a/stubs/slirp.c b/stubs/slirp.c
index dcae51f..f6fecc7 100644
--- a/stubs/slirp.c
+++ b/stubs/slirp.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "slirp/slirp.h"
 
 void slirp_pollfds_fill(GArray *pollfds, uint32_t *timeout)
diff --git a/stubs/uuid.c b/stubs/uuid.c
index 92ad717..d44d02a 100644
--- a/stubs/uuid.c
+++ b/stubs/uuid.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "sysemu/sysemu.h"
 #include "qmp-commands.h"
 
diff --git a/stubs/vm-stop.c b/stubs/vm-stop.c
index 8271cad..68e5f20 100644
--- a/stubs/vm-stop.c
+++ b/stubs/vm-stop.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "sysemu/sysemu.h"
 
 void qemu_system_vmstop_request_prepare(void)
diff --git a/stubs/vmstate.c b/stubs/vmstate.c
index 6590627..f6c8e3f 100644
--- a/stubs/vmstate.c
+++ b/stubs/vmstate.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "migration/vmstate.h"
 
 const VMStateDescription vmstate_dummy = {};
diff --git a/target-arm/kvm-stub.c b/target-arm/kvm-stub.c
index 38bf433..34528b4 100644
--- a/target-arm/kvm-stub.c
+++ b/target-arm/kvm-stub.c
@@ -10,7 +10,6 @@
  *
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "kvm_arm.h"
 
 bool write_kvmstate_to_list(ARMCPU *cpu)
diff --git a/target-arm/kvm.c b/target-arm/kvm.c
index 969ab0b..c4f0b20 100644
--- a/target-arm/kvm.c
+++ b/target-arm/kvm.c
@@ -14,7 +14,6 @@
 
 #include <linux/kvm.h>
 
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "qemu/error-report.h"
 #include "sysemu/sysemu.h"
diff --git a/target-arm/kvm32.c b/target-arm/kvm32.c
index d44a7f9..806d967 100644
--- a/target-arm/kvm32.c
+++ b/target-arm/kvm32.c
@@ -14,7 +14,6 @@
 
 #include <linux/kvm.h>
 
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm.h"
diff --git a/target-arm/kvm64.c b/target-arm/kvm64.c
index e8527bf..9a0ab34 100644
--- a/target-arm/kvm64.c
+++ b/target-arm/kvm64.c
@@ -17,7 +17,6 @@
 #include <linux/elf.h>
 #include <linux/kvm.h>
 
-#include "qemu-common.h"
 #include "qemu/timer.h"
 #include "qemu/error-report.h"
 #include "qemu/host-utils.h"
diff --git a/target-i386/kvm-stub.c b/target-i386/kvm-stub.c
index 8df9c59..da3742c 100644
--- a/target-i386/kvm-stub.c
+++ b/target-i386/kvm-stub.c
@@ -10,7 +10,6 @@
  *
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "kvm_i386.h"
 
 bool kvm_allows_irq0_override(void)
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 940b494..de7fd7b 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -21,7 +21,6 @@
 #include <linux/kvm.h>
 #include <linux/kvm_para.h>
 
-#include "qemu-common.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/kvm_int.h"
 #include "kvm_i386.h"
diff --git a/target-m68k/m68k-semi.c b/target-m68k/m68k-semi.c
index f360ef3..e7d94c5 100644
--- a/target-m68k/m68k-semi.c
+++ b/target-m68k/m68k-semi.c
@@ -24,7 +24,6 @@
 #include "qemu.h"
 #define SEMIHOSTING_HEAP_SIZE (128 * 1024 * 1024)
 #else
-#include "qemu-common.h"
 #include "exec/gdbstub.h"
 #include "exec/softmmu-semi.h"
 #endif
diff --git a/target-mips/kvm.c b/target-mips/kvm.c
index 950bc05..1f37312 100644
--- a/target-mips/kvm.c
+++ b/target-mips/kvm.c
@@ -15,7 +15,6 @@
 
 #include <linux/kvm.h>
 
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
diff --git a/target-openrisc/interrupt.c b/target-openrisc/interrupt.c
index 963eb14..bac8f25 100644
--- a/target-openrisc/interrupt.c
+++ b/target-openrisc/interrupt.c
@@ -19,7 +19,6 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
-#include "qemu-common.h"
 #include "exec/gdbstub.h"
 #include "qemu/host-utils.h"
 #ifndef CONFIG_USER_ONLY
diff --git a/target-openrisc/mmu.c b/target-openrisc/mmu.c
index 4ab414a..2f14e8c 100644
--- a/target-openrisc/mmu.c
+++ b/target-openrisc/mmu.c
@@ -20,7 +20,6 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
-#include "qemu-common.h"
 #include "exec/gdbstub.h"
 #include "qemu/host-utils.h"
 #ifndef CONFIG_USER_ONLY
diff --git a/target-openrisc/translate.c b/target-openrisc/translate.c
index 5d0ab44..6085d39 100644
--- a/target-openrisc/translate.c
+++ b/target-openrisc/translate.c
@@ -23,7 +23,6 @@
 #include "exec/exec-all.h"
 #include "disas/disas.h"
 #include "tcg-op.h"
-#include "qemu-common.h"
 #include "qemu/log.h"
 #include "qemu/bitops.h"
 #include "exec/cpu_ldst.h"
diff --git a/target-ppc/kvm-stub.c b/target-ppc/kvm-stub.c
index 627bcb4..85ed3a6 100644
--- a/target-ppc/kvm-stub.c
+++ b/target-ppc/kvm-stub.c
@@ -10,7 +10,6 @@
  *
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "hw/ppc/openpic.h"
 
 int kvm_openpic_connect_vcpu(DeviceState *d, CPUState *cs)
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index d67c169..9959f06 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -22,7 +22,6 @@
 
 #include <linux/kvm.h>
 
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index e1859ca..fafdb7d 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -28,7 +28,6 @@
 #include <linux/kvm.h>
 #include <asm/ptrace.h>
 
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "sysemu/sysemu.h"
diff --git a/target-tilegx/helper.c b/target-tilegx/helper.c
index 616c5c7..2ab94e1 100644
--- a/target-tilegx/helper.c
+++ b/target-tilegx/helper.c
@@ -20,7 +20,6 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
-#include "qemu-common.h"
 #include "exec/helper-proto.h"
 #include <zlib.h> /* For crc32 */
 #include "syscall_defs.h"
diff --git a/target-tilegx/simd_helper.c b/target-tilegx/simd_helper.c
index 2d40ddb..0fdfad2 100644
--- a/target-tilegx/simd_helper.c
+++ b/target-tilegx/simd_helper.c
@@ -20,7 +20,6 @@
 
 #include "qemu/osdep.h"
 #include "cpu.h"
-#include "qemu-common.h"
 #include "exec/helper-proto.h"
 
 
diff --git a/target-xtensa/core-dc233c.c b/target-xtensa/core-dc233c.c
index 40475e5..45eb3a2 100644
--- a/target-xtensa/core-dc233c.c
+++ b/target-xtensa/core-dc233c.c
@@ -29,7 +29,6 @@
 #include "cpu.h"
 #include "exec/exec-all.h"
 #include "exec/gdbstub.h"
-#include "qemu-common.h"
 #include "qemu/host-utils.h"
 
 #include "core-dc233c/core-isa.h"
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 6d68f57..3fb2477 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -26,7 +26,6 @@
 #include "qemu/osdep.h"
 
 
-#include "qemu-common.h"
 #include "tcg-op.h"
 
 #define CASE_OP_32_64(x)                        \
diff --git a/tci.c b/tci.c
index 7cbb39e..fd10d7f 100644
--- a/tci.c
+++ b/tci.c
@@ -24,7 +24,6 @@
 # define NDEBUG
 #endif
 
-#include "qemu-common.h"
 #include "exec/exec-all.h"           /* MAX_OPC_PARAM_IARGS */
 #include "exec/cpu_ldst.h"
 #include "tcg-op.h"
diff --git a/tests/ahci-test.c b/tests/ahci-test.c
index 6869f7f..20d1d23 100644
--- a/tests/ahci-test.c
+++ b/tests/ahci-test.c
@@ -31,7 +31,6 @@
 #include "libqos/ahci.h"
 #include "libqos/pci-pc.h"
 
-#include "qemu-common.h"
 #include "qemu/host-utils.h"
 
 #include "hw/pci/pci_ids.h"
diff --git a/tests/boot-sector.c b/tests/boot-sector.c
index 3ffe298..6cefca9 100644
--- a/tests/boot-sector.c
+++ b/tests/boot-sector.c
@@ -12,7 +12,6 @@
  */
 #include "qemu/osdep.h"
 #include "boot-sector.h"
-#include "qemu-common.h"
 #include "libqtest.h"
 
 #define LOW(x) ((x) & 0xff)
diff --git a/tests/check-qdict.c b/tests/check-qdict.c
index a43056c..88af30f 100644
--- a/tests/check-qdict.c
+++ b/tests/check-qdict.c
@@ -15,7 +15,6 @@
 #include "qapi/qmp/qint.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qstring.h"
-#include "qemu-common.h"
 
 /*
  * Public Interface test-cases
diff --git a/tests/check-qfloat.c b/tests/check-qfloat.c
index 3102608..f0b825d 100644
--- a/tests/check-qfloat.c
+++ b/tests/check-qfloat.c
@@ -14,7 +14,6 @@
 #include <glib.h>
 
 #include "qapi/qmp/qfloat.h"
-#include "qemu-common.h"
 
 /*
  * Public Interface test-cases
diff --git a/tests/check-qint.c b/tests/check-qint.c
index c86f7df..fc77f44 100644
--- a/tests/check-qint.c
+++ b/tests/check-qint.c
@@ -13,7 +13,6 @@
 #include <glib.h>
 
 #include "qapi/qmp/qint.h"
-#include "qemu-common.h"
 
 /*
  * Public Interface test-cases
diff --git a/tests/check-qjson.c b/tests/check-qjson.c
index 99de6f5..e4b1c15 100644
--- a/tests/check-qjson.c
+++ b/tests/check-qjson.c
@@ -21,7 +21,6 @@
 #include "qapi/qmp/qbool.h"
 #include "qapi/qmp/qjson.h"
 
-#include "qemu-common.h"
 
 static void escaped_string(void)
 {
diff --git a/tests/check-qstring.c b/tests/check-qstring.c
index 9877b42..5a24a7e 100644
--- a/tests/check-qstring.c
+++ b/tests/check-qstring.c
@@ -13,7 +13,6 @@
 #include <glib.h>
 
 #include "qapi/qmp/qstring.h"
-#include "qemu-common.h"
 
 /*
  * Public Interface test-cases
diff --git a/tests/device-introspect-test.c b/tests/device-introspect-test.c
index 4477926..65f8d30 100644
--- a/tests/device-introspect-test.c
+++ b/tests/device-introspect-test.c
@@ -19,7 +19,6 @@
 
 #include "qemu/osdep.h"
 #include <glib.h>
-#include "qemu-common.h"
 #include "qapi/qmp/qstring.h"
 #include "libqtest.h"
 
diff --git a/tests/fdc-test.c b/tests/fdc-test.c
index 53df1d0..634bdf0 100644
--- a/tests/fdc-test.c
+++ b/tests/fdc-test.c
@@ -27,7 +27,6 @@
 #include <glib.h>
 
 #include "libqtest.h"
-#include "qemu-common.h"
 
 #define TEST_IMAGE_SIZE 1440 * 1024
 
diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c
index c8e669a..ddc40ef 100644
--- a/tests/hd-geo-test.c
+++ b/tests/hd-geo-test.c
@@ -17,7 +17,6 @@
 
 #include "qemu/osdep.h"
 #include <glib.h>
-#include "qemu-common.h"
 #include "libqtest.h"
 
 static char *create_test_img(int secs)
diff --git a/tests/ipmi-bt-test.c b/tests/ipmi-bt-test.c
index 812907f..c574957 100644
--- a/tests/ipmi-bt-test.c
+++ b/tests/ipmi-bt-test.c
@@ -32,7 +32,6 @@
 #include <glib.h>
 
 #include "libqtest.h"
-#include "qemu-common.h"
 
 #define IPMI_IRQ        5
 
diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c
index ac6c155..f16c9f9 100644
--- a/tests/libqos/ahci.c
+++ b/tests/libqos/ahci.c
@@ -29,7 +29,6 @@
 #include "libqos/ahci.h"
 #include "libqos/pci-pc.h"
 
-#include "qemu-common.h"
 #include "qemu/host-utils.h"
 
 #include "hw/pci/pci_ids.h"
diff --git a/tests/libqos/malloc-pc.c b/tests/libqos/malloc-pc.c
index eee706b..d4ebfb3 100644
--- a/tests/libqos/malloc-pc.c
+++ b/tests/libqos/malloc-pc.c
@@ -16,7 +16,6 @@
 
 #include "hw/nvram/fw_cfg_keys.h"
 
-#include "qemu-common.h"
 #include <glib.h>
 
 #define PAGE_SIZE (4096)
diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c
index 08167c0..ac976d5 100644
--- a/tests/libqos/pci-pc.c
+++ b/tests/libqos/pci-pc.c
@@ -16,7 +16,6 @@
 
 #include "hw/pci/pci_regs.h"
 
-#include "qemu-common.h"
 #include "qemu/host-utils.h"
 
 #include <glib.h>
diff --git a/tests/pc-cpu-test.c b/tests/pc-cpu-test.c
index 6b34ca5..cc0ce31 100644
--- a/tests/pc-cpu-test.c
+++ b/tests/pc-cpu-test.c
@@ -10,7 +10,6 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 
-#include "qemu-common.h"
 #include "libqtest.h"
 #include "qapi/qmp/types.h"
 
diff --git a/tests/pxe-test.c b/tests/pxe-test.c
index 875e4c4..7d2086e 100644
--- a/tests/pxe-test.c
+++ b/tests/pxe-test.c
@@ -14,7 +14,6 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 #include <glib/gstdio.h>
-#include "qemu-common.h"
 #include "libqtest.h"
 #include "boot-sector.h"
 
diff --git a/tests/rtl8139-test.c b/tests/rtl8139-test.c
index 54e5aa7..591bdb1 100644
--- a/tests/rtl8139-test.c
+++ b/tests/rtl8139-test.c
@@ -12,7 +12,6 @@
 #include "libqtest.h"
 #include "libqos/pci-pc.h"
 #include "qemu/timer.h"
-#include "qemu-common.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
diff --git a/tests/test-iov.c b/tests/test-iov.c
index 3f25268..197fd4b 100644
--- a/tests/test-iov.c
+++ b/tests/test-iov.c
@@ -1,6 +1,5 @@
 #include "qemu/osdep.h"
 #include <glib.h>
-#include "qemu-common.h"
 #include "qemu/iov.h"
 #include "qemu/sockets.h"
 
diff --git a/tests/test-qmp-commands.c b/tests/test-qmp-commands.c
index d6171f2..e8696ef 100644
--- a/tests/test-qmp-commands.c
+++ b/tests/test-qmp-commands.c
@@ -1,6 +1,5 @@
 #include "qemu/osdep.h"
 #include <glib.h>
-#include "qemu-common.h"
 #include "qapi/qmp/types.h"
 #include "test-qmp-commands.h"
 #include "qapi/qmp/dispatch.h"
diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c
index a296fdb..776cb7d 100644
--- a/tests/test-qmp-event.c
+++ b/tests/test-qmp-event.c
@@ -14,7 +14,6 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 
-#include "qemu-common.h"
 #include "test-qapi-types.h"
 #include "test-qapi-visit.h"
 #include "test-qapi-event.h"
diff --git a/tests/test-qmp-input-strict.c b/tests/test-qmp-input-strict.c
index d71727e..3d524db 100644
--- a/tests/test-qmp-input-strict.c
+++ b/tests/test-qmp-input-strict.c
@@ -14,7 +14,6 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 
-#include "qemu-common.h"
 #include "qapi/error.h"
 #include "qapi/qmp-input-visitor.h"
 #include "test-qapi-types.h"
diff --git a/tests/test-qmp-input-visitor.c b/tests/test-qmp-input-visitor.c
index dd247ea..fd80f39 100644
--- a/tests/test-qmp-input-visitor.c
+++ b/tests/test-qmp-input-visitor.c
@@ -13,7 +13,6 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 
-#include "qemu-common.h"
 #include "qapi/error.h"
 #include "qapi/qmp-input-visitor.h"
 #include "test-qapi-types.h"
diff --git a/tests/test-qmp-output-visitor.c b/tests/test-qmp-output-visitor.c
index f211b21..738c527 100644
--- a/tests/test-qmp-output-visitor.c
+++ b/tests/test-qmp-output-visitor.c
@@ -13,7 +13,6 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 
-#include "qemu-common.h"
 #include "qapi/error.h"
 #include "qapi/qmp-output-visitor.h"
 #include "test-qapi-types.h"
diff --git a/tests/test-string-input-visitor.c b/tests/test-string-input-visitor.c
index 9e6906a..0f701b4 100644
--- a/tests/test-string-input-visitor.c
+++ b/tests/test-string-input-visitor.c
@@ -13,7 +13,6 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 
-#include "qemu-common.h"
 #include "qapi/error.h"
 #include "qapi/string-input-visitor.h"
 #include "test-qapi-types.h"
diff --git a/tests/test-string-output-visitor.c b/tests/test-string-output-visitor.c
index 1ecd75b..3f21050 100644
--- a/tests/test-string-output-visitor.c
+++ b/tests/test-string-output-visitor.c
@@ -13,7 +13,6 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 
-#include "qemu-common.h"
 #include "qapi/error.h"
 #include "qapi/string-output-visitor.h"
 #include "test-qapi-types.h"
diff --git a/tests/test-thread-pool.c b/tests/test-thread-pool.c
index 88dc731..09f6e60 100644
--- a/tests/test-thread-pool.c
+++ b/tests/test-thread-pool.c
@@ -1,6 +1,5 @@
 #include "qemu/osdep.h"
 #include <glib.h>
-#include "qemu-common.h"
 #include "block/aio.h"
 #include "block/thread-pool.h"
 #include "block/block.h"
diff --git a/tests/test-visitor-serialization.c b/tests/test-visitor-serialization.c
index 9adbc30..b64a2b2 100644
--- a/tests/test-visitor-serialization.c
+++ b/tests/test-visitor-serialization.c
@@ -15,7 +15,6 @@
 #include <glib.h>
 #include <float.h>
 
-#include "qemu-common.h"
 #include "test-qapi-types.h"
 #include "test-qapi-visit.h"
 #include "qapi/error.h"
diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c
index 713d444..c13a67b 100644
--- a/tests/test-vmstate.c
+++ b/tests/test-vmstate.c
@@ -25,7 +25,6 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 
-#include "qemu-common.h"
 #include "migration/migration.h"
 #include "migration/vmstate.h"
 #include "qemu/coroutine.h"
diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c
index 59d0f1f..fe29019 100644
--- a/tests/virtio-9p-test.c
+++ b/tests/virtio-9p-test.c
@@ -10,7 +10,6 @@
 #include "qemu/osdep.h"
 #include <glib.h>
 #include "libqtest.h"
-#include "qemu-common.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void pci_nop(void)
diff --git a/thread-pool.c b/thread-pool.c
index 03ba0b0..8258e14 100644
--- a/thread-pool.c
+++ b/thread-pool.c
@@ -15,7 +15,6 @@
  * 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/coroutine.h"
diff --git a/ui/console-gl.c b/ui/console-gl.c
index 74b1bed..f8b84ff 100644
--- a/ui/console-gl.c
+++ b/ui/console-gl.c
@@ -25,7 +25,6 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "ui/console.h"
 #include "ui/shader.h"
 
diff --git a/ui/curses.c b/ui/curses.c
index b475589..12d048d 100644
--- a/ui/curses.c
+++ b/ui/curses.c
@@ -29,7 +29,6 @@
 #include <termios.h>
 #endif
 
-#include "qemu-common.h"
 #include "ui/console.h"
 #include "ui/input.h"
 #include "sysemu/sysemu.h"
diff --git a/ui/cursor.c b/ui/cursor.c
index a276e01..ad5494d 100644
--- a/ui/cursor.c
+++ b/ui/cursor.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "ui/console.h"
 
 #include "cursor_hidden.xpm"
diff --git a/ui/egl-context.c b/ui/egl-context.c
index 3a02b68..aa35194 100644
--- a/ui/egl-context.c
+++ b/ui/egl-context.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "ui/egl-context.h"
 
 QEMUGLContext qemu_egl_create_context(DisplayChangeListener *dcl,
diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c
index 431457c..cdb338c 100644
--- a/ui/gtk-egl.c
+++ b/ui/gtk-egl.c
@@ -12,7 +12,6 @@
  */
 
 #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 b86ff3c..32b4077 100644
--- a/ui/gtk-gl-area.c
+++ b/ui/gtk-gl-area.c
@@ -8,7 +8,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 
 #include "trace.h"
 
diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c
index c9f8dce..285141b 100644
--- a/ui/qemu-pixman.c
+++ b/ui/qemu-pixman.c
@@ -4,7 +4,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "ui/console.h"
 
 PixelFormat qemu_pixelformat_from_pixman(pixman_format_code_t format)
diff --git a/ui/sdl2-2d.c b/ui/sdl2-2d.c
index 9593006..b560932 100644
--- a/ui/sdl2-2d.c
+++ b/ui/sdl2-2d.c
@@ -24,7 +24,6 @@
 /* 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"
 #include "ui/sdl2.h"
diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c
index a324eca..d2b34ca 100644
--- a/ui/sdl2-gl.c
+++ b/ui/sdl2-gl.c
@@ -26,7 +26,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "ui/console.h"
 #include "ui/input.h"
 #include "ui/sdl2.h"
diff --git a/ui/sdl2-input.c b/ui/sdl2-input.c
index 6e315ae..67b858d 100644
--- a/ui/sdl2-input.c
+++ b/ui/sdl2-input.c
@@ -24,7 +24,6 @@
 /* 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"
 #include "ui/sdl2.h"
diff --git a/ui/sdl2.c b/ui/sdl2.c
index d042442..65a1f18 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -24,7 +24,6 @@
 /* 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"
 #include "ui/sdl2.h"
diff --git a/ui/shader.c b/ui/shader.c
index 9264009..ef53c25 100644
--- a/ui/shader.c
+++ b/ui/shader.c
@@ -25,7 +25,6 @@
  * 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 a68a665..e538911 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -21,7 +21,6 @@
 #include <netdb.h>
 #include "sysemu/sysemu.h"
 
-#include "qemu-common.h"
 #include "ui/qemu-spice.h"
 #include "qemu/error-report.h"
 #include "qemu/thread.h"
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 242ab5f..3c78869 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -16,7 +16,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "ui/qemu-spice.h"
 #include "qemu/timer.h"
 #include "qemu/queue.h"
diff --git a/ui/spice-input.c b/ui/spice-input.c
index 8eeebdb..558134f 100644
--- a/ui/spice-input.c
+++ b/ui/spice-input.c
@@ -20,7 +20,6 @@
 #include <spice.h>
 #include <spice/enums.h>
 
-#include "qemu-common.h"
 #include "ui/qemu-spice.h"
 #include "ui/console.h"
 #include "ui/keymaps.h"
diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
index e5cba0e..e92f714 100644
--- a/ui/vnc-enc-tight.c
+++ b/ui/vnc-enc-tight.c
@@ -31,7 +31,6 @@
 /* This needs to be before jpeglib.h line because of conflict with
    INT32 definitions between jmorecfg.h (included by jpeglib.h) and
    Win32 basetsd.h (included by windows.h). */
-#include "qemu-common.h"
 
 #ifdef CONFIG_VNC_PNG
 /* The following define is needed by pngconf.h. Otherwise it won't compile,
diff --git a/ui/x_keymap.c b/ui/x_keymap.c
index 2788485..db75d35 100644
--- a/ui/x_keymap.c
+++ b/ui/x_keymap.c
@@ -22,7 +22,6 @@
  * THE SOFTWARE.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "x_keymap.h"
 
 static const uint8_t x_keycode_to_pc_keycode[115] = {
diff --git a/util/acl.c b/util/acl.c
index 723b6a8..e02c9e3 100644
--- a/util/acl.c
+++ b/util/acl.c
@@ -24,7 +24,6 @@
 
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/acl.h"
 
 #ifdef CONFIG_FNMATCH
diff --git a/util/compatfd.c b/util/compatfd.c
index 9a43042..1cd58eb 100644
--- a/util/compatfd.c
+++ b/util/compatfd.c
@@ -14,7 +14,6 @@
  */
 
 #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 fb697eb..09ce7a8 100644
--- a/util/coroutine-gthread.c
+++ b/util/coroutine-gthread.c
@@ -20,7 +20,6 @@
 
 #include "qemu/osdep.h"
 #include <glib.h>
-#include "qemu-common.h"
 #include "qemu/coroutine_int.h"
 
 typedef struct {
diff --git a/util/coroutine-sigaltstack.c b/util/coroutine-sigaltstack.c
index 6b8aee7..126791b 100644
--- a/util/coroutine-sigaltstack.c
+++ b/util/coroutine-sigaltstack.c
@@ -28,7 +28,6 @@
 #include "qemu/osdep.h"
 #include <setjmp.h>
 #include <pthread.h>
-#include "qemu-common.h"
 #include "qemu/coroutine_int.h"
 
 typedef struct {
diff --git a/util/coroutine-ucontext.c b/util/coroutine-ucontext.c
index 4914f60..b9f5e6d 100644
--- a/util/coroutine-ucontext.c
+++ b/util/coroutine-ucontext.c
@@ -25,7 +25,6 @@
 #include "qemu/osdep.h"
 #include <setjmp.h>
 #include <ucontext.h>
-#include "qemu-common.h"
 #include "qemu/coroutine_int.h"
 
 #ifdef CONFIG_VALGRIND_H
diff --git a/util/coroutine-win32.c b/util/coroutine-win32.c
index 02e28e8..4770dda 100644
--- a/util/coroutine-win32.c
+++ b/util/coroutine-win32.c
@@ -23,7 +23,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/coroutine_int.h"
 
 typedef struct
diff --git a/util/crc32c.c b/util/crc32c.c
index 7e99555..762657d 100644
--- a/util/crc32c.c
+++ b/util/crc32c.c
@@ -26,7 +26,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/crc32c.h"
 
 /*
diff --git a/util/envlist.c b/util/envlist.c
index e86857e..e4a2d7d 100644
--- a/util/envlist.c
+++ b/util/envlist.c
@@ -1,5 +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 35b5882..7102901 100644
--- a/util/error.c
+++ b/util/error.c
@@ -14,7 +14,6 @@
 
 #include "qemu/osdep.h"
 #include "qapi/error.h"
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 
 struct Error
diff --git a/util/event_notifier-win32.c b/util/event_notifier-win32.c
index 14b4f7d..7ce54b9 100644
--- a/util/event_notifier-win32.c
+++ b/util/event_notifier-win32.c
@@ -11,7 +11,6 @@
  */
 
 #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 5c64101..94a362c 100644
--- a/util/fifo8.c
+++ b/util/fifo8.c
@@ -13,7 +13,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/fifo8.h"
 
 void fifo8_create(Fifo8 *fifo, uint32_t capacity)
diff --git a/util/getauxval.c b/util/getauxval.c
index 0b3bae2..36afdfb 100644
--- a/util/getauxval.c
+++ b/util/getauxval.c
@@ -23,7 +23,6 @@
  */
 
 #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/log.c b/util/log.c
index 8b921de..f718295 100644
--- a/util/log.c
+++ b/util/log.c
@@ -18,7 +18,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/log.h"
 #include "trace/control.h"
 
diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
index a4ae464..0d71ba0 100644
--- a/util/mmap-alloc.c
+++ b/util/mmap-alloc.c
@@ -13,7 +13,6 @@
 #include "qemu/osdep.h"
 #include <qemu/mmap-alloc.h>
 #include <sys/mman.h>
-#include "qemu-common.h"
 
 #define HUGETLBFS_MAGIC       0x958458f6
 
diff --git a/util/module.c b/util/module.c
index ce058ae..22d9a85 100644
--- a/util/module.c
+++ b/util/module.c
@@ -14,7 +14,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #ifdef CONFIG_MODULES
 #include <gmodule.h>
 #endif
diff --git a/util/notify.c b/util/notify.c
index 06de63a..aee8d93 100644
--- a/util/notify.c
+++ b/util/notify.c
@@ -14,7 +14,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/notify.h"
 
 void notifier_list_init(NotifierList *list)
diff --git a/util/qemu-config.c b/util/qemu-config.c
index fb97307..71a9079 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -1,5 +1,4 @@
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/error-report.h"
 #include "qemu/option.h"
 #include "qemu/config-file.h"
diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c
index da37ca7..cb6b931 100644
--- a/util/qemu-coroutine-lock.c
+++ b/util/qemu-coroutine-lock.c
@@ -23,7 +23,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/coroutine.h"
 #include "qemu/coroutine_int.h"
 #include "qemu/queue.h"
diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c
index 5816702..18d7b67 100644
--- a/util/qemu-coroutine.c
+++ b/util/qemu-coroutine.c
@@ -14,7 +14,6 @@
 
 #include "qemu/osdep.h"
 #include "trace.h"
-#include "qemu-common.h"
 #include "qemu/thread.h"
 #include "qemu/atomic.h"
 #include "qemu/coroutine.h"
diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c
index 98a5ddf..5ef73aa 100644
--- a/util/qemu-thread-win32.c
+++ b/util/qemu-thread-win32.c
@@ -11,7 +11,6 @@
  *
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/thread.h"
 #include "qemu/notify.h"
 #include <process.h>
diff --git a/util/rcu.c b/util/rcu.c
index bceb3e4..f010b41 100644
--- a/util/rcu.c
+++ b/util/rcu.c
@@ -27,7 +27,6 @@
  */
 
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/rcu.h"
 #include "qemu/atomic.h"
 #include "qemu/thread.h"
-- 
2.4.3

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

* Re: [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h
  2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
                   ` (14 preceding siblings ...)
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 15/15] Drop superfluous qemu-common.h inclusions Markus Armbruster
@ 2016-03-15 15:30 ` Paolo Bonzini
  2016-03-18  8:47   ` Markus Armbruster
  15 siblings, 1 reply; 33+ messages in thread
From: Paolo Bonzini @ 2016-03-15 15:30 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: peter.maydell



On 15/03/2016 16:03, Markus Armbruster wrote:
> This series tackles two issues:
> 
> * qapi/error.h and therefore qapi-types.h get included into every file
>   via qemu/osdep.h.  Touch the QAPI schema, recompile the world.  As
>   the QAPI maintainer, I get to touch it regularly, so this is an itch
>   I need to scratch.  PATCH 01-04 drop qapi/error.h from qemu/osdep.h.
>   Unfortunately, the number of .o depending on qapi-types.h barely
>   changes, because it gets included by so many other headers.  More
>   work is needed here.
> 
> * qemu-common.h explicitly asks not to be included in headers, but we
>   do it anyway.  PATCH 05-15 clean that up.  Cuts the number of .o
>   depending on qemu-common.h from ~95% to ~35%.
> 
> For additional motivation, see the "Our use of #include is
> undisciplined, and what to do about it" thread.

Patches 1-13 and possibly 15 are great.

For patch 14 I am worried that some of the additions of cpu.h make
things a bit harder for my series.  Any tree that I can pull from to
check myself?

Paolo

> Markus Armbruster (15):
>   include/qemu/osdep.h: Don't include qapi/error.h
>   Use scripts/clean-includes to drop redundant qemu/typedefs.h
>   include/config.h: Unused, remove
>   Clean up includes some more
>   fw_cfg: Split fw_cfg_keys.h off fw_cfg.h
>   include/qemu/iov.h: Don't include qemu-common.h
>   include/hw/hw.h: Don't include qemu-common.h
>   hw/pci/pci.h: Don't include qemu-common.h
>   Move HOST_LONG_BITS from qemu-common.h to qemu/osdep.h
>   Move QEMU_ALIGN_*() from qemu-common.h to qemu/osdep.h
>   Move ParallelIOArg from qemu-common.h to sysemu/char.h
>   isa: Move DMA_transfer_handler from qemu-common.h to hw/isa/isa.h
>   include/crypto: Include qapi-types.h instead of qemu-common.h
>   Don't include qemu-common.h in headers
>   Drop superfluous qemu-common.h inclusions
> 
>  aio-posix.c                              |  1 -
>  aio-win32.c                              |  1 -
>  arch_init.c                              |  2 +
>  async.c                                  |  2 +-
>  audio/alsaaudio.c                        |  1 -
>  audio/audio.c                            |  2 +
>  audio/audio_pt_int.c                     |  1 -
>  audio/audio_win_int.c                    |  1 -
>  audio/coreaudio.c                        |  1 -
>  audio/dsoundaudio.c                      |  1 -
>  audio/noaudio.c                          |  1 -
>  audio/ossaudio.c                         |  1 -
>  audio/paaudio.c                          |  1 -
>  audio/sdlaudio.c                         |  1 -
>  backends/baum.c                          |  2 +-
>  backends/hostmem-file.c                  |  1 +
>  backends/hostmem-ram.c                   |  3 ++
>  backends/hostmem.c                       |  1 +
>  backends/rng-egd.c                       |  1 +
>  backends/rng-random.c                    |  2 +
>  backends/rng.c                           |  2 +
>  backends/tpm.c                           |  2 +
>  block/archipelago.c                      |  1 -
>  block/backup.c                           |  3 +-
>  block/blkdebug.c                         |  1 +
>  block/blkverify.c                        |  2 +
>  block/block-backend.c                    |  1 +
>  block/bochs.c                            |  2 +-
>  block/cloop.c                            |  2 +-
>  block/commit.c                           |  1 +
>  block/curl.c                             |  1 +
>  block/dmg.c                              |  2 +-
>  block/gluster.c                          |  3 ++
>  block/io.c                               |  2 +
>  block/linux-aio.c                        |  1 -
>  block/mirror.c                           |  1 +
>  block/nbd-client.h                       |  1 -
>  block/nbd.c                              |  2 +
>  block/nfs.c                              |  1 -
>  block/null.c                             |  2 +
>  block/parallels.c                        |  2 +-
>  block/qapi.c                             |  1 +
>  block/qcow.c                             |  2 +-
>  block/qcow2-cache.c                      |  1 -
>  block/qcow2-cluster.c                    |  2 +-
>  block/qcow2-refcount.c                   |  2 +-
>  block/qcow2-snapshot.c                   |  1 +
>  block/qed.c                              |  2 +
>  block/quorum.c                           |  1 +
>  block/raw-aio.h                          |  2 +
>  block/raw-posix.c                        |  1 +
>  block/raw-win32.c                        |  1 -
>  block/raw_bsd.c                          |  2 +
>  block/rbd.c                              |  1 +
>  block/sheepdog.c                         |  1 +
>  block/snapshot.c                         |  1 +
>  block/ssh.c                              |  4 +-
>  block/stream.c                           |  1 +
>  block/throttle-groups.c                  |  1 +
>  block/vdi.c                              |  1 +
>  block/vhdx-endian.c                      |  1 -
>  block/vhdx-log.c                         |  2 +-
>  block/vhdx.c                             |  2 +-
>  block/vmdk.c                             |  1 +
>  block/vpc.c                              |  2 +-
>  block/vvfat.c                            |  1 +
>  block/win32-aio.c                        |  1 -
>  blockdev.c                               |  1 +
>  blockjob.c                               |  1 -
>  bootdevice.c                             |  1 +
>  bsd-user/main.c                          |  1 -
>  bsd-user/mmap.c                          |  1 -
>  bsd-user/syscall.c                       |  1 -
>  bt-vhci.c                                |  1 -
>  contrib/ivshmem-client/ivshmem-client.c  |  1 -
>  contrib/ivshmem-client/main.c            |  1 -
>  contrib/ivshmem-server/main.c            |  1 +
>  cpu-exec.c                               |  1 +
>  cpus.c                                   |  3 +-
>  cputlb.c                                 |  1 +
>  crypto/aes.c                             |  1 -
>  crypto/cipher.c                          |  1 +
>  crypto/hash.c                            |  1 +
>  crypto/init.c                            |  1 +
>  crypto/secret.c                          |  2 +
>  crypto/tlscreds.c                        |  2 +
>  crypto/tlscredsanon.c                    |  2 +
>  crypto/tlscredsx509.c                    |  2 +
>  crypto/tlssession.c                      |  1 +
>  device_tree.c                            |  2 +-
>  disas.c                                  |  1 -
>  disas/cris.c                             |  1 -
>  disas/s390.c                             |  1 -
>  disas/tci.c                              |  1 -
>  exec.c                                   |  1 +
>  fsdev/qemu-fsdev.c                       |  1 -
>  fsdev/virtfs-proxy-helper.c              |  1 -
>  gdbstub.c                                |  1 +
>  hmp.c                                    |  1 +
>  hmp.h                                    |  1 -
>  hw/9pfs/9p-handle.c                      |  1 +
>  hw/9pfs/9p-local.c                       |  1 +
>  hw/9pfs/9p-proxy.c                       |  1 +
>  hw/9pfs/9p-synth.c                       |  1 +
>  hw/9pfs/9p.c                             |  1 +
>  hw/9pfs/coth.c                           |  1 -
>  hw/acpi/bios-linker-loader.c             |  1 -
>  hw/acpi/cpu_hotplug.c                    |  1 +
>  hw/acpi/ich9.c                           |  1 +
>  hw/acpi/pcihp.c                          |  1 +
>  hw/acpi/piix4.c                          |  1 +
>  hw/acpi/tco.c                            |  1 -
>  hw/alpha/dp264.c                         |  1 +
>  hw/alpha/typhoon.c                       |  1 +
>  hw/arm/allwinner-a10.c                   |  1 +
>  hw/arm/armv7m.c                          |  1 +
>  hw/arm/bcm2835_peripherals.c             |  1 +
>  hw/arm/bcm2836.c                         |  1 +
>  hw/arm/boot.c                            |  2 +
>  hw/arm/cubieboard.c                      |  1 +
>  hw/arm/digic.c                           |  1 +
>  hw/arm/digic_boards.c                    |  2 +
>  hw/arm/exynos4210.c                      |  1 +
>  hw/arm/fsl-imx25.c                       |  1 +
>  hw/arm/fsl-imx31.c                       |  1 +
>  hw/arm/highbank.c                        |  2 +
>  hw/arm/imx25_pdk.c                       |  1 +
>  hw/arm/integratorcp.c                    |  1 +
>  hw/arm/kzm.c                             |  1 +
>  hw/arm/mainstone.c                       |  1 +
>  hw/arm/musicpal.c                        |  1 +
>  hw/arm/netduino2.c                       |  1 +
>  hw/arm/nseries.c                         |  1 +
>  hw/arm/omap1.c                           |  2 +
>  hw/arm/omap2.c                           |  1 +
>  hw/arm/omap_sx1.c                        |  1 +
>  hw/arm/palm.c                            |  1 +
>  hw/arm/pxa2xx.c                          |  2 +
>  hw/arm/raspi.c                           |  1 +
>  hw/arm/realview.c                        |  1 +
>  hw/arm/spitz.c                           |  1 +
>  hw/arm/stellaris.c                       |  1 +
>  hw/arm/stm32f205_soc.c                   |  1 +
>  hw/arm/strongarm.c                       |  1 +
>  hw/arm/sysbus-fdt.c                      |  2 +-
>  hw/arm/tosa.c                            |  1 +
>  hw/arm/versatilepb.c                     |  1 +
>  hw/arm/vexpress.c                        |  2 +
>  hw/arm/virt-acpi-build.c                 |  1 +
>  hw/arm/virt.c                            |  2 +
>  hw/arm/xilinx_zynq.c                     |  1 +
>  hw/arm/xlnx-ep108.c                      |  1 +
>  hw/arm/xlnx-zynqmp.c                     |  1 +
>  hw/audio/adlib.c                         |  1 +
>  hw/audio/gus.c                           |  1 +
>  hw/block/block.c                         |  1 +
>  hw/block/cdrom.c                         |  1 -
>  hw/block/dataplane/virtio-blk.c          |  1 +
>  hw/block/fdc.c                           |  1 +
>  hw/block/nand.c                          |  1 +
>  hw/block/nvme.c                          |  2 +
>  hw/block/onenand.c                       |  2 +-
>  hw/block/pflash_cfi01.c                  |  1 +
>  hw/block/pflash_cfi02.c                  |  1 +
>  hw/block/virtio-blk.c                    |  2 +-
>  hw/block/xen_disk.c                      |  1 +
>  hw/bt/core.c                             |  1 -
>  hw/bt/hci-csr.c                          |  1 -
>  hw/bt/hci.c                              |  1 +
>  hw/bt/hid.c                              |  1 -
>  hw/bt/l2cap.c                            |  1 -
>  hw/char/debugcon.c                       |  1 +
>  hw/char/parallel.c                       |  1 +
>  hw/char/serial-isa.c                     |  1 +
>  hw/char/serial-pci.c                     |  1 +
>  hw/char/serial.c                         |  1 +
>  hw/char/spapr_vty.c                      |  1 +
>  hw/char/virtio-serial-bus.c              |  1 +
>  hw/core/fw-path-provider.c               |  1 +
>  hw/core/loader.c                         |  2 +
>  hw/core/machine.c                        |  2 +
>  hw/core/nmi.c                            |  2 +
>  hw/core/null-machine.c                   |  1 -
>  hw/core/ptimer.c                         |  2 +
>  hw/core/qdev-properties-system.c         |  1 +
>  hw/core/qdev-properties.c                |  3 ++
>  hw/core/qdev.c                           |  1 +
>  hw/core/stream.c                         |  1 +
>  hw/cpu/a15mpcore.c                       |  1 +
>  hw/cpu/a9mpcore.c                        |  1 +
>  hw/cpu/arm11mpcore.c                     |  1 +
>  hw/cpu/realview_mpcore.c                 |  1 +
>  hw/cris/axis_dev88.c                     |  1 +
>  hw/display/blizzard.c                    |  1 -
>  hw/display/cg3.c                         |  1 +
>  hw/display/cirrus_vga.c                  |  1 +
>  hw/display/exynos4210_fimd.c             |  1 -
>  hw/display/jazz_led.c                    |  1 -
>  hw/display/qxl.c                         |  1 -
>  hw/display/qxl.h                         |  2 -
>  hw/display/sm501.c                       |  1 +
>  hw/display/tc6393xb.c                    |  1 +
>  hw/display/tcx.c                         |  1 +
>  hw/display/vga.c                         |  1 +
>  hw/display/virtio-gpu-3d.c               |  1 -
>  hw/display/virtio-gpu.c                  |  1 -
>  hw/display/vmware_vga.c                  |  1 +
>  hw/dma/etraxfs_dma.c                     |  1 -
>  hw/dma/i8257.c                           |  2 +-
>  hw/dma/omap_dma.c                        |  1 -
>  hw/dma/pl330.c                           |  2 +
>  hw/dma/soc_dma.c                         |  1 -
>  hw/dma/xilinx_axidma.c                   |  1 +
>  hw/i386/acpi-build.c                     |  2 +-
>  hw/i386/acpi-build.h                     |  2 -
>  hw/i386/kvm/clock.c                      |  1 -
>  hw/i386/kvm/i8254.c                      |  1 +
>  hw/i386/kvm/pci-assign.c                 |  1 +
>  hw/i386/pc.c                             |  2 +
>  hw/i386/pc_sysfw.c                       |  2 +
>  hw/i386/pci-assign-load-rom.c            |  1 +
>  hw/i386/xen/xen_platform.c               |  1 +
>  hw/i386/xen/xen_pvdevice.c               |  1 +
>  hw/ide/core.c                            |  1 +
>  hw/ide/qdev.c                            |  1 +
>  hw/input/milkymist-softusb.c             |  1 +
>  hw/input/virtio-input-host.c             |  2 +-
>  hw/input/virtio-input.c                  |  1 +
>  hw/intc/apic_common.c                    |  1 +
>  hw/intc/arm_gic.c                        |  1 +
>  hw/intc/arm_gic_common.c                 |  1 +
>  hw/intc/arm_gicv2m.c                     |  1 +
>  hw/intc/arm_gicv3_common.c               |  1 +
>  hw/intc/armv7m_nvic.c                    |  1 +
>  hw/intc/exynos4210_gic.c                 |  1 -
>  hw/intc/ioapic_common.c                  |  1 +
>  hw/intc/openpic.c                        |  1 +
>  hw/intc/realview_gic.c                   |  1 +
>  hw/intc/xics.c                           |  1 +
>  hw/ipack/ipack.c                         |  1 +
>  hw/ipmi/ipmi_bmc_extern.c                |  1 +
>  hw/ipmi/isa_ipmi_bt.c                    |  1 +
>  hw/ipmi/isa_ipmi_kcs.c                   |  1 +
>  hw/isa/isa-bus.c                         |  1 +
>  hw/isa/lpc_ich9.c                        |  1 -
>  hw/isa/pc87312.c                         |  1 +
>  hw/lm32/lm32_boards.c                    |  1 +
>  hw/lm32/lm32_hwsetup.h                   |  1 -
>  hw/lm32/milkymist.c                      |  1 +
>  hw/m68k/an5206.c                         |  1 +
>  hw/m68k/mcf5208.c                        |  1 +
>  hw/mem/pc-dimm.c                         |  1 +
>  hw/microblaze/petalogix_ml605_mmu.c      |  1 +
>  hw/microblaze/petalogix_s3adsp1800_mmu.c |  1 +
>  hw/mips/mips_fulong2e.c                  |  2 +
>  hw/mips/mips_jazz.c                      |  1 +
>  hw/mips/mips_malta.c                     |  1 +
>  hw/mips/mips_mipssim.c                   |  3 ++
>  hw/mips/mips_r4k.c                       |  3 ++
>  hw/misc/bcm2835_mbox.c                   |  1 +
>  hw/misc/bcm2835_property.c               |  1 +
>  hw/misc/cbus.c                           |  2 +-
>  hw/misc/ivshmem.c                        |  3 ++
>  hw/misc/macio/cuda.c                     |  1 +
>  hw/misc/macio/macio.c                    |  1 +
>  hw/misc/tmp105.c                         |  1 +
>  hw/moxie/moxiesim.c                      |  1 +
>  hw/net/dp8393x.c                         |  1 +
>  hw/net/milkymist-minimac2.c              |  1 +
>  hw/net/ne2000-isa.c                      |  1 +
>  hw/net/rocker/qmp-norocker.c             |  1 -
>  hw/net/vmxnet3.c                         |  1 -
>  hw/net/vmxnet_rx_pkt.c                   |  1 -
>  hw/net/vmxnet_rx_pkt.h                   |  2 -
>  hw/net/vmxnet_tx_pkt.c                   |  1 -
>  hw/net/vmxnet_tx_pkt.h                   |  2 -
>  hw/net/xilinx_axienet.c                  |  1 +
>  hw/nvram/fw_cfg.c                        |  1 +
>  hw/nvram/mac_nvram.c                     |  2 +
>  hw/nvram/spapr_nvram.c                   |  1 +
>  hw/openrisc/openrisc_sim.c               |  1 +
>  hw/pci-bridge/dec.h                      |  2 -
>  hw/pci-bridge/pci_bridge_dev.c           |  1 +
>  hw/pci-host/piix.c                       |  1 +
>  hw/pci-host/prep.c                       |  2 +
>  hw/pci-host/q35.c                        |  1 +
>  hw/pci/pci.c                             |  2 +
>  hw/pci/pcie.c                            |  2 +-
>  hw/pci/shpc.c                            |  2 +-
>  hw/pcmcia/pcmcia.c                       |  1 -
>  hw/ppc/e500.c                            |  1 +
>  hw/ppc/e500plat.c                        |  1 -
>  hw/ppc/mac_newworld.c                    |  3 ++
>  hw/ppc/mac_oldworld.c                    |  3 ++
>  hw/ppc/mpc8544ds.c                       |  1 -
>  hw/ppc/ppc405_boards.c                   |  3 ++
>  hw/ppc/ppc405_uc.c                       |  1 +
>  hw/ppc/spapr.c                           |  1 +
>  hw/ppc/spapr_drc.c                       |  2 +
>  hw/ppc/spapr_events.c                    |  3 ++
>  hw/ppc/spapr_hcall.c                     |  1 +
>  hw/ppc/spapr_pci.c                       |  1 +
>  hw/ppc/spapr_pci_vfio.c                  |  1 +
>  hw/ppc/spapr_rng.c                       |  1 +
>  hw/ppc/spapr_rtas.c                      |  2 +
>  hw/ppc/spapr_rtc.c                       |  2 +
>  hw/ppc/spapr_vio.c                       |  1 +
>  hw/ppc/virtex_ml507.c                    |  1 +
>  hw/s390x/event-facility.c                |  1 +
>  hw/s390x/ipl.c                           |  2 +
>  hw/s390x/s390-virtio-ccw.c               |  1 +
>  hw/s390x/s390-virtio.c                   |  1 +
>  hw/s390x/sclp.c                          |  1 +
>  hw/s390x/virtio-ccw.c                    |  1 +
>  hw/scsi/esp-pci.c                        |  1 +
>  hw/scsi/esp.c                            |  1 +
>  hw/scsi/megasas.c                        |  1 +
>  hw/scsi/scsi-bus.c                       |  2 +
>  hw/scsi/scsi-disk.c                      |  1 +
>  hw/scsi/scsi-generic.c                   |  2 +-
>  hw/scsi/vhost-scsi.c                     |  2 +
>  hw/scsi/virtio-scsi-dataplane.c          |  1 -
>  hw/scsi/virtio-scsi.c                    |  1 +
>  hw/scsi/vmw_pvscsi.c                     |  1 +
>  hw/sd/core.c                             |  1 +
>  hw/sd/pxa2xx_mmci.c                      |  1 +
>  hw/sd/sd.c                               |  1 +
>  hw/sh4/r2d.c                             |  1 +
>  hw/sh4/shix.c                            |  1 +
>  hw/smbios/smbios.c                       |  2 +
>  hw/sparc/leon3.c                         |  3 ++
>  hw/sparc/sun4m.c                         |  3 ++
>  hw/sparc64/sun4u.c                       |  3 ++
>  hw/timer/a9gtimer.c                      |  1 +
>  hw/timer/arm_mptimer.c                   |  1 +
>  hw/timer/arm_timer.c                     |  1 -
>  hw/timer/ds1338.c                        |  1 +
>  hw/timer/exynos4210_mct.c                |  1 -
>  hw/timer/exynos4210_pwm.c                |  1 -
>  hw/timer/hpet.c                          |  1 +
>  hw/timer/m48t59.c                        |  2 +
>  hw/timer/mc146818rtc.c                   |  2 +
>  hw/timer/pl031.c                         |  1 +
>  hw/timer/twl92230.c                      |  1 +
>  hw/tpm/tpm_passthrough.c                 |  1 -
>  hw/tpm/tpm_tis.c                         |  2 +-
>  hw/tpm/tpm_tis.h                         |  1 -
>  hw/tricore/tricore_testboard.c           |  1 +
>  hw/unicore32/puv3.c                      |  2 +-
>  hw/usb/bus.c                             |  2 +
>  hw/usb/ccid-card-passthru.c              |  1 +
>  hw/usb/combined-packet.c                 |  1 -
>  hw/usb/core.c                            |  1 -
>  hw/usb/dev-audio.c                       |  1 -
>  hw/usb/dev-bluetooth.c                   |  1 -
>  hw/usb/dev-hid.c                         |  1 +
>  hw/usb/dev-hub.c                         |  2 +-
>  hw/usb/dev-mtp.c                         |  2 +-
>  hw/usb/dev-network.c                     |  1 +
>  hw/usb/dev-serial.c                      |  1 +
>  hw/usb/dev-smartcard-reader.c            |  1 +
>  hw/usb/dev-storage.c                     |  1 +
>  hw/usb/dev-uas.c                         |  1 -
>  hw/usb/hcd-ehci.c                        |  1 +
>  hw/usb/hcd-musb.c                        |  1 -
>  hw/usb/hcd-ohci.c                        |  1 +
>  hw/usb/hcd-uhci.c                        |  1 +
>  hw/usb/host-legacy.c                     |  1 -
>  hw/usb/host-libusb.c                     |  2 +-
>  hw/usb/host-stub.c                       |  1 -
>  hw/usb/libhw.c                           |  1 -
>  hw/usb/redirect.c                        |  1 +
>  hw/usb/tusb6010.c                        |  1 -
>  hw/vfio/pci.h                            |  1 -
>  hw/vfio/platform.c                       |  1 +
>  hw/virtio/vhost-user.c                   |  2 +
>  hw/virtio/vhost.c                        |  1 +
>  hw/virtio/virtio-balloon.c               |  1 -
>  hw/virtio/virtio-pci.c                   |  1 +
>  hw/virtio/virtio-rng.c                   |  1 +
>  hw/virtio/virtio.c                       |  1 +
>  hw/watchdog/wdt_i6300esb.c               |  1 -
>  hw/watchdog/wdt_ib700.c                  |  1 -
>  hw/xen/xen-host-pci-device.c             |  1 +
>  hw/xen/xen_pt.c                          |  1 +
>  hw/xen/xen_pt.h                          |  1 -
>  hw/xen/xen_pt_config_init.c              |  1 +
>  hw/xen/xen_pt_graphics.c                 |  1 +
>  hw/xtensa/sim.c                          |  1 +
>  hw/xtensa/xtfpga.c                       |  1 +
>  include/block/accounting.h               |  2 -
>  include/block/aio.h                      |  2 -
>  include/block/block.h                    |  2 +-
>  include/block/nbd.h                      |  2 -
>  include/block/qapi.h                     |  1 +
>  include/block/snapshot.h                 |  1 -
>  include/block/write-threshold.h          |  4 --
>  include/config.h                         |  1 -
>  include/crypto/cipher.h                  |  2 +-
>  include/crypto/hash.h                    |  2 +-
>  include/crypto/init.h                    |  2 -
>  include/crypto/secret.h                  |  1 -
>  include/crypto/tlscreds.h                |  1 -
>  include/disas/bfd.h                      |  2 +-
>  include/disas/disas.h                    |  2 -
>  include/exec/cpu-all.h                   |  1 -
>  include/exec/cpu-common.h                |  1 -
>  include/exec/exec-all.h                  |  2 -
>  include/exec/ioport.h                    |  1 -
>  include/exec/memory.h                    |  1 -
>  include/hw/acpi/acpi.h                   |  1 -
>  include/hw/acpi/pcihp.h                  |  1 -
>  include/hw/acpi/piix4.h                  |  2 -
>  include/hw/acpi/tco.h                    |  2 -
>  include/hw/arm/allwinner-a10.h           |  1 -
>  include/hw/arm/bcm2835_peripherals.h     |  1 -
>  include/hw/arm/exynos4210.h              |  1 -
>  include/hw/arm/omap.h                    |  1 +
>  include/hw/arm/sysbus-fdt.h              |  1 -
>  include/hw/arm/virt-acpi-build.h         |  1 -
>  include/hw/arm/virt.h                    |  2 +-
>  include/hw/arm/xlnx-zynqmp.h             |  1 -
>  include/hw/block/block.h                 |  1 -
>  include/hw/boards.h                      |  1 -
>  include/hw/char/digic-uart.h             |  1 -
>  include/hw/fw-path-provider.h            |  1 -
>  include/hw/hotplug.h                     |  1 -
>  include/hw/hw.h                          |  5 ++-
>  include/hw/i386/apic.h                   |  2 +-
>  include/hw/i386/pc.h                     |  2 -
>  include/hw/ipmi/ipmi.h                   |  1 -
>  include/hw/isa/apm.h                     |  1 -
>  include/hw/isa/i8257.h                   |  2 +-
>  include/hw/isa/isa.h                     |  5 ++-
>  include/hw/lm32/lm32_pic.h               |  1 -
>  include/hw/nmi.h                         |  1 -
>  include/hw/nvram/fw_cfg.h                | 50 +------------------------
>  include/hw/nvram/fw_cfg_keys.h           | 46 +++++++++++++++++++++++
>  include/hw/pci-host/apb.h                |  1 -
>  include/hw/pci-host/pam.h                |  1 -
>  include/hw/pci/msi.h                     |  1 -
>  include/hw/pci/msix.h                    |  1 -
>  include/hw/pci/pci.h                     | 11 +++++-
>  include/hw/pci/shpc.h                    |  1 -
>  include/hw/pci/slotid_cap.h              |  1 -
>  include/hw/ppc/mac_dbdma.h               |  1 +
>  include/hw/ppc/openpic.h                 |  1 -
>  include/hw/ptimer.h                      |  1 -
>  include/hw/qdev-core.h                   |  1 -
>  include/hw/scsi/scsi.h                   |  1 -
>  include/hw/sd/sdhci.h                    |  1 -
>  include/hw/sh4/sh_intc.h                 |  1 -
>  include/hw/sparc/sun4m.h                 |  1 -
>  include/hw/stream.h                      |  1 -
>  include/hw/timer/digic-timer.h           |  1 -
>  include/hw/timer/m48t59.h                |  1 -
>  include/hw/usb.h                         |  1 +
>  include/hw/vfio/vfio-common.h            |  1 -
>  include/hw/vfio/vfio.h                   |  2 -
>  include/hw/virtio/vhost-scsi.h           |  1 -
>  include/hw/xen/xen.h                     |  2 -
>  include/io/channel.h                     |  1 -
>  include/io/task.h                        |  1 -
>  include/migration/migration.h            |  1 -
>  include/monitor/monitor.h                |  1 -
>  include/monitor/qdev.h                   |  1 -
>  include/net/filter.h                     |  2 -
>  include/net/net.h                        |  1 -
>  include/net/queue.h                      |  2 -
>  include/net/slirp.h                      |  1 -
>  include/net/tap.h                        |  1 -
>  include/qapi/error.h                     |  5 ---
>  include/qapi/qmp/json-parser.h           |  1 -
>  include/qapi/visitor.h                   |  1 -
>  include/qemu-common.h                    | 64 --------------------------------
>  include/qemu-io.h                        |  2 -
>  include/qemu/base64.h                    |  3 --
>  include/qemu/bswap.h                     |  6 +--
>  include/qemu/buffer.h                    |  2 -
>  include/qemu/coroutine.h                 |  1 -
>  include/qemu/crc32c.h                    |  2 -
>  include/qemu/event_notifier.h            |  2 -
>  include/qemu/iov.h                       | 30 ++++++++++++++-
>  include/qemu/mmap-alloc.h                |  2 -
>  include/qemu/option.h                    |  1 -
>  include/qemu/osdep.h                     | 24 ++++++++++--
>  include/qemu/range.h                     |  1 -
>  include/qemu/throttle.h                  |  1 -
>  include/qemu/timer.h                     |  2 -
>  include/qemu/typedefs.h                  |  2 +
>  include/qom/cpu.h                        |  1 -
>  include/qom/object.h                     |  2 +-
>  include/sysemu/accel.h                   |  1 -
>  include/sysemu/block-backend.h           |  2 +-
>  include/sysemu/char.h                    |  6 ++-
>  include/sysemu/cpus.h                    |  2 +
>  include/sysemu/kvm.h                     |  4 ++
>  include/sysemu/memory_mapping.h          |  1 -
>  include/sysemu/qtest.h                   |  2 -
>  include/sysemu/replay.h                  |  1 -
>  include/sysemu/rng.h                     |  1 -
>  include/sysemu/sysemu.h                  |  1 -
>  include/sysemu/tpm_backend.h             |  1 -
>  include/ui/console.h                     |  1 -
>  include/ui/qemu-pixman.h                 |  2 -
>  include/ui/qemu-spice.h                  |  1 +
>  io/channel-buffer.c                      |  1 +
>  io/channel-command.c                     |  2 +
>  io/channel-file.c                        |  2 +
>  io/channel-socket.c                      |  2 +
>  io/channel-tls.c                         |  2 +
>  io/channel-util.c                        |  1 +
>  io/channel-websock.c                     |  2 +
>  io/channel.c                             |  2 +
>  io/task.c                                |  1 +
>  iohandler.c                              |  2 +-
>  ioport.c                                 |  1 +
>  kvm-stub.c                               |  1 -
>  linux-user/elfload.c                     |  2 +
>  linux-user/mmap.c                        |  1 -
>  linux-user/signal.c                      |  1 -
>  linux-user/uaccess.c                     |  2 +-
>  main-loop.c                              |  1 +
>  memory.c                                 |  2 +
>  memory_mapping.c                         |  2 +-
>  migration/block.c                        |  1 +
>  migration/exec.c                         |  2 +-
>  migration/fd.c                           |  2 +-
>  migration/postcopy-ram.c                 |  1 -
>  migration/qemu-file-buf.c                |  1 -
>  migration/qemu-file-internal.h           |  1 -
>  migration/qemu-file-stdio.c              |  1 -
>  migration/qemu-file.c                    |  1 -
>  migration/ram.c                          |  1 +
>  migration/rdma.c                         |  1 +
>  migration/tcp.c                          |  1 -
>  migration/unix.c                         |  1 -
>  migration/vmstate.c                      |  1 -
>  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.h                                |  2 -
>  net/l2tpv3.c                             |  1 -
>  net/slirp.c                              |  1 +
>  net/socket.c                             |  1 +
>  net/tap-bsd.c                            |  1 -
>  net/tap-linux.c                          |  1 +
>  net/tap-win32.c                          |  1 -
>  net/tap.c                                |  1 +
>  net/tap_int.h                            |  1 -
>  net/vde.c                                |  1 -
>  os-posix.c                               |  1 +
>  pc-bios/optionrom/optionrom.h            |  3 +-
>  qapi/opts-visitor.c                      |  1 +
>  qapi/qapi-dealloc-visitor.c              |  1 -
>  qapi/qapi-util.c                         |  2 +-
>  qapi/qapi-visit-core.c                   |  2 +-
>  qapi/qmp-dispatch.c                      |  1 +
>  qapi/qmp-event.c                         |  1 -
>  qapi/qmp-input-visitor.c                 |  2 +-
>  qapi/qmp-output-visitor.c                |  1 -
>  qapi/string-input-visitor.c              |  2 +-
>  qapi/string-output-visitor.c             |  1 -
>  qdev-monitor.c                           |  1 +
>  qemu-img.c                               |  1 +
>  qemu-io-cmds.c                           |  2 +
>  qemu-io.c                                |  2 +
>  qemu-nbd.c                               |  1 +
>  qemu-timer.c                             |  1 +
>  qga/channel-posix.c                      |  1 +
>  qga/commands-posix.c                     |  1 +
>  qga/commands.c                           |  1 +
>  qga/guest-agent-core.h                   |  1 -
>  qga/main.c                               |  2 +-
>  qga/vss-win32/requester.cpp              |  1 -
>  qobject/json-lexer.c                     |  1 -
>  qobject/json-parser.c                    |  1 +
>  qobject/json-streamer.c                  |  1 -
>  qobject/qbool.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/cpu.c                                |  1 +
>  qom/object.c                             |  1 +
>  qom/object_interfaces.c                  |  1 +
>  qom/qom-qobject.c                        |  2 +-
>  qtest.c                                  |  2 +
>  replay/replay-events.c                   |  1 -
>  replay/replay-input.c                    |  2 +-
>  replay/replay-internal.c                 |  1 -
>  replay/replay-time.c                     |  1 -
>  replay/replay.c                          |  1 +
>  scripts/clean-includes                   |  6 +--
>  scripts/qapi-types.py                    |  5 ---
>  scripts/qapi-visit.py                    |  1 +
>  scripts/tracetool/backend/log.py         |  6 +--
>  scripts/tracetool/format/events_h.py     |  2 -
>  scripts/tracetool/format/h.py            |  3 --
>  scripts/tracetool/format/tcg_h.py        |  2 -
>  scripts/tracetool/format/ust_events_c.py |  1 -
>  scripts/tracetool/format/ust_events_h.py |  1 -
>  slirp/ip_icmp.c                          |  1 +
>  slirp/libslirp.h                         |  2 -
>  slirp/misc.c                             |  2 +-
>  slirp/tcp_subr.c                         |  1 +
>  spice-qemu-char.c                        |  1 +
>  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                          |  2 -
>  stubs/get-fd.c                           |  2 +-
>  stubs/get-next-serial.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/set-fd-handler.c                   |  1 -
>  stubs/slirp.c                            |  1 -
>  stubs/target-get-monitor-def.c           |  2 -
>  stubs/target-monitor-defs.c              |  2 -
>  stubs/uuid.c                             |  1 -
>  stubs/vm-stop.c                          |  1 -
>  stubs/vmstate.c                          |  1 -
>  target-alpha/cpu.c                       |  1 +
>  target-alpha/cpu.h                       |  1 -
>  target-alpha/translate.c                 |  1 +
>  target-arm/cpu.c                         |  1 +
>  target-arm/cpu.h                         |  1 -
>  target-arm/cpu64.c                       |  1 +
>  target-arm/kvm-stub.c                    |  1 -
>  target-arm/kvm.c                         |  1 -
>  target-arm/kvm32.c                       |  1 -
>  target-arm/kvm64.c                       |  1 -
>  target-cris/cpu.c                        |  1 +
>  target-cris/cpu.h                        |  1 -
>  target-i386/cpu.c                        |  3 +-
>  target-i386/cpu.h                        |  1 -
>  target-i386/kvm-stub.c                   |  1 -
>  target-i386/kvm.c                        |  2 +-
>  target-i386/machine.c                    |  1 +
>  target-lm32/cpu.c                        |  1 +
>  target-lm32/cpu.h                        |  1 -
>  target-m68k/cpu.c                        |  1 +
>  target-m68k/cpu.h                        |  1 -
>  target-m68k/m68k-semi.c                  |  1 -
>  target-microblaze/cpu.c                  |  1 +
>  target-microblaze/cpu.h                  |  1 -
>  target-mips/cpu.c                        |  1 +
>  target-mips/cpu.h                        |  1 -
>  target-mips/kvm.c                        |  1 -
>  target-moxie/cpu.c                       |  1 +
>  target-moxie/cpu.h                       |  1 -
>  target-openrisc/cpu.c                    |  1 +
>  target-openrisc/cpu.h                    |  1 -
>  target-openrisc/exception.h              |  1 -
>  target-openrisc/interrupt.c              |  1 -
>  target-openrisc/mmu.c                    |  1 -
>  target-openrisc/translate.c              |  1 -
>  target-ppc/cpu-models.c                  |  1 +
>  target-ppc/cpu.h                         |  1 -
>  target-ppc/kvm-stub.c                    |  1 -
>  target-ppc/kvm.c                         |  1 -
>  target-ppc/translate_init.c              |  1 +
>  target-s390x/cpu.c                       |  1 +
>  target-s390x/cpu.h                       |  1 -
>  target-s390x/helper.c                    |  2 +
>  target-s390x/kvm.c                       |  1 -
>  target-s390x/misc_helper.c               |  1 +
>  target-sh4/cpu.c                         |  1 +
>  target-sh4/cpu.h                         |  1 -
>  target-sparc/cpu.c                       |  3 ++
>  target-sparc/cpu.h                       |  1 -
>  target-tilegx/cpu.c                      |  1 +
>  target-tilegx/cpu.h                      |  1 -
>  target-tilegx/helper.c                   |  1 -
>  target-tilegx/simd_helper.c              |  1 -
>  target-tricore/cpu.c                     |  1 +
>  target-tricore/cpu.h                     |  1 -
>  target-unicore32/cpu.c                   |  1 +
>  target-unicore32/cpu.h                   |  1 -
>  target-xtensa/core-dc233c.c              |  1 -
>  target-xtensa/cpu.c                      |  1 +
>  target-xtensa/cpu.h                      |  1 -
>  tcg/optimize.c                           |  1 -
>  tcg/tcg.h                                |  2 +-
>  tci.c                                    |  1 -
>  tests/ahci-test.c                        |  1 -
>  tests/boot-order-test.c                  |  4 +-
>  tests/boot-sector.c                      |  1 -
>  tests/check-qdict.c                      |  1 -
>  tests/check-qfloat.c                     |  1 -
>  tests/check-qint.c                       |  1 -
>  tests/check-qjson.c                      |  1 -
>  tests/check-qom-proplist.c               |  1 +
>  tests/check-qstring.c                    |  1 -
>  tests/crypto-tls-x509-helpers.h          |  2 -
>  tests/device-introspect-test.c           |  1 -
>  tests/fdc-test.c                         |  1 -
>  tests/fw_cfg-test.c                      |  3 +-
>  tests/hd-geo-test.c                      |  1 -
>  tests/io-channel-helpers.c               |  1 +
>  tests/ipmi-bt-test.c                     |  1 -
>  tests/libqos/ahci.c                      |  1 -
>  tests/libqos/malloc-pc.c                 |  4 +-
>  tests/libqos/pci-pc.c                    |  1 -
>  tests/pc-cpu-test.c                      |  1 -
>  tests/pxe-test.c                         |  1 -
>  tests/rtl8139-test.c                     |  1 -
>  tests/tcg/test-i386-fprem.c              |  4 +-
>  tests/test-aio.c                         |  1 +
>  tests/test-base64.c                      |  2 +-
>  tests/test-blockjob-txn.c                |  1 +
>  tests/test-crypto-cipher.c               |  1 +
>  tests/test-crypto-secret.c               |  2 +
>  tests/test-crypto-tlscredsx509.c         |  2 +
>  tests/test-crypto-tlssession.c           |  2 +
>  tests/test-io-channel-buffer.c           |  2 +-
>  tests/test-io-channel-command.c          |  2 +
>  tests/test-io-channel-file.c             |  3 +-
>  tests/test-io-channel-socket.c           |  2 +
>  tests/test-io-channel-tls.c              |  1 +
>  tests/test-io-task.c                     |  2 +
>  tests/test-iov.c                         |  1 -
>  tests/test-opts-visitor.c                |  1 +
>  tests/test-qemu-opts.c                   |  1 +
>  tests/test-qmp-commands.c                |  1 -
>  tests/test-qmp-event.c                   |  1 -
>  tests/test-qmp-input-strict.c            |  2 +-
>  tests/test-qmp-input-visitor.c           |  2 +-
>  tests/test-qmp-output-visitor.c          |  2 +-
>  tests/test-string-input-visitor.c        |  2 +-
>  tests/test-string-output-visitor.c       |  2 +-
>  tests/test-thread-pool.c                 |  2 +-
>  tests/test-throttle.c                    |  1 +
>  tests/test-visitor-serialization.c       |  2 +-
>  tests/test-vmstate.c                     |  1 -
>  tests/vhost-user-test.c                  |  1 +
>  tests/virtio-9p-test.c                   |  1 -
>  thread-pool.c                            |  1 -
>  trace/control.c                          |  1 +
>  trace/control.h                          |  2 -
>  trace/qmp.c                              |  1 -
>  ui/console-gl.c                          |  1 -
>  ui/curses.c                              |  1 -
>  ui/cursor.c                              |  1 -
>  ui/egl-context.c                         |  1 -
>  ui/egl-helpers.c                         |  1 -
>  ui/gtk-egl.c                             |  1 -
>  ui/gtk-gl-area.c                         |  1 -
>  ui/input-linux.c                         |  1 +
>  ui/keymaps.c                             |  1 +
>  ui/keymaps.h                             |  2 -
>  ui/qemu-pixman.c                         |  1 -
>  ui/sdl2-2d.c                             |  1 -
>  ui/sdl2-gl.c                             |  1 -
>  ui/sdl2-input.c                          |  1 -
>  ui/sdl2.c                                |  1 -
>  ui/shader.c                              |  1 -
>  ui/spice-core.c                          |  1 -
>  ui/spice-display.c                       |  1 -
>  ui/spice-input.c                         |  1 -
>  ui/vnc-auth-sasl.c                       |  1 +
>  ui/vnc-auth-vencrypt.c                   |  1 +
>  ui/vnc-enc-tight.c                       |  1 -
>  ui/vnc-ws.c                              |  1 +
>  ui/vnc.c                                 |  1 +
>  ui/vnc.h                                 |  1 -
>  ui/x_keymap.c                            |  1 -
>  util/acl.c                               |  1 -
>  util/base64.c                            |  3 +-
>  util/buffer.c                            |  1 +
>  util/compatfd.c                          |  1 -
>  util/coroutine-gthread.c                 |  1 -
>  util/coroutine-sigaltstack.c             |  1 -
>  util/coroutine-ucontext.c                |  1 -
>  util/coroutine-win32.c                   |  1 -
>  util/crc32c.c                            |  1 -
>  util/envlist.c                           |  1 -
>  util/error.c                             |  2 +-
>  util/event_notifier-win32.c              |  1 -
>  util/fifo8.c                             |  1 -
>  util/getauxval.c                         |  1 -
>  util/iov.c                               |  1 +
>  util/log.c                               |  1 -
>  util/mmap-alloc.c                        |  1 +
>  util/module.c                            |  1 -
>  util/notify.c                            |  1 -
>  util/oslib-posix.c                       |  3 +-
>  util/qemu-config.c                       |  1 -
>  util/qemu-coroutine-lock.c               |  1 -
>  util/qemu-coroutine.c                    |  1 -
>  util/qemu-option.c                       |  1 +
>  util/qemu-sockets.c                      |  4 +-
>  util/qemu-thread-win32.c                 |  1 -
>  util/rcu.c                               |  1 -
>  util/throttle.c                          |  1 +
>  vl.c                                     |  1 +
>  821 files changed, 684 insertions(+), 627 deletions(-)
>  delete mode 100644 include/config.h
>  create mode 100644 include/hw/nvram/fw_cfg_keys.h
> 

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

* Re: [Qemu-devel] [PATCH 13/15] include/crypto: Include qapi-types.h instead of qemu-common.h
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 13/15] include/crypto: Include qapi-types.h instead of qemu-common.h Markus Armbruster
@ 2016-03-15 15:51   ` Daniel P. Berrange
  2016-03-15 16:24     ` Markus Armbruster
  0 siblings, 1 reply; 33+ messages in thread
From: Daniel P. Berrange @ 2016-03-15 15:51 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: peter.maydell, qemu-devel, pbonzini

On Tue, Mar 15, 2016 at 04:03:39PM +0100, Markus Armbruster wrote:
> qemu-common.h should only be included by .c files.  Its file comment
> explains why: "No header file should depend on qemu-common.h, as this
> would easily lead to circular header dependencies."
> 
> Several include/crypto/ headers include qemu-common.h, but either need
> just qapi-types.h from it, or nothing at all.  Replace or drop the
> include accordingly.  tests/test-crypto-secret.c now misses
> qemu/module.h, so include it there.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  include/crypto/cipher.h    | 2 +-
>  include/crypto/hash.h      | 2 +-
>  include/crypto/init.h      | 2 --
>  include/crypto/secret.h    | 1 -
>  include/crypto/tlscreds.h  | 1 -
>  tests/test-crypto-secret.c | 1 +
>  6 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/include/crypto/cipher.h b/include/crypto/cipher.h
> index c04c3ac..d770c48 100644
> --- a/include/crypto/cipher.h
> +++ b/include/crypto/cipher.h
> @@ -21,7 +21,7 @@
>  #ifndef QCRYPTO_CIPHER_H__
>  #define QCRYPTO_CIPHER_H__
>  
> -#include "qemu-common.h"
> +#include "qapi-types.h"
>  
>  typedef struct QCryptoCipher QCryptoCipher;
>  
> diff --git a/include/crypto/hash.h b/include/crypto/hash.h
> index aebccd1..f38caed 100644
> --- a/include/crypto/hash.h
> +++ b/include/crypto/hash.h
> @@ -21,7 +21,7 @@
>  #ifndef QCRYPTO_HASH_H__
>  #define QCRYPTO_HASH_H__
>  
> -#include "qemu-common.h"
> +#include "qapi-types.h"
>  
>  /* See also "QCryptoHashAlgorithm" defined in qapi/crypto.json */
>  
> diff --git a/include/crypto/init.h b/include/crypto/init.h
> index 4836a37..2513ed0 100644
> --- a/include/crypto/init.h
> +++ b/include/crypto/init.h
> @@ -21,8 +21,6 @@
>  #ifndef QCRYPTO_INIT_H__
>  #define QCRYPTO_INIT_H__
>  
> -#include "qemu-common.h"
> -
>  int qcrypto_init(Error **errp);

Nothing provides the definition of the 'Error' type now.
Needs to add in

   #include "qapi/error.h"

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

* Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers Markus Armbruster
@ 2016-03-15 15:54   ` Daniel P. Berrange
  2016-03-15 16:35     ` Markus Armbruster
  2016-03-15 15:55   ` Paolo Bonzini
  1 sibling, 1 reply; 33+ messages in thread
From: Daniel P. Berrange @ 2016-03-15 15:54 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: peter.maydell, qemu-devel, pbonzini

On Tue, Mar 15, 2016 at 04:03:40PM +0100, Markus Armbruster wrote:
> qemu-common.h should only be included by .c files.  Its file comment
> explains why: "No header file should depend on qemu-common.h, as this
> would easily lead to circular header dependencies."
> 
> We include it in many headers anyway.  Fix that.
> 
> Dropping these ill-advised includes requires including
> qemu/fprintf-fn.h, cpu.h or exec/hwaddr.h instead in a few headers
> that actually need those, and of course including qemu-common.h in .c
> files that need it, except some of them need only qemu/module.h.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  crypto/secret.c                          | 1 +
>  crypto/tlscreds.c                        | 1 +
>  crypto/tlscredsanon.c                    | 1 +
>  crypto/tlscredsx509.c                    | 1 +


> diff --git a/crypto/secret.c b/crypto/secret.c
> index 285ab7a..65929ac 100644
> --- a/crypto/secret.c
> +++ b/crypto/secret.c
> @@ -19,6 +19,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> +#include "qemu/module.h"
>  #include "crypto/secret.h"
>  #include "crypto/cipher.h"
>  #include "qapi/error.h"
> diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c
> index 1620e12..edc7f88 100644
> --- a/crypto/tlscreds.c
> +++ b/crypto/tlscreds.c
> @@ -20,6 +20,7 @@
>  
>  #include "qemu/osdep.h"
>  #include "qapi/error.h"
> +#include "qemu/module.h"
>  #include "crypto/tlscredspriv.h"
>  #include "trace.h"
>  
> diff --git a/crypto/tlscredsanon.c b/crypto/tlscredsanon.c
> index 1464220..50df4f0 100644
> --- a/crypto/tlscredsanon.c
> +++ b/crypto/tlscredsanon.c
> @@ -19,6 +19,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> +#include "qemu/module.h"
>  #include "crypto/tlscredsanon.h"
>  #include "crypto/tlscredspriv.h"
>  #include "qapi/error.h"
> diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c
> index 6a0179c..2709b2b 100644
> --- a/crypto/tlscredsx509.c
> +++ b/crypto/tlscredsx509.c
> @@ -19,6 +19,7 @@
>   */
>  
>  #include "qemu/osdep.h"
> +#include "qemu/module.h"
>  #include "crypto/tlscredsx509.h"
>  #include "crypto/tlscredspriv.h"
>  #include "crypto/secret.h"

It feels like these should be in the previous patch that removes
qemu-common.h  from the include/crypto files ?


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

* Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers Markus Armbruster
  2016-03-15 15:54   ` Daniel P. Berrange
@ 2016-03-15 15:55   ` Paolo Bonzini
  2016-03-15 16:31     ` Markus Armbruster
  1 sibling, 1 reply; 33+ messages in thread
From: Paolo Bonzini @ 2016-03-15 15:55 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: peter.maydell



On 15/03/2016 16:03, Markus Armbruster wrote:
> diff --git a/include/hw/hw.h b/include/hw/hw.h
> index 2cb69d5..151d65e 100644
> --- a/include/hw/hw.h
> +++ b/include/hw/hw.h
> @@ -15,6 +15,7 @@
>  #include "qemu/module.h"
>  
>  #ifdef NEED_CPU_H
> +#include "cpu.h"
>  #if TARGET_LONG_BITS == 64
>  #define qemu_put_betl qemu_put_be64
>  #define qemu_get_betl qemu_get_be64

This actually makes things somewhat worse.  This dependency of hw/hw.h
on NEED_CPU_H should go away altogether.

Would it be okay to stick to patches 1-13 for now?

Paolo

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

* Re: [Qemu-devel] [PATCH 01/15] include/qemu/osdep.h: Don't include qapi/error.h
  2016-03-15 15:03 ` [Qemu-devel] [PATCH 01/15] include/qemu/osdep.h: Don't include qapi/error.h Markus Armbruster
@ 2016-03-15 16:04   ` Paolo Bonzini
  2016-03-15 16:26     ` Markus Armbruster
  0 siblings, 1 reply; 33+ messages in thread
From: Paolo Bonzini @ 2016-03-15 16:04 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: peter.maydell



On 15/03/2016 16:03, Markus Armbruster wrote:
> diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h
> index 2dabe49..904501a 100644
> --- a/include/ui/qemu-spice.h
> +++ b/include/ui/qemu-spice.h
> @@ -23,6 +23,7 @@
>  
>  #include <spice.h>
>  
> +#include "qapi/error.h"
>  #include "qemu/option.h"
>  #include "qemu/config-file.h"
>  

This must be moved outside the #ifdef CONFIG_SPICE, because
ui/qemu-spice.h uses error_set call outside that #ifdef.

Paolo

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

* Re: [Qemu-devel] [PATCH 13/15] include/crypto: Include qapi-types.h instead of qemu-common.h
  2016-03-15 15:51   ` Daniel P. Berrange
@ 2016-03-15 16:24     ` Markus Armbruster
  0 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 16:24 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: peter.maydell, qemu-devel, pbonzini

"Daniel P. Berrange" <berrange@redhat.com> writes:

> On Tue, Mar 15, 2016 at 04:03:39PM +0100, Markus Armbruster wrote:
>> qemu-common.h should only be included by .c files.  Its file comment
>> explains why: "No header file should depend on qemu-common.h, as this
>> would easily lead to circular header dependencies."
>> 
>> Several include/crypto/ headers include qemu-common.h, but either need
>> just qapi-types.h from it, or nothing at all.  Replace or drop the
>> include accordingly.  tests/test-crypto-secret.c now misses
>> qemu/module.h, so include it there.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  include/crypto/cipher.h    | 2 +-
>>  include/crypto/hash.h      | 2 +-
>>  include/crypto/init.h      | 2 --
>>  include/crypto/secret.h    | 1 -
>>  include/crypto/tlscreds.h  | 1 -
>>  tests/test-crypto-secret.c | 1 +
>>  6 files changed, 3 insertions(+), 6 deletions(-)
>> 
>> diff --git a/include/crypto/cipher.h b/include/crypto/cipher.h
>> index c04c3ac..d770c48 100644
>> --- a/include/crypto/cipher.h
>> +++ b/include/crypto/cipher.h
>> @@ -21,7 +21,7 @@
>>  #ifndef QCRYPTO_CIPHER_H__
>>  #define QCRYPTO_CIPHER_H__
>>  
>> -#include "qemu-common.h"
>> +#include "qapi-types.h"
>>  
>>  typedef struct QCryptoCipher QCryptoCipher;
>>  
>> diff --git a/include/crypto/hash.h b/include/crypto/hash.h
>> index aebccd1..f38caed 100644
>> --- a/include/crypto/hash.h
>> +++ b/include/crypto/hash.h
>> @@ -21,7 +21,7 @@
>>  #ifndef QCRYPTO_HASH_H__
>>  #define QCRYPTO_HASH_H__
>>  
>> -#include "qemu-common.h"
>> +#include "qapi-types.h"
>>  
>>  /* See also "QCryptoHashAlgorithm" defined in qapi/crypto.json */
>>  
>> diff --git a/include/crypto/init.h b/include/crypto/init.h
>> index 4836a37..2513ed0 100644
>> --- a/include/crypto/init.h
>> +++ b/include/crypto/init.h
>> @@ -21,8 +21,6 @@
>>  #ifndef QCRYPTO_INIT_H__
>>  #define QCRYPTO_INIT_H__
>>  
>> -#include "qemu-common.h"
>> -
>>  int qcrypto_init(Error **errp);
>
> Nothing provides the definition of the 'Error' type now.
> Needs to add in
>
>    #include "qapi/error.h"

qemu/typedefs.h does, since PATCH 01.  Standard technique to disentangle
includes.

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

* Re: [Qemu-devel] [PATCH 01/15] include/qemu/osdep.h: Don't include qapi/error.h
  2016-03-15 16:04   ` Paolo Bonzini
@ 2016-03-15 16:26     ` Markus Armbruster
  0 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 16:26 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: peter.maydell, qemu-devel

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 15/03/2016 16:03, Markus Armbruster wrote:
>> diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h
>> index 2dabe49..904501a 100644
>> --- a/include/ui/qemu-spice.h
>> +++ b/include/ui/qemu-spice.h
>> @@ -23,6 +23,7 @@
>>  
>>  #include <spice.h>
>>  
>> +#include "qapi/error.h"
>>  #include "qemu/option.h"
>>  #include "qemu/config-file.h"
>>  
>
> This must be moved outside the #ifdef CONFIG_SPICE, because
> ui/qemu-spice.h uses error_set call outside that #ifdef.

Oops!

The inline function seems ill-advised to me, but let's avoid patch
series creep.  I'll fix it the way you described.

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

* Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers
  2016-03-15 15:55   ` Paolo Bonzini
@ 2016-03-15 16:31     ` Markus Armbruster
  2016-03-15 17:25       ` Paolo Bonzini
  0 siblings, 1 reply; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 16:31 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: peter.maydell, qemu-devel

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 15/03/2016 16:03, Markus Armbruster wrote:
>> diff --git a/include/hw/hw.h b/include/hw/hw.h
>> index 2cb69d5..151d65e 100644
>> --- a/include/hw/hw.h
>> +++ b/include/hw/hw.h
>> @@ -15,6 +15,7 @@
>>  #include "qemu/module.h"
>>  
>>  #ifdef NEED_CPU_H
>> +#include "cpu.h"
>>  #if TARGET_LONG_BITS == 64
>>  #define qemu_put_betl qemu_put_be64
>>  #define qemu_get_betl qemu_get_be64
>
> This actually makes things somewhat worse.  This dependency of hw/hw.h
> on NEED_CPU_H should go away altogether.
>
> Would it be okay to stick to patches 1-13 for now?

Yes, as long as "for now" approximately means "until 2.7 opens up".

Proposed plan: I pursue 01-13 now, you rebase your need-cpu-h branch
onto this work when it's ready, I rebase 14-15 onto yours, and carry on.
Makes sense?

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

* Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers
  2016-03-15 15:54   ` Daniel P. Berrange
@ 2016-03-15 16:35     ` Markus Armbruster
  0 siblings, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 16:35 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: peter.maydell, qemu-devel, pbonzini

"Daniel P. Berrange" <berrange@redhat.com> writes:

> On Tue, Mar 15, 2016 at 04:03:40PM +0100, Markus Armbruster wrote:
>> qemu-common.h should only be included by .c files.  Its file comment
>> explains why: "No header file should depend on qemu-common.h, as this
>> would easily lead to circular header dependencies."
>> 
>> We include it in many headers anyway.  Fix that.
>> 
>> Dropping these ill-advised includes requires including
>> qemu/fprintf-fn.h, cpu.h or exec/hwaddr.h instead in a few headers
>> that actually need those, and of course including qemu-common.h in .c
>> files that need it, except some of them need only qemu/module.h.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  crypto/secret.c                          | 1 +
>>  crypto/tlscreds.c                        | 1 +
>>  crypto/tlscredsanon.c                    | 1 +
>>  crypto/tlscredsx509.c                    | 1 +
>
>
>> diff --git a/crypto/secret.c b/crypto/secret.c
>> index 285ab7a..65929ac 100644
>> --- a/crypto/secret.c
>> +++ b/crypto/secret.c
>> @@ -19,6 +19,7 @@
>>   */
>>  
>>  #include "qemu/osdep.h"
>> +#include "qemu/module.h"
>>  #include "crypto/secret.h"
>>  #include "crypto/cipher.h"
>>  #include "qapi/error.h"
>> diff --git a/crypto/tlscreds.c b/crypto/tlscreds.c
>> index 1620e12..edc7f88 100644
>> --- a/crypto/tlscreds.c
>> +++ b/crypto/tlscreds.c
>> @@ -20,6 +20,7 @@
>>  
>>  #include "qemu/osdep.h"
>>  #include "qapi/error.h"
>> +#include "qemu/module.h"
>>  #include "crypto/tlscredspriv.h"
>>  #include "trace.h"
>>  
>> diff --git a/crypto/tlscredsanon.c b/crypto/tlscredsanon.c
>> index 1464220..50df4f0 100644
>> --- a/crypto/tlscredsanon.c
>> +++ b/crypto/tlscredsanon.c
>> @@ -19,6 +19,7 @@
>>   */
>>  
>>  #include "qemu/osdep.h"
>> +#include "qemu/module.h"
>>  #include "crypto/tlscredsanon.h"
>>  #include "crypto/tlscredspriv.h"
>>  #include "qapi/error.h"
>> diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c
>> index 6a0179c..2709b2b 100644
>> --- a/crypto/tlscredsx509.c
>> +++ b/crypto/tlscredsx509.c
>> @@ -19,6 +19,7 @@
>>   */
>>  
>>  #include "qemu/osdep.h"
>> +#include "qemu/module.h"
>>  #include "crypto/tlscredsx509.h"
>>  #include "crypto/tlscredspriv.h"
>>  #include "crypto/secret.h"
>
> It feels like these should be in the previous patch that removes
> qemu-common.h  from the include/crypto files ?

They aren't actually needed then, because qemu/module.h is still
included via some inclusion of qemu-common.h in a header.  But I can
certainly move them to the previous patch anyway, if you'd prefer that.
Since we'll probably defer this patch and the next for a bit, I might
prefer it myself :)

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

* Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers
  2016-03-15 16:31     ` Markus Armbruster
@ 2016-03-15 17:25       ` Paolo Bonzini
  2016-03-15 17:34         ` Peter Maydell
  0 siblings, 1 reply; 33+ messages in thread
From: Paolo Bonzini @ 2016-03-15 17:25 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: peter.maydell, qemu-devel



On 15/03/2016 17:31, Markus Armbruster wrote:
> Paolo Bonzini <pbonzini@redhat.com> writes:
> 
>> On 15/03/2016 16:03, Markus Armbruster wrote:
>>> diff --git a/include/hw/hw.h b/include/hw/hw.h
>>> index 2cb69d5..151d65e 100644
>>> --- a/include/hw/hw.h
>>> +++ b/include/hw/hw.h
>>> @@ -15,6 +15,7 @@
>>>  #include "qemu/module.h"
>>>  
>>>  #ifdef NEED_CPU_H
>>> +#include "cpu.h"
>>>  #if TARGET_LONG_BITS == 64
>>>  #define qemu_put_betl qemu_put_be64
>>>  #define qemu_get_betl qemu_get_be64
>>
>> This actually makes things somewhat worse.  This dependency of hw/hw.h
>> on NEED_CPU_H should go away altogether.
>>
>> Would it be okay to stick to patches 1-13 for now?
> 
> Yes, as long as "for now" approximately means "until 2.7 opens up".
> 
> Proposed plan: I pursue 01-13 now, you rebase your need-cpu-h branch
> onto this work when it's ready, I rebase 14-15 onto yours, and carry on.
> Makes sense?

Yes, totally.  I've already started rebasing and there's nothing else
that sticks out.

Since I have your attention, what about getting rid of fprintf-fn.h and
moving it into qemu/osdep.h?

Paolo

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

* Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers
  2016-03-15 17:25       ` Paolo Bonzini
@ 2016-03-15 17:34         ` Peter Maydell
  2016-03-15 17:44           ` Paolo Bonzini
  2016-03-15 19:03           ` Markus Armbruster
  0 siblings, 2 replies; 33+ messages in thread
From: Peter Maydell @ 2016-03-15 17:34 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Markus Armbruster, QEMU Developers

On 15 March 2016 at 17:25, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Since I have your attention, what about getting rid of fprintf-fn.h and
> moving it into qemu/osdep.h?

Not a lot very osdep-ish about it... If you're going to put it anywhere
then typedefs.h seems more appropriate.

(It's in its own file at the moment as part of a previous idea of
cleaning up qemu-common.h by splitting it into separate parts where
necessary so that only the needed parts could be included by the
code that wanted them.)

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers
  2016-03-15 17:34         ` Peter Maydell
@ 2016-03-15 17:44           ` Paolo Bonzini
  2016-03-15 17:53             ` Peter Maydell
  2016-03-15 19:03           ` Markus Armbruster
  1 sibling, 1 reply; 33+ messages in thread
From: Paolo Bonzini @ 2016-03-15 17:44 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Markus Armbruster, QEMU Developers



On 15/03/2016 18:34, Peter Maydell wrote:
>> > Since I have your attention, what about getting rid of fprintf-fn.h and
>> > moving it into qemu/osdep.h?
> Not a lot very osdep-ish about it... If you're going to put it anywhere
> then typedefs.h seems more appropriate.

Well, osdep.h is the new qemu-common.h.  At least it doesn't include
other^Wtoo many other QEMU header files, but it does have a lot of
prototypes that are even more out of place than fprintf_function.

On the other hand, there are few enough headers that use fprintf-fn.h
that it's feasible to just push it down from qemu-common.h.

Paolo

> (It's in its own file at the moment as part of a previous idea of
> cleaning up qemu-common.h by splitting it into separate parts where
> necessary so that only the needed parts could be included by the
> code that wanted them.)

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

* Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers
  2016-03-15 17:44           ` Paolo Bonzini
@ 2016-03-15 17:53             ` Peter Maydell
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Maydell @ 2016-03-15 17:53 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Markus Armbruster, QEMU Developers

On 15 March 2016 at 17:44, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Well, osdep.h is the new qemu-common.h.  At least it doesn't include
> other^Wtoo many other QEMU header files, but it does have a lot of
> prototypes that are even more out of place than fprintf_function.

Yes, those should be moved to somewhere else, they're in the
wrong place (as noted in the comment at the top of osdep.h).

The comment at the top of osdep.h describes the plan:

 * In an ideal world this header would contain only:
 *  (1) things which everybody needs
 *  (2) things without which code would work on most platforms but
 *      fail to compile or misbehave on a minority of host OSes

and I think we should be aiming to move towards the ideal world
rather than away from it.

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers
  2016-03-15 17:34         ` Peter Maydell
  2016-03-15 17:44           ` Paolo Bonzini
@ 2016-03-15 19:03           ` Markus Armbruster
  1 sibling, 0 replies; 33+ messages in thread
From: Markus Armbruster @ 2016-03-15 19:03 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, QEMU Developers

Peter Maydell <peter.maydell@linaro.org> writes:

> On 15 March 2016 at 17:25, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> Since I have your attention, what about getting rid of fprintf-fn.h and
>> moving it into qemu/osdep.h?
>
> Not a lot very osdep-ish about it... If you're going to put it anywhere
> then typedefs.h seems more appropriate.

Makes sense to me.

> (It's in its own file at the moment as part of a previous idea of
> cleaning up qemu-common.h by splitting it into separate parts where
> necessary so that only the needed parts could be included by the
> code that wanted them.)

Sensible idea, but fprintf_function is hardly worth its very own header.
typedefs.h should do nicely.

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

* Re: [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h
  2016-03-15 15:30 ` [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Paolo Bonzini
@ 2016-03-18  8:47   ` Markus Armbruster
  2016-03-18  9:05     ` Peter Maydell
  0 siblings, 1 reply; 33+ messages in thread
From: Markus Armbruster @ 2016-03-18  8:47 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: peter.maydell, qemu-devel

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 15/03/2016 16:03, Markus Armbruster wrote:
>> This series tackles two issues:
>> 
>> * qapi/error.h and therefore qapi-types.h get included into every file
>>   via qemu/osdep.h.  Touch the QAPI schema, recompile the world.  As
>>   the QAPI maintainer, I get to touch it regularly, so this is an itch
>>   I need to scratch.  PATCH 01-04 drop qapi/error.h from qemu/osdep.h.
>>   Unfortunately, the number of .o depending on qapi-types.h barely
>>   changes, because it gets included by so many other headers.  More
>>   work is needed here.
>> 
>> * qemu-common.h explicitly asks not to be included in headers, but we
>>   do it anyway.  PATCH 05-15 clean that up.  Cuts the number of .o
>>   depending on qemu-common.h from ~95% to ~35%.
>> 
>> For additional motivation, see the "Our use of #include is
>> undisciplined, and what to do about it" thread.
>
> Patches 1-13 and possibly 15 are great.

Is this an R-by or Acked-by for 01-13?

Could they still be considered for 2.6?  Rebasing them eats compile-time
like no tomorrow.

[...]

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

* Re: [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h
  2016-03-18  8:47   ` Markus Armbruster
@ 2016-03-18  9:05     ` Peter Maydell
  2016-03-18  9:55       ` Paolo Bonzini
  0 siblings, 1 reply; 33+ messages in thread
From: Peter Maydell @ 2016-03-18  9:05 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: Paolo Bonzini, QEMU Developers

On 18 March 2016 at 08:47, Markus Armbruster <armbru@redhat.com> wrote:
> Paolo Bonzini <pbonzini@redhat.com> writes:
>
>> On 15/03/2016 16:03, Markus Armbruster wrote:
>>> This series tackles two issues:
>>>
>>> * qapi/error.h and therefore qapi-types.h get included into every file
>>>   via qemu/osdep.h.  Touch the QAPI schema, recompile the world.  As
>>>   the QAPI maintainer, I get to touch it regularly, so this is an itch
>>>   I need to scratch.  PATCH 01-04 drop qapi/error.h from qemu/osdep.h.
>>>   Unfortunately, the number of .o depending on qapi-types.h barely
>>>   changes, because it gets included by so many other headers.  More
>>>   work is needed here.
>>>
>>> * qemu-common.h explicitly asks not to be included in headers, but we
>>>   do it anyway.  PATCH 05-15 clean that up.  Cuts the number of .o
>>>   depending on qemu-common.h from ~95% to ~35%.
>>>
>>> For additional motivation, see the "Our use of #include is
>>> undisciplined, and what to do about it" thread.
>>
>> Patches 1-13 and possibly 15 are great.
>
> Is this an R-by or Acked-by for 01-13?
>
> Could they still be considered for 2.6?  Rebasing them eats
> compile-time like no tomorrow.

If Paolo wants to provide an R-by I'm happy to take them for
2.6 -- the possible failure modes are basically just "something
stops compiling" which should be an easy fix if it happens.
You could make my life easier by sticking them in a pullreq.

PS: master already has a patch to remove config.h.

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h
  2016-03-18  9:05     ` Peter Maydell
@ 2016-03-18  9:55       ` Paolo Bonzini
  0 siblings, 0 replies; 33+ messages in thread
From: Paolo Bonzini @ 2016-03-18  9:55 UTC (permalink / raw)
  To: Peter Maydell, Markus Armbruster; +Cc: QEMU Developers



On 18/03/2016 10:05, Peter Maydell wrote:
> If Paolo wants to provide an R-by I'm happy to take them for
> 2.6 -- the possible failure modes are basically just "something
> stops compiling" which should be an easy fix if it happens.
> You could make my life easier by sticking them in a pullreq.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

A bunch more of files need qapi/error.h now, but it's mechanical so no
need to repost.

Paolo

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

end of thread, other threads:[~2016-03-18  9:55 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-15 15:03 [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 01/15] include/qemu/osdep.h: Don't include qapi/error.h Markus Armbruster
2016-03-15 16:04   ` Paolo Bonzini
2016-03-15 16:26     ` Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 02/15] Use scripts/clean-includes to drop redundant qemu/typedefs.h Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 03/15] include/config.h: Unused, remove Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 04/15] Clean up includes some more Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 05/15] fw_cfg: Split fw_cfg_keys.h off fw_cfg.h Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 06/15] include/qemu/iov.h: Don't include qemu-common.h Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 07/15] include/hw/hw.h: " Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 08/15] hw/pci/pci.h: " Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 09/15] Move HOST_LONG_BITS from qemu-common.h to qemu/osdep.h Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 10/15] Move QEMU_ALIGN_*() " Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 11/15] Move ParallelIOArg from qemu-common.h to sysemu/char.h Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 12/15] isa: Move DMA_transfer_handler from qemu-common.h to hw/isa/isa.h Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 13/15] include/crypto: Include qapi-types.h instead of qemu-common.h Markus Armbruster
2016-03-15 15:51   ` Daniel P. Berrange
2016-03-15 16:24     ` Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 14/15] Don't include qemu-common.h in headers Markus Armbruster
2016-03-15 15:54   ` Daniel P. Berrange
2016-03-15 16:35     ` Markus Armbruster
2016-03-15 15:55   ` Paolo Bonzini
2016-03-15 16:31     ` Markus Armbruster
2016-03-15 17:25       ` Paolo Bonzini
2016-03-15 17:34         ` Peter Maydell
2016-03-15 17:44           ` Paolo Bonzini
2016-03-15 17:53             ` Peter Maydell
2016-03-15 19:03           ` Markus Armbruster
2016-03-15 15:03 ` [Qemu-devel] [PATCH 15/15] Drop superfluous qemu-common.h inclusions Markus Armbruster
2016-03-15 15:30 ` [Qemu-devel] [PATCH 00/15] Clean up around osdep.h and qemu-common.h Paolo Bonzini
2016-03-18  8:47   ` Markus Armbruster
2016-03-18  9:05     ` Peter Maydell
2016-03-18  9:55       ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.