]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Include sysemu/sysemu.h a lot less
authorMarkus Armbruster <armbru@redhat.com>
Mon, 12 Aug 2019 05:23:57 +0000 (07:23 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 16 Aug 2019 11:31:53 +0000 (13:31 +0200)
In my "build everything" tree, changing sysemu/sysemu.h triggers a
recompile of some 5400 out of 6600 objects (not counting tests and
objects that don't depend on qemu/osdep.h).

hw/qdev-core.h includes sysemu/sysemu.h since recent commit e965ffa70a
"qdev: add qdev_add_vm_change_state_handler()".  This is a bad idea:
hw/qdev-core.h is widely included.

Move the declaration of qdev_add_vm_change_state_handler() to
sysemu/sysemu.h, and drop the problematic include from hw/qdev-core.h.

Touching sysemu/sysemu.h now recompiles some 1800 objects.
qemu/uuid.h also drops from 5400 to 1800.  A few more headers show
smaller improvement: qemu/notify.h drops from 5600 to 5200,
qemu/timer.h from 5600 to 4500, and qapi/qapi-types-run-state.h from
5500 to 5000.

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20190812052359.30071-28-armbru@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
31 files changed:
accel/kvm/kvm-all.c
backends/hostmem.c
cpus.c
hw/arm/allwinner-a10.c
hw/arm/aspeed_soc.c
hw/arm/kzm.c
hw/arm/msf2-soc.c
hw/arm/stm32f205_soc.c
hw/char/serial-isa.c
hw/char/xen_console.c
hw/core/numa.c
hw/core/vm-change-state-handler.c
hw/display/qxl-render.c
hw/i386/xen/xen-hvm.c
hw/i386/xen/xen-mapcache.c
hw/intc/ioapic.c
hw/pci/pci.c
hw/riscv/sifive_e.c
hw/riscv/sifive_u.c
hw/riscv/spike.c
hw/riscv/virt.c
hw/sparc64/niagara.c
hw/usb/hcd-ehci.h
hw/xen/xen-common.c
hw/xen/xen_devconfig.c
hw/xenpv/xen_machine_pv.c
include/hw/qdev-core.h
include/sysemu/sysemu.h
migration/global_state.c
migration/migration.c
migration/savevm.c

index e1a44eccf5bd6e88f816817300ddab205759fc72..fc38d0b9e3cd94dfd010e0ed0405826570f6159c 100644 (file)
@@ -29,6 +29,7 @@
 #include "exec/gdbstub.h"
 #include "sysemu/kvm_int.h"
 #include "sysemu/cpus.h"
+#include "sysemu/sysemu.h"
 #include "qemu/bswap.h"
 #include "exec/memory.h"
 #include "exec/ram_addr.h"
index 463102aa15df7d21fd034c02dfb68770d9342431..6d333dc23c560dd08d237aae8eb391ae84a691e9 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "qemu/osdep.h"
 #include "sysemu/hostmem.h"
+#include "sysemu/sysemu.h"
 #include "hw/boards.h"
 #include "qapi/error.h"
 #include "qapi/qapi-builtin-visit.h"
diff --git a/cpus.c b/cpus.c
index e70cc58e316fe90634800a5f0c5814db170ea819..a20a9a29c1c2e4a6d7d80b28dfb7d784f06efbed 100644 (file)
--- a/cpus.c
+++ b/cpus.c
@@ -41,6 +41,7 @@
 #include "sysemu/kvm.h"
 #include "sysemu/hax.h"
 #include "sysemu/hvf.h"
+#include "sysemu/sysemu.h"
 #include "sysemu/whpx.h"
 #include "exec/exec-all.h"
 
index 3b0d3eccddf85840c82cb857d19c0d0a82a6fb2c..73810a4440239e22f23de5ae5aafdff6efc89e69 100644 (file)
@@ -23,6 +23,7 @@
 #include "hw/sysbus.h"
 #include "hw/arm/allwinner-a10.h"
 #include "hw/misc/unimp.h"
+#include "sysemu/sysemu.h"
 
 static void aw_a10_init(Object *obj)
 {
index c6fb3700f27ea871097846af29896ce219b4dd21..9ee81048326e9d761d7440132378b7184c88aba5 100644 (file)
@@ -22,6 +22,7 @@
 #include "qemu/error-report.h"
 #include "hw/i2c/aspeed_i2c.h"
 #include "net/net.h"
+#include "sysemu/sysemu.h"
 
 #define ASPEED_SOC_IOMEM_SIZE       0x00200000
 
index 59d2102dc5e2ccc5020838614129db7ac1bf15dd..2f052e1f8c95dc10c369b54a7b50bcfb3c76c2ac 100644 (file)
@@ -24,6 +24,7 @@
 #include "hw/net/lan9118.h"
 #include "hw/char/serial.h"
 #include "sysemu/qtest.h"
+#include "sysemu/sysemu.h"
 
 /* Memory map for Kzm Emulation Baseboard:
  * 0x00000000-0x7fffffff See i.MX31 SOC for support
index 8ae763f99f139fa3917c93f0782b37a931677788..76cc3e09b0a3c024f3f7c11ce180b0d2e258c2ce 100644 (file)
@@ -30,6 +30,7 @@
 #include "hw/irq.h"
 #include "hw/arm/msf2-soc.h"
 #include "hw/misc/unimp.h"
+#include "sysemu/sysemu.h"
 
 #define MSF2_TIMER_BASE       0x40004000
 #define MSF2_SYSREG_BASE      0x40038000
index be8b7df67920f9d977500328cd01fdb1abb42ae0..f5a5c2d80ccf0b3294c1f5a7be99823c7d97a5ac 100644 (file)
@@ -29,6 +29,7 @@
 #include "exec/address-spaces.h"
 #include "hw/arm/stm32f205_soc.h"
 #include "hw/qdev-properties.h"
+#include "sysemu/sysemu.h"
 
 /* At the moment only Timer 2 to 5 are modelled */
 static const uint32_t timer_addr[STM_NUM_TIMERS] = { 0x40000000, 0x40000400,
index 5a0ae02ee719a5448029d6d0016dcea10cb23068..9e31c51bb6864a200f7cb9c4e6259d6dc8d04bd7 100644 (file)
@@ -26,6 +26,7 @@
 #include "qemu/osdep.h"
 #include "qapi/error.h"
 #include "qemu/module.h"
+#include "sysemu/sysemu.h"
 #include "hw/char/serial.h"
 #include "hw/isa/isa.h"
 #include "hw/qdev-properties.h"
index 8cc9328b3fa64a0cd35ffd1b9e80d31dc4a903cd..63153dfde40a7848daf4a547d2fd77fa063080de 100644 (file)
@@ -24,6 +24,7 @@
 #include <termios.h>
 
 #include "qapi/error.h"
+#include "sysemu/sysemu.h"
 #include "chardev/char-fe.h"
 #include "hw/xen/xen-legacy-backend.h"
 
index 450c522dd825e81781a0949d06556cdbdc2e1379..7a63ddc4c67c85939e98345e55a597ef6b485b6f 100644 (file)
@@ -25,6 +25,7 @@
 #include "qemu/osdep.h"
 #include "sysemu/hostmem.h"
 #include "sysemu/numa.h"
+#include "sysemu/sysemu.h"
 #include "exec/cpu-common.h"
 #include "exec/ramlist.h"
 #include "qemu/bitmap.h"
index e27ea45977498f59671f3ef164052396a922813d..9068d51c9a10b4979504b9cff25982eb8983b153 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "qemu/osdep.h"
 #include "hw/qdev-core.h"
+#include "sysemu/sysemu.h"
 
 static int qdev_get_dev_tree_depth(DeviceState *dev)
 {
index 14ad2b352d32e67ee2fd4ba4c493409d75a68cba..473e3334756f06eada5306e03f6b3d3e6fff78fe 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "qemu/osdep.h"
 #include "qxl.h"
+#include "sysemu/sysemu.h"
 #include "trace.h"
 
 static void qxl_blit(PCIQXLDevice *qxl, QXLRect *rect)
index 3e15ffc828284e9736969fc9de5219f231e1d986..ca4659b20fe3f189ddcf7e9016c51b758081bbe2 100644 (file)
@@ -25,6 +25,7 @@
 #include "qemu/error-report.h"
 #include "qemu/main-loop.h"
 #include "qemu/range.h"
+#include "sysemu/sysemu.h"
 #include "sysemu/xen-mapcache.h"
 #include "trace.h"
 #include "exec/address-spaces.h"
index dc73c86c61bf7197aedc4afb49355ed0cd13ce06..09656f9f115031063328f6362510f155b46219ed 100644 (file)
@@ -17,6 +17,7 @@
 #include "hw/xen/xen-legacy-backend.h"
 #include "qemu/bitmap.h"
 
+#include "sysemu/sysemu.h"
 #include "sysemu/xen-mapcache.h"
 #include "trace.h"
 
index dddd231337595f2404260692aa56fc6b894dcaa2..1ede055387ca80c4f8cef8809fccbee7431b6d92 100644 (file)
@@ -30,6 +30,7 @@
 #include "hw/pci/msi.h"
 #include "hw/qdev-properties.h"
 #include "sysemu/kvm.h"
+#include "sysemu/sysemu.h"
 #include "hw/i386/apic-msidef.h"
 #include "hw/i386/x86-iommu.h"
 #include "trace.h"
index 4b6ffab13dab8e102ebed4eb94ea994e3f20a6ab..aa05c2b9b24e86934f8f394059b4cd9f68e2da84 100644 (file)
@@ -35,6 +35,7 @@
 #include "monitor/monitor.h"
 #include "net/net.h"
 #include "sysemu/numa.h"
+#include "sysemu/sysemu.h"
 #include "hw/loader.h"
 #include "qemu/error-report.h"
 #include "qemu/range.h"
index 862903d6b5b03f19d2cdd99a68dfdd72142bda43..792d75a1a394477f65d6f4712405a38aa285bade 100644 (file)
@@ -46,6 +46,7 @@
 #include "hw/riscv/boot.h"
 #include "chardev/char.h"
 #include "sysemu/arch_init.h"
+#include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
 
 static const struct MemmapEntry {
index 0b3c5dff97219ce7120eab5c821493181eeaa85f..9910fa670823ed52bda13e3882da4261e7cc1d6d 100644 (file)
@@ -44,6 +44,7 @@
 #include "chardev/char.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/device_tree.h"
+#include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
 
 #include <libfdt.h>
index 9cc786b6b6f21946800aab174a32e75e1d354ac7..7c04bd554f01ed3bcd0d551db3a7f9f3c25ff090 100644 (file)
@@ -40,6 +40,7 @@
 #include "sysemu/arch_init.h"
 #include "sysemu/device_tree.h"
 #include "sysemu/qtest.h"
+#include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
 
 #include <libfdt.h>
index c72198b72014646bba94e01782059de18f0e055d..9bced284864339ea8e6dbd9ff2235bf5e3bc7d84 100644 (file)
@@ -37,6 +37,7 @@
 #include "chardev/char.h"
 #include "sysemu/arch_init.h"
 #include "sysemu/device_tree.h"
+#include "sysemu/sysemu.h"
 #include "exec/address-spaces.h"
 #include "hw/pci/pci.h"
 #include "hw/pci-host/gpex.h"
index 1efcff628a41856ec47faf63e330afc53f1488cb..167143bffe997671e337ceae8e564332a6fa629e 100644 (file)
@@ -35,7 +35,7 @@
 #include "sysemu/block-backend.h"
 #include "qemu/error-report.h"
 #include "sysemu/qtest.h"
-
+#include "sysemu/sysemu.h"
 
 typedef struct NiagaraBoardState {
     MemoryRegion hv_ram;
index 0298238f0b9a8c50d6a112634d4ae3fabd7a74ef..fdbcfdcbeb9202a283b3f3f693c9cbc20a0af0b0 100644 (file)
@@ -21,6 +21,7 @@
 #include "qemu/timer.h"
 #include "hw/usb.h"
 #include "sysemu/dma.h"
+#include "sysemu/sysemu.h"
 #include "hw/pci/pci.h"
 #include "hw/sysbus.h"
 
index 32503cfc1cd1d10528df07833addabc7fa3f1408..76621da2f52f1b7f3e958b3ba8872743931c4317 100644 (file)
@@ -14,6 +14,7 @@
 #include "hw/xen/xen-legacy-backend.h"
 #include "chardev/char.h"
 #include "sysemu/accel.h"
+#include "sysemu/sysemu.h"
 #include "migration/misc.h"
 #include "migration/global_state.h"
 
index 315dbc9c515333f25d0d52a436f7f81607ee8408..46ee4a7f0248642af610a6550f32f70143fff273 100644 (file)
@@ -2,6 +2,7 @@
 #include "hw/xen/xen-legacy-backend.h"
 #include "qemu/option.h"
 #include "sysemu/blockdev.h"
+#include "sysemu/sysemu.h"
 
 /* ------------------------------------------------------------- */
 
index 524d608eab2015567907945411ee5504d19e5855..3a8af1a1e074a9c14bfba2d8e04c7e21346feea5 100644 (file)
@@ -28,6 +28,7 @@
 #include "hw/xen/xen-legacy-backend.h"
 #include "hw/xen/xen-bus.h"
 #include "sysemu/block-backend.h"
+#include "sysemu/sysemu.h"
 
 static void xen_init_pv(MachineState *machine)
 {
index e5b62dd2fc0eac3376032ba79d977670e75e2d0f..de70b7a19af201a0571f8d116337e97a7581f39c 100644 (file)
@@ -5,7 +5,6 @@
 #include "qemu/bitmap.h"
 #include "qom/object.h"
 #include "hw/hotplug.h"
-#include "sysemu/sysemu.h"
 
 enum {
     DEV_NVECTORS_UNSPECIFIED = -1,
@@ -451,8 +450,4 @@ static inline bool qbus_is_hotpluggable(BusState *bus)
 void device_listener_register(DeviceListener *listener);
 void device_listener_unregister(DeviceListener *listener);
 
-VMChangeStateEntry *qdev_add_vm_change_state_handler(DeviceState *dev,
-                                                     VMChangeStateHandler *cb,
-                                                     void *opaque);
-
 #endif
index 227202999da42c10c0726edcdd2ddcee233322b6..908f15867709434b16c2cc17e0ca74221900273f 100644 (file)
@@ -29,6 +29,9 @@ VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,
                                                      void *opaque);
 VMChangeStateEntry *qemu_add_vm_change_state_handler_prio(
         VMChangeStateHandler *cb, void *opaque, int priority);
+VMChangeStateEntry *qdev_add_vm_change_state_handler(DeviceState *dev,
+                                                     VMChangeStateHandler *cb,
+                                                     void *opaque);
 void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
 void vm_state_notify(int running, RunState state);
 
index 2c8c447239673df1d715c598def3124a3d1a61ba..7cba868979abc8ea09db71905f72b262a95ec739 100644 (file)
@@ -13,6 +13,7 @@
 #include "qemu/osdep.h"
 #include "qemu/cutils.h"
 #include "qemu/error-report.h"
+#include "sysemu/sysemu.h"
 #include "qapi/error.h"
 #include "migration.h"
 #include "migration/global_state.h"
index 3a6340f602118c792fb4ef3b9f6689f6f2f34e69..2986b8b164217b734dfa1fbd4d449fc7fea8e38f 100644 (file)
@@ -21,6 +21,7 @@
 #include "exec.h"
 #include "fd.h"
 #include "socket.h"
+#include "sysemu/sysemu.h"
 #include "rdma.h"
 #include "ram.h"
 #include "migration/global_state.h"
index b8f734537a6289e305d3d9d5819358354b6fe476..33da39f0eabe7d491e5924cebd431181ddad8c58 100644 (file)
@@ -57,6 +57,7 @@
 #include "io/channel-buffer.h"
 #include "io/channel-file.h"
 #include "sysemu/replay.h"
+#include "sysemu/sysemu.h"
 #include "qjson.h"
 #include "migration/colo.h"
 #include "qemu/bitmap.h"