浏览代码

Include migration/qemu-file-types.h a lot less

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>
Markus Armbruster 6 年之前
父节点
当前提交
ca77ee28e0

+ 1 - 0
hw/acpi/piix4.c

@@ -40,6 +40,7 @@
 #include "hw/acpi/memory_hotplug.h"
 #include "hw/acpi/memory_hotplug.h"
 #include "hw/acpi/acpi_dev_interface.h"
 #include "hw/acpi/acpi_dev_interface.h"
 #include "hw/xen/xen.h"
 #include "hw/xen/xen.h"
+#include "migration/qemu-file-types.h"
 #include "qom/cpu.h"
 #include "qom/cpu.h"
 #include "trace.h"
 #include "trace.h"
 
 

+ 1 - 0
hw/block/virtio-blk.c

@@ -26,6 +26,7 @@
 # include <scsi/sg.h>
 # include <scsi/sg.h>
 #endif
 #endif
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-bus.h"
+#include "migration/qemu-file-types.h"
 #include "hw/virtio/virtio-access.h"
 #include "hw/virtio/virtio-access.h"
 
 
 /* Config size before the discard support (hide associated config fields) */
 /* Config size before the discard support (hide associated config fields) */

+ 1 - 0
hw/char/virtio-serial-bus.c

@@ -22,6 +22,7 @@
 #include "qapi/error.h"
 #include "qapi/error.h"
 #include "qemu/iov.h"
 #include "qemu/iov.h"
 #include "qemu/module.h"
 #include "qemu/module.h"
+#include "migration/qemu-file-types.h"
 #include "monitor/monitor.h"
 #include "monitor/monitor.h"
 #include "qemu/error-report.h"
 #include "qemu/error-report.h"
 #include "qemu/queue.h"
 #include "qemu/queue.h"

+ 1 - 0
hw/display/virtio-gpu.c

@@ -18,6 +18,7 @@
 #include "trace.h"
 #include "trace.h"
 #include "sysemu/dma.h"
 #include "sysemu/dma.h"
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio.h"
+#include "migration/qemu-file-types.h"
 #include "hw/virtio/virtio-gpu.h"
 #include "hw/virtio/virtio-gpu.h"
 #include "hw/virtio/virtio-gpu-bswap.h"
 #include "hw/virtio/virtio-gpu-bswap.h"
 #include "hw/virtio/virtio-gpu-pixman.h"
 #include "hw/virtio/virtio-gpu-pixman.h"

+ 1 - 0
hw/intc/apic_common.c

@@ -31,6 +31,7 @@
 #include "sysemu/kvm.h"
 #include "sysemu/kvm.h"
 #include "hw/qdev.h"
 #include "hw/qdev.h"
 #include "hw/sysbus.h"
 #include "hw/sysbus.h"
+#include "migration/qemu-file-types.h"
 
 
 static int apic_irq_delivered;
 static int apic_irq_delivered;
 bool apic_report_tpr_access;
 bool apic_report_tpr_access;

+ 1 - 0
hw/intc/s390_flic_kvm.c

@@ -22,6 +22,7 @@
 #include "hw/s390x/s390_flic.h"
 #include "hw/s390x/s390_flic.h"
 #include "hw/s390x/adapter.h"
 #include "hw/s390x/adapter.h"
 #include "hw/s390x/css.h"
 #include "hw/s390x/css.h"
+#include "migration/qemu-file-types.h"
 #include "trace.h"
 #include "trace.h"
 
 
 #define FLIC_SAVE_INITIAL_SIZE getpagesize()
 #define FLIC_SAVE_INITIAL_SIZE getpagesize()

+ 1 - 0
hw/nvram/eeprom93xx.c

@@ -38,6 +38,7 @@
 #include "qemu/osdep.h"
 #include "qemu/osdep.h"
 #include "hw/hw.h"
 #include "hw/hw.h"
 #include "hw/nvram/eeprom93xx.h"
 #include "hw/nvram/eeprom93xx.h"
