Skip to content

Commit

Permalink
Include migration/qemu-file-types.h a lot less
Browse files Browse the repository at this point in the history
In my "build everything" tree, changing migration/qemu-file-types.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 culprit is again hw/hw.h, which supposedly includes it for
convenience.

Include migration/qemu-file-types.h only where it's needed.  Touching
it now recompiles less than 200 objects.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190812052359.30071-10-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
  • Loading branch information
Markus Armbruster committed Aug 16, 2019
1 parent 71e8a91 commit ca77ee2
Show file tree
Hide file tree
Showing 31 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions hw/acpi/piix4.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "hw/acpi/memory_hotplug.h"
#include "hw/acpi/acpi_dev_interface.h"
#include "hw/xen/xen.h"
#include "migration/qemu-file-types.h"
#include "qom/cpu.h"
#include "trace.h"

Expand Down
1 change: 1 addition & 0 deletions hw/block/virtio-blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
# include <scsi/sg.h>
#endif
#include "hw/virtio/virtio-bus.h"
#include "migration/qemu-file-types.h"
#include "hw/virtio/virtio-access.h"

/* Config size before the discard support (hide associated config fields) */
Expand Down
1 change: 1 addition & 0 deletions hw/char/virtio-serial-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "qapi/error.h"
#include "qemu/iov.h"
#include "qemu/module.h"
#include "migration/qemu-file-types.h"
#include "monitor/monitor.h"
#include "qemu/error-report.h"
#include "qemu/queue.h"
Expand Down
1 change: 1 addition & 0 deletions hw/display/virtio-gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "trace.h"
#include "sysemu/dma.h"
#include "hw/virtio/virtio.h"
#include "migration/qemu-file-types.h"
#include "hw/virtio/virtio-gpu.h"
#include "hw/virtio/virtio-gpu-bswap.h"
#include "hw/virtio/virtio-gpu-pixman.h"
Expand Down
1 change: 1 addition & 0 deletions hw/intc/apic_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "sysemu/kvm.h"
#include "hw/qdev.h"
#include "hw/sysbus.h"
#include "migration/qemu-file-types.h"

static int apic_irq_delivered;
bool apic_report_tpr_access;
Expand Down
1 change: 1 addition & 0 deletions hw/intc/s390_flic_kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "hw/s390x/s390_flic.h"
#include "hw/s390x/adapter.h"
#include "hw/s390x/css.h"
#include "migration/qemu-file-types.h"
#include "trace.h"

#define FLIC_SAVE_INITIAL_SIZE getpagesize()
Expand Down
1 change: 1 addition & 0 deletions hw/nvram/eeprom93xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "qemu/osdep.h"
#include "hw/hw.h"
#include "hw/nvram/eeprom93xx.h"
#include "migration/qemu-file-types.h"

/* Debug EEPROM emulation. */
//~ #define DEBUG_EEPROM
Expand Down
1 change: 1 addition & 0 deletions hw/nvram/fw_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "hw/boards.h"
#include "hw/nvram/fw_cfg.h"
#include "hw/sysbus.h"
#include "migration/qemu-file-types.h"
#include "trace.h"
#include "qemu/error-report.h"
#include "qemu/option.h"
Expand Down
1 change: 1 addition & 0 deletions hw/pci-host/piix.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "qapi/error.h"
#include "qemu/range.h"
#include "hw/xen/xen.h"
#include "migration/qemu-file-types.h"
#include "hw/pci-host/pam.h"
#include "sysemu/reset.h"
#include "sysemu/sysemu.h"
Expand Down
1 change: 1 addition & 0 deletions hw/pci/msix.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "hw/pci/msix.h"
#include "hw/pci/pci.h"
#include "hw/xen/xen.h"
#include "migration/qemu-file-types.h"
#include "qemu/range.h"
#include "qapi/error.h"
#include "trace.h"
Expand Down
1 change: 1 addition & 0 deletions hw/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "hw/pci/pci_bridge.h"
#include "hw/pci/pci_bus.h"
#include "hw/pci/pci_host.h"
#include "migration/qemu-file-types.h"
#include "monitor/monitor.h"
#include "net/net.h"
#include "sysemu/sysemu.h"
Expand Down
1 change: 1 addition & 0 deletions hw/pci/shpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "qemu/range.h"
#include "qemu/error-report.h"
#include "hw/pci/shpc.h"
#include "migration/qemu-file-types.h"
#include "hw/pci/pci.h"
#include "hw/pci/pci_bus.h"
#include "hw/pci/msi.h"
Expand Down
1 change: 1 addition & 0 deletions hw/ppc/spapr.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "sysemu/hw_accel.h"
#include "kvm_ppc.h"
#include "migration/misc.h"
#include "migration/qemu-file-types.h"
#include "migration/global_state.h"
#include "migration/register.h"
#include "mmu-hash64.h"
Expand Down
1 change: 1 addition & 0 deletions hw/s390x/s390-skeys.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "qapi/qmp/qdict.h"
#include "qemu/error-report.h"
#include "sysemu/kvm.h"
#include "migration/qemu-file-types.h"
#include "migration/register.h"

