From d6454270575da1f16a8923c7cb240e46ef243f72 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 12 Aug 2019 07:23:45 +0200 Subject: Include migration/vmstate.h less MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In my "build everything" tree, changing migration/vmstate.h triggers a recompile of some 2700 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). hw/hw.h supposedly includes it for convenience. Several other headers include it just to get VMStateDescription. The previous commit made that unnecessary. Include migration/vmstate.h only where it's still needed. Touching it now recompiles only some 1600 objects. Signed-off-by: Markus Armbruster Reviewed-by: Alistair Francis Message-Id: <20190812052359.30071-16-armbru@redhat.com> Tested-by: Philippe Mathieu-Daudé --- migration/savevm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'migration/savevm.c') diff --git a/migration/savevm.c b/migration/savevm.c index 79ed44d475..89e8f4c180 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -32,6 +32,7 @@ #include "net/net.h" #include "migration.h" #include "migration/snapshot.h" +#include "migration/vmstate.h" #include "migration/misc.h" #include "migration/register.h" #include "migration/global_state.h" -- cgit v1.2.3 From db725815985654007ade0fd53590d613fd657208 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 12 Aug 2019 07:23:50 +0200 Subject: Include qemu/main-loop.h less MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In my "build everything" tree, changing qemu/main-loop.h triggers a recompile of some 5600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). It includes block/aio.h, which in turn includes qemu/event_notifier.h, qemu/notify.h, qemu/processor.h, qemu/qsp.h, qemu/queue.h, qemu/thread-posix.h, qemu/thread.h, qemu/timer.h, and a few more. Include qemu/main-loop.h only where it's needed. Touching it now recompiles only some 1700 objects. For block/aio.h and qemu/event_notifier.h, these numbers drop from 5600 to 2800. For the others, they shrink only slightly. Signed-off-by: Markus Armbruster Message-Id: <20190812052359.30071-21-armbru@redhat.com> Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- migration/savevm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'migration/savevm.c') diff --git a/migration/savevm.c b/migration/savevm.c index 89e8f4c180..b8f734537a 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -51,6 +51,7 @@ #include "exec/target_page.h" #include "trace.h" #include "qemu/iov.h" +#include "qemu/main-loop.h" #include "block/snapshot.h" #include "qemu/cutils.h" #include "io/channel-buffer.h" -- cgit v1.2.3 From 46517dd4971fc1fdd5b379e72cc377626ad98160 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 12 Aug 2019 07:23:57 +0200 Subject: Include sysemu/sysemu.h a lot less MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Markus Armbruster Reviewed-by: Alistair Francis Reviewed-by: Stefan Hajnoczi Message-Id: <20190812052359.30071-28-armbru@redhat.com> Reviewed-by: Alex Bennée --- migration/savevm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'migration/savevm.c') diff --git a/migration/savevm.c b/migration/savevm.c index b8f734537a..33da39f0ea 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -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" -- cgit v1.2.3 From 54d31236b906c8f03eb011717de7bc47000720c3 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 12 Aug 2019 07:23:59 +0200 Subject: sysemu: Split sysemu/runstate.h off sysemu/sysemu.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sysemu/sysemu.h is a rather unfocused dumping ground for stuff related to the system-emulator. Evidence: * It's included widely: in my "build everything" tree, changing sysemu/sysemu.h still triggers a recompile of some 1100 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h, down from 5400 due to the previous two commits). * It pulls in more than a dozen additional headers. Split stuff related to run state management into its own header sysemu/runstate.h. Touching sysemu/sysemu.h now recompiles some 850 objects. qemu/uuid.h also drops from 1100 to 850, and qapi/qapi-types-run-state.h from 4400 to 4200. Touching new sysemu/runstate.h recompiles some 500 objects. Since I'm touching MAINTAINERS to add sysemu/runstate.h anyway, also add qemu/main-loop.h. Suggested-by: Paolo Bonzini Signed-off-by: Markus Armbruster Message-Id: <20190812052359.30071-30-armbru@redhat.com> Reviewed-by: Alex Bennée [Unbreak OS-X build] --- migration/savevm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'migration/savevm.c') diff --git a/migration/savevm.c b/migration/savevm.c index 33da39f0ea..fd3c39dc39 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -57,6 +57,7 @@ #include "io/channel-buffer.h" #include "io/channel-file.h" #include "sysemu/replay.h" +#include "sysemu/runstate.h" #include "sysemu/sysemu.h" #include "qjson.h" #include "migration/colo.h" -- cgit v1.2.3