+#include "migration/qemu-file-types.h"
 
 
 /* Debug EEPROM emulation. */
 /* Debug EEPROM emulation. */
 //~ #define DEBUG_EEPROM
 //~ #define DEBUG_EEPROM

+ 1 - 0
hw/nvram/fw_cfg.c

@@ -31,6 +31,7 @@
 #include "hw/boards.h"
 #include "hw/boards.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/sysbus.h"
 #include "hw/sysbus.h"
+#include "migration/qemu-file-types.h"
 #include "trace.h"
 #include "trace.h"
 #include "qemu/error-report.h"
 #include "qemu/error-report.h"
 #include "qemu/option.h"
 #include "qemu/option.h"

+ 1 - 0
hw/pci-host/piix.c

@@ -32,6 +32,7 @@
 #include "qapi/error.h"
 #include "qapi/error.h"
 #include "qemu/range.h"
 #include "qemu/range.h"
 #include "hw/xen/xen.h"
 #include "hw/xen/xen.h"
+#include "migration/qemu-file-types.h"
 #include "hw/pci-host/pam.h"
 #include "hw/pci-host/pam.h"
 #include "sysemu/reset.h"
 #include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/sysemu.h"

+ 1 - 0
hw/pci/msix.c

@@ -20,6 +20,7 @@
 #include "hw/pci/msix.h"
 #include "hw/pci/msix.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci.h"
 #include "hw/xen/xen.h"
 #include "hw/xen/xen.h"
+#include "migration/qemu-file-types.h"
 #include "qemu/range.h"
 #include "qemu/range.h"
 #include "qapi/error.h"
 #include "qapi/error.h"
 #include "trace.h"
 #include "trace.h"

+ 1 - 0
hw/pci/pci.c

@@ -29,6 +29,7 @@
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pci_bridge.h"
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_host.h"
 #include "hw/pci/pci_host.h"
+#include "migration/qemu-file-types.h"
 #include "monitor/monitor.h"
 #include "monitor/monitor.h"
 #include "net/net.h"
 #include "net/net.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/sysemu.h"

+ 1 - 0
hw/pci/shpc.c

@@ -4,6 +4,7 @@
 #include "qemu/range.h"
 #include "qemu/range.h"
 #include "qemu/error-report.h"
 #include "qemu/error-report.h"
 #include "hw/pci/shpc.h"
 #include "hw/pci/shpc.h"
+#include "migration/qemu-file-types.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/msi.h"
 #include "hw/pci/msi.h"

+ 1 - 0
hw/ppc/spapr.c

@@ -42,6 +42,7 @@
 #include "sysemu/hw_accel.h"
 #include "sysemu/hw_accel.h"
 #include "kvm_ppc.h"
 #include "kvm_ppc.h"
 #include "migration/misc.h"
 #include "migration/misc.h"
+#include "migration/qemu-file-types.h"
 #include "migration/global_state.h"
 #include "migration/global_state.h"
 #include "migration/register.h"
 #include "migration/register.h"
 #include "mmu-hash64.h"
 #include "mmu-hash64.h"

+ 1 - 0
hw/s390x/s390-skeys.c

@@ -18,6 +18,7 @@
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qdict.h"
 #include "qemu/error-report.h"
 #include "qemu/error-report.h"
 #include "sysemu/kvm.h"
 #include "sysemu/kvm.h"
+#include "migration/qemu-file-types.h"
 #include "migration/register.h"
 #include "migration/register.h"
 
 
 #define S390_SKEYS_BUFFER_SIZE (128 * KiB)  /* Room for 128k storage keys */
 #define S390_SKEYS_BUFFER_SIZE (128 * KiB)  /* Room for 128k storage keys */

+ 1 - 0
hw/s390x/tod.c

@@ -14,6 +14,7 @@
 #include "qemu/error-report.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "qemu/module.h"
 #include "sysemu/kvm.h"
 #include "sysemu/kvm.h"
+#include "migration/qemu-file-types.h"
 #include "migration/register.h"
 #include "migration/register.h"
 
 
 void s390_init_tod(void)
 void s390_init_tod(void)

+ 1 - 0
hw/s390x/virtio-ccw.c