#define S390_SKEYS_BUFFER_SIZE (128 * KiB) /* Room for 128k storage keys */
Expand Down
1 change: 1 addition & 0 deletions hw/s390x/tod.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "sysemu/kvm.h"
#include "migration/qemu-file-types.h"
#include "migration/register.h"

void s390_init_tod(void)
Expand Down
1 change: 1 addition & 0 deletions hw/s390x/virtio-ccw.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "sysemu/kvm.h"
#include "net/net.h"
#include "hw/virtio/virtio.h"
#include "migration/qemu-file-types.h"
#include "hw/virtio/virtio-net.h"
#include "hw/sysbus.h"
#include "qemu/bitops.h"
Expand Down
1 change: 1 addition & 0 deletions hw/scsi/mptsas.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "trace.h"
#include "qapi/error.h"
#include "mptsas.h"
#include "migration/qemu-file-types.h"
#include "mpi.h"

#define NAA_LOCALLY_ASSIGNED_ID 0x3ULL
Expand Down
1 change: 1 addition & 0 deletions hw/scsi/scsi-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "qemu/module.h"
#include "qemu/option.h"
#include "hw/scsi/scsi.h"
#include "migration/qemu-file-types.h"
#include "scsi/constants.h"
#include "hw/qdev.h"
#include "sysemu/block-backend.h"
Expand Down
1 change: 1 addition & 0 deletions hw/scsi/scsi-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "hw/scsi/scsi.h"
#include "migration/qemu-file-types.h"
#include "hw/scsi/emulation.h"
#include "scsi/constants.h"
#include "sysemu/sysemu.h"
Expand Down
1 change: 1 addition & 0 deletions hw/scsi/scsi-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "hw/scsi/scsi.h"
#include "migration/qemu-file-types.h"
#include "hw/scsi/emulation.h"
#include "sysemu/block-backend.h"
#include "trace.h"
Expand Down
1 change: 1 addition & 0 deletions hw/scsi/virtio-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "qapi/error.h"
#include "standard-headers/linux/virtio_ids.h"
#include "hw/virtio/virtio-scsi.h"
#include "migration/qemu-file-types.h"
#include "qemu/error-report.h"
#include "qemu/iov.h"
#include "qemu/module.h"
Expand Down
1 change: 1 addition & 0 deletions hw/timer/i8254_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "qemu/timer.h"
#include "hw/timer/i8254.h"
#include "hw/timer/i8254_internal.h"
#include "migration/qemu-file-types.h"

/* val must be 0 or 1 */
void pit_set_gate(ISADevice *dev, int channel, int val)
Expand Down
1 change: 1 addition & 0 deletions hw/timer/twl92230.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "hw/hw.h"
#include "qemu/timer.h"
#include "hw/i2c/i2c.h"
#include "migration/qemu-file-types.h"
#include "sysemu/sysemu.h"
#include "ui/console.h"
#include "qemu/bcd.h"
Expand Down
1 change: 1 addition & 0 deletions hw/usb/redirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <usbredirfilter.h>

#include "hw/usb.h"
#include "migration/qemu-file-types.h"

/* ERROR is defined below. Remove any previous definition. */
#undef ERROR
Expand Down
1 change: 1 addition & 0 deletions hw/virtio/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "hw/virtio/virtio-bus.h"
#include "hw/virtio/virtio-access.h"
#include "migration/blocker.h"
#include "migration/qemu-file-types.h"
#include "sysemu/dma.h"
#include "trace.h"

Expand Down
1 change: 1 addition & 0 deletions hw/virtio/virtio-mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "standard-headers/linux/virtio_mmio.h"
#include "hw/sysbus.h"
#include "hw/virtio/virtio.h"
#include "migration/qemu-file-types.h"
#include "qemu/host-utils.h"
#include "qemu/module.h"
#include "sysemu/kvm.h"
Expand Down
1 change: 1 addition & 0 deletions hw/virtio/virtio-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "standard-headers/linux/virtio_pci.h"
#include "hw/virtio/virtio.h"
#include "migration/qemu-file-types.h"
#include "hw/pci/pci.h"
#include "hw/pci/pci_bus.h"
#include "qapi/error.h"
Expand Down
1 change: 1 addition & 0 deletions hw/virtio/virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "hw/virtio/virtio.h"
#include "migration/qemu-file-types.h"
#include "qemu/atomic.h"
#include "hw/virtio/virtio-bus.h"
#include "hw/virtio/virtio-access.h"
Expand Down
1 change: 0 additions & 1 deletion include/hw/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "exec/memory.h"
#include "hw/irq.h"
#include "migration/vmstate.h"
#include "migration/qemu-file-types.h"

void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);

Expand Down
1 change: 1 addition & 0 deletions include/migration/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#define MIGRATION_CPU_H

#include "exec/cpu-defs.h"
#include "migration/qemu-file-types.h"

#if TARGET_LONG_BITS == 64
#define qemu_put_betl qemu_put_be64
Expand Down
1 change: 1 addition & 0 deletions target/ppc/kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "hw/ppc/spapr.h"
#include "hw/ppc/spapr_cpu_core.h"
#include "hw/ppc/ppc.h"
#include "migration/qemu-file-types.h"
#include "sysemu/watchdog.h"
#include "trace.h"
#include "exec/gdbstub.h"
Expand Down

0 comments on commit ca77ee2

Please sign in to comment.