From 64552b6be4758d3a774f7787b294543ccebd5358 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 12 Aug 2019 07:23:42 +0200 Subject: Include hw/irq.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 hw/irq.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/hw.h supposedly includes it for convenience. Several other headers include it just to get qemu_irq and.or qemu_irq_handler. Move the qemu_irq and qemu_irq_handler typedefs from hw/irq.h to qemu/typedefs.h, and then include hw/irq.h only where it's still needed. Touching it now recompiles only some 500 objects. Signed-off-by: Markus Armbruster Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190812052359.30071-13-armbru@redhat.com> --- hw/i386/xen/xen-hvm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/i386/xen') diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index e8e79e0917..f769cd91f2 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -14,6 +14,7 @@ #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" #include "hw/i386/pc.h" +#include "hw/irq.h" #include "hw/i386/apic-msidef.h" #include "hw/xen/xen_common.h" #include "hw/xen/xen-legacy-backend.h" -- cgit v1.2.3 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é --- hw/i386/xen/xen_platform.c | 1 + hw/i386/xen/xen_pvdevice.c | 1 + 2 files changed, 2 insertions(+) (limited to 'hw/i386/xen') diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index 7a972e46cf..800687a188 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -30,6 +30,7 @@ #include "hw/pci/pci.h" #include "hw/irq.h" #include "hw/xen/xen_common.h" +#include "migration/vmstate.h" #include "hw/xen/xen-legacy-backend.h" #include "trace.h" #include "exec/address-spaces.h" diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c index 23748f36a2..700db81cbc 100644 --- a/hw/i386/xen/xen_pvdevice.c +++ b/hw/i386/xen/xen_pvdevice.c @@ -34,6 +34,7 @@ #include "qemu/module.h" #include "hw/hw.h" #include "hw/pci/pci.h" +#include "migration/vmstate.h" #include "trace.h" #define TYPE_XEN_PV_DEVICE "xen-pvdevice" -- cgit v1.2.3 From 650d103d3ea959212f826acb9d3fe80cf30e347b Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 12 Aug 2019 07:23:48 +0200 Subject: Include hw/hw.h exactly where needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In my "build everything" tree, changing hw/hw.h triggers a recompile of some 2600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). The previous commits have left only the declaration of hw_error() in hw/hw.h. This permits dropping most of its inclusions. Touching it now recompiles less than 200 objects. Signed-off-by: Markus Armbruster Reviewed-by: Alistair Francis Message-Id: <20190812052359.30071-19-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- hw/i386/xen/xen-hvm.c | 1 + hw/i386/xen/xen_platform.c | 1 - hw/i386/xen/xen_pvdevice.c | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) (limited to 'hw/i386/xen') diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index f769cd91f2..63abace70a 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -15,6 +15,7 @@ #include "hw/pci/pci_host.h" #include "hw/i386/pc.h" #include "hw/irq.h" +#include "hw/hw.h" #include "hw/i386/apic-msidef.h" #include "hw/xen/xen_common.h" #include "hw/xen/xen-legacy-backend.h" diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index 800687a188..0f7b05e5e1 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -25,7 +25,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" -#include "hw/hw.h" #include "hw/ide.h" #include "hw/pci/pci.h" #include "hw/irq.h" diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c index 700db81cbc..10c89cda41 100644 --- a/hw/i386/xen/xen_pvdevice.c +++ b/hw/i386/xen/xen_pvdevice.c @@ -32,7 +32,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/module.h" -#include "hw/hw.h" #include "hw/pci/pci.h" #include "migration/vmstate.h" #include "trace.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é --- hw/i386/xen/xen-hvm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/i386/xen') diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 63abace70a..3e15ffc828 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -23,6 +23,7 @@ #include "qapi/error.h" #include "qapi/qapi-commands-misc.h" #include "qemu/error-report.h" +#include "qemu/main-loop.h" #include "qemu/range.h" #include "sysemu/xen-mapcache.h" #include "trace.h" -- cgit v1.2.3 From a27bd6c779badb8d76e4430d810ef710a1b98f4e Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 12 Aug 2019 07:23:51 +0200 Subject: Include hw/qdev-properties.h less MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In my "build everything" tree, changing hw/qdev-properties.h triggers a recompile of some 2700 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). Many places including hw/qdev-properties.h (directly or via hw/qdev.h) actually need only hw/qdev-core.h. Include hw/qdev-core.h there instead. hw/qdev.h is actually pointless: all it does is include hw/qdev-core.h and hw/qdev-properties.h, which in turn includes hw/qdev-core.h. Replace the remaining uses of hw/qdev.h by hw/qdev-properties.h. While there, delete a few superfluous inclusions of hw/qdev-core.h. Touching hw/qdev-properties.h now recompiles some 1200 objects. Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Signed-off-by: Markus Armbruster Reviewed-by: Eduardo Habkost Message-Id: <20190812052359.30071-22-armbru@redhat.com> --- hw/i386/xen/xen_pvdevice.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/i386/xen') diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c index 10c89cda41..27f646da06 100644 --- a/hw/i386/xen/xen_pvdevice.c +++ b/hw/i386/xen/xen_pvdevice.c @@ -33,6 +33,7 @@ #include "qapi/error.h" #include "qemu/module.h" #include "hw/pci/pci.h" +#include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "trace.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 --- hw/i386/xen/xen-hvm.c | 1 + hw/i386/xen/xen-mapcache.c | 1 + 2 files changed, 2 insertions(+) (limited to 'hw/i386/xen') diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 3e15ffc828..ca4659b20f 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -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" diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c index dc73c86c61..09656f9f11 100644 --- a/hw/i386/xen/xen-mapcache.c +++ b/hw/i386/xen/xen-mapcache.c @@ -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" -- 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] --- hw/i386/xen/xen-hvm.c | 1 + hw/i386/xen/xen-mapcache.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'hw/i386/xen') diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index ca4659b20f..5d3e4750e6 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -25,6 +25,7 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/range.h" +#include "sysemu/runstate.h" #include "sysemu/sysemu.h" #include "sysemu/xen-mapcache.h" #include "trace.h" diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c index 09656f9f11..5b120ed44b 100644 --- a/hw/i386/xen/xen-mapcache.c +++ b/hw/i386/xen/xen-mapcache.c @@ -17,7 +17,7 @@ #include "hw/xen/xen-legacy-backend.h" #include "qemu/bitmap.h" -#include "sysemu/sysemu.h" +#include "sysemu/runstate.h" #include "sysemu/xen-mapcache.h" #include "trace.h" -- cgit v1.2.3