@@ -17,6 +17,7 @@
 #include "sysemu/kvm.h"
 #include "sysemu/kvm.h"
 #include "net/net.h"
 #include "net/net.h"
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio.h"
+#include "migration/qemu-file-types.h"
 #include "hw/virtio/virtio-net.h"
 #include "hw/virtio/virtio-net.h"
 #include "hw/sysbus.h"
 #include "hw/sysbus.h"
 #include "qemu/bitops.h"
 #include "qemu/bitops.h"

+ 1 - 0
hw/scsi/mptsas.c

@@ -34,6 +34,7 @@
 #include "trace.h"
 #include "trace.h"
 #include "qapi/error.h"
 #include "qapi/error.h"
 #include "mptsas.h"
 #include "mptsas.h"
+#include "migration/qemu-file-types.h"
 #include "mpi.h"
 #include "mpi.h"
 
 
 #define NAA_LOCALLY_ASSIGNED_ID 0x3ULL
 #define NAA_LOCALLY_ASSIGNED_ID 0x3ULL

+ 1 - 0
hw/scsi/scsi-bus.c

@@ -5,6 +5,7 @@
 #include "qemu/module.h"
 #include "qemu/module.h"
 #include "qemu/option.h"
 #include "qemu/option.h"
 #include "hw/scsi/scsi.h"
 #include "hw/scsi/scsi.h"
+#include "migration/qemu-file-types.h"
 #include "scsi/constants.h"
 #include "scsi/constants.h"
 #include "hw/qdev.h"
 #include "hw/qdev.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/block-backend.h"

+ 1 - 0
hw/scsi/scsi-disk.c

@@ -25,6 +25,7 @@
 #include "qemu/error-report.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "qemu/module.h"
 #include "hw/scsi/scsi.h"
 #include "hw/scsi/scsi.h"
+#include "migration/qemu-file-types.h"
 #include "hw/scsi/emulation.h"
 #include "hw/scsi/emulation.h"
 #include "scsi/constants.h"
 #include "scsi/constants.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/sysemu.h"

+ 1 - 0
hw/scsi/scsi-generic.c

@@ -17,6 +17,7 @@
 #include "qemu/error-report.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "qemu/module.h"
 #include "hw/scsi/scsi.h"
 #include "hw/scsi/scsi.h"
+#include "migration/qemu-file-types.h"
 #include "hw/scsi/emulation.h"
 #include "hw/scsi/emulation.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/block-backend.h"
 #include "trace.h"
 #include "trace.h"

+ 1 - 0
hw/scsi/virtio-scsi.c

@@ -17,6 +17,7 @@
 #include "qapi/error.h"
 #include "qapi/error.h"
 #include "standard-headers/linux/virtio_ids.h"
 #include "standard-headers/linux/virtio_ids.h"
 #include "hw/virtio/virtio-scsi.h"
 #include "hw/virtio/virtio-scsi.h"
+#include "migration/qemu-file-types.h"
 #include "qemu/error-report.h"
 #include "qemu/error-report.h"
 #include "qemu/iov.h"
 #include "qemu/iov.h"
 #include "qemu/module.h"
 #include "qemu/module.h"

+ 1 - 0
hw/timer/i8254_common.c

@@ -30,6 +30,7 @@
 #include "qemu/timer.h"
 #include "qemu/timer.h"
 #include "hw/timer/i8254.h"
 #include "hw/timer/i8254.h"
 #include "hw/timer/i8254_internal.h"
 #include "hw/timer/i8254_internal.h"
+#include "migration/qemu-file-types.h"
 
 
 /* val must be 0 or 1 */
 /* val must be 0 or 1 */
 void pit_set_gate(ISADevice *dev, int channel, int val)
 void pit_set_gate(ISADevice *dev, int channel, int val)

+ 1 - 0
hw/timer/twl92230.c

@@ -24,6 +24,7 @@
 #include "hw/hw.h"
 #include "hw/hw.h"
 #include "qemu/timer.h"
 #include "qemu/timer.h"
 #include "hw/i2c/i2c.h"
 #include "hw/i2c/i2c.h"
