From 71e8a915855857e0d45b322826778516cc3e3055 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 12 Aug 2019 07:23:38 +0200 Subject: Include sysemu/reset.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/reset.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 main culprit is hw/hw.h, which supposedly includes it for convenience. Include sysemu/reset.h only where it's needed. Touching it now recompiles less than 200 objects. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Tested-by: Philippe Mathieu-Daudé Message-Id: <20190812052359.30071-9-armbru@redhat.com> --- vl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'vl.c') diff --git a/vl.c b/vl.c index b426b32134..1abfd306e3 100644 --- a/vl.c +++ b/vl.c @@ -30,6 +30,7 @@ #include "qemu/cutils.h" #include "qemu/help_option.h" #include "qemu/uuid.h" +#include "sysemu/reset.h" #include "sysemu/seccomp.h" #include "sysemu/tcg.h" -- 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é --- vl.c | 1 - 1 file changed, 1 deletion(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 1abfd306e3..20328e682c 100644 --- a/vl.c +++ b/vl.c @@ -55,7 +55,6 @@ int main(int argc, char **argv) #include "qemu/error-report.h" #include "qemu/sockets.h" -#include "hw/hw.h" #include "sysemu/accel.h" #include "hw/usb.h" #include "hw/isa/isa.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> --- vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 20328e682c..08ef28f100 100644 --- a/vl.c +++ b/vl.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "qemu/units.h" +#include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu-version.h" #include "qemu/cutils.h" @@ -65,7 +66,6 @@ int main(int argc, char **argv) #include "hw/firmware/smbios.h" #include "hw/acpi/acpi.h" #include "hw/xen/xen.h" -#include "hw/qdev.h" #include "hw/loader.h" #include "monitor/qdev.h" #include "sysemu/bt.h" -- cgit v1.2.3 From 2f780b6a91fe99652266004bf78191ceddfae09c Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 12 Aug 2019 07:23:58 +0200 Subject: sysemu: Move the VMChangeStateEntry typedef to qemu/typedefs.h 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 1800 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h, down from 5400 due to the previous commit). Several headers include sysemu/sysemu.h just to get typedef VMChangeStateEntry. Move it from sysemu/sysemu.h to qemu/typedefs.h. Spell its structure tag the same while there. Drop the now superfluous includes of sysemu/sysemu.h from headers. Touching sysemu/sysemu.h now recompiles some 1100 objects. qemu/uuid.h also drops from 1800 to 1100, and qapi/qapi-types-run-state.h from 5000 to 4400. Signed-off-by: Markus Armbruster Message-Id: <20190812052359.30071-29-armbru@redhat.com> Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- vl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 08ef28f100..9dbbce4ce3 100644 --- a/vl.c +++ b/vl.c @@ -1362,14 +1362,14 @@ static int machine_help_func(QemuOpts *opts, MachineState *machine) return 1; } -struct vm_change_state_entry { +struct VMChangeStateEntry { VMChangeStateHandler *cb; void *opaque; - QTAILQ_ENTRY(vm_change_state_entry) entries; + QTAILQ_ENTRY(VMChangeStateEntry) entries; int priority; }; -static QTAILQ_HEAD(, vm_change_state_entry) vm_change_state_head; +static QTAILQ_HEAD(, VMChangeStateEntry) vm_change_state_head; /** * qemu_add_vm_change_state_handler_prio: -- 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] --- vl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'vl.c') diff --git a/vl.c b/vl.c index 9dbbce4ce3..7617455ce4 100644 --- a/vl.c +++ b/vl.c @@ -32,6 +32,7 @@ #include "qemu/help_option.h" #include "qemu/uuid.h" #include "sysemu/reset.h" +#include "sysemu/runstate.h" #include "sysemu/seccomp.h" #include "sysemu/tcg.h" -- cgit v1.2.3