+#include "migration/qemu-file-types.h"
 #include "sysemu/sysemu.h"
 #include "sysemu/sysemu.h"
 #include "ui/console.h"
 #include "ui/console.h"
 #include "qemu/bcd.h"
 #include "qemu/bcd.h"

+ 1 - 0
hw/usb/redirect.c

@@ -41,6 +41,7 @@
 #include <usbredirfilter.h>
 #include <usbredirfilter.h>
 
 
 #include "hw/usb.h"
 #include "hw/usb.h"
+#include "migration/qemu-file-types.h"
 
 
 /* ERROR is defined below. Remove any previous definition. */
 /* ERROR is defined below. Remove any previous definition. */
 #undef ERROR
 #undef ERROR

+ 1 - 0
hw/virtio/vhost.c

@@ -26,6 +26,7 @@
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
 #include "hw/virtio/virtio-access.h"
 #include "migration/blocker.h"
 #include "migration/blocker.h"
+#include "migration/qemu-file-types.h"
 #include "sysemu/dma.h"
 #include "sysemu/dma.h"
 #include "trace.h"
 #include "trace.h"
 
 

+ 1 - 0
hw/virtio/virtio-mmio.c

@@ -23,6 +23,7 @@
 #include "standard-headers/linux/virtio_mmio.h"
 #include "standard-headers/linux/virtio_mmio.h"
 #include "hw/sysbus.h"
 #include "hw/sysbus.h"
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio.h"
+#include "migration/qemu-file-types.h"
 #include "qemu/host-utils.h"
 #include "qemu/host-utils.h"
 #include "qemu/module.h"
 #include "qemu/module.h"
 #include "sysemu/kvm.h"
 #include "sysemu/kvm.h"

+ 1 - 0
hw/virtio/virtio-pci.c

@@ -19,6 +19,7 @@
 
 
 #include "standard-headers/linux/virtio_pci.h"
 #include "standard-headers/linux/virtio_pci.h"
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio.h"
+#include "migration/qemu-file-types.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_bus.h"
 #include "hw/pci/pci_bus.h"
 #include "qapi/error.h"
 #include "qapi/error.h"

+ 1 - 0
hw/virtio/virtio.c

@@ -19,6 +19,7 @@
 #include "qemu/error-report.h"
 #include "qemu/error-report.h"
 #include "qemu/module.h"
 #include "qemu/module.h"
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio.h"
+#include "migration/qemu-file-types.h"
 #include "qemu/atomic.h"
 #include "qemu/atomic.h"
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-bus.h"
 #include "hw/virtio/virtio-access.h"
 #include "hw/virtio/virtio-access.h"

+ 0 - 1
include/hw/hw.h

@@ -11,7 +11,6 @@
 #include "exec/memory.h"
 #include "exec/memory.h"
 #include "hw/irq.h"
 #include "hw/irq.h"
 #include "migration/vmstate.h"
 #include "migration/vmstate.h"
-#include "migration/qemu-file-types.h"
 
 
 void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 
 

+ 1 - 0
include/migration/cpu.h

@@ -4,6 +4,7 @@
 #define MIGRATION_CPU_H
 #define MIGRATION_CPU_H
 
 
 #include "exec/cpu-defs.h"
 #include "exec/cpu-defs.h"
+#include "migration/qemu-file-types.h"
 
 
 #if TARGET_LONG_BITS == 64
 #if TARGET_LONG_BITS == 64
 #define qemu_put_betl qemu_put_be64
 #define qemu_put_betl qemu_put_be64

+ 1 - 0
target/ppc/kvm.c

@@ -38,6 +38,7 @@
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/spapr.h"
 #include "hw/ppc/spapr_cpu_core.h"
 #include "hw/ppc/spapr_cpu_core.h"
 #include "hw/ppc/ppc.h"
 #include "hw/ppc/ppc.h"
+#include "migration/qemu-file-types.h"
 #include "sysemu/watchdog.h"
 #include "sysemu/watchdog.h"
 #include "trace.h"
 #include "trace.h"
 #include "exec/gdbstub.h"
 #include "exec/gdbstub.h"