qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

sysemu: Move the VMChangeStateEntry typedef to qemu/typedefs.h

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 <armbru@redhat.com>
Message-Id: <20190812052359.30071-29-armbru@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>

+19 -9
+1
hw/block/vhost-user-blk.c
··· 28 28 #include "hw/virtio/virtio.h" 29 29 #include "hw/virtio/virtio-bus.h" 30 30 #include "hw/virtio/virtio-access.h" 31 + #include "sysemu/sysemu.h" 31 32 32 33 static const int user_feature_bits[] = { 33 34 VIRTIO_BLK_F_SIZE_MAX,
+1
hw/block/virtio-blk.c
··· 20 20 #include "hw/block/block.h" 21 21 #include "hw/qdev-properties.h" 22 22 #include "sysemu/blockdev.h" 23 + #include "sysemu/sysemu.h" 23 24 #include "hw/virtio/virtio-blk.h" 24 25 #include "dataplane/virtio-blk.h" 25 26 #include "scsi/constants.h"
+1
hw/display/virtio-gpu.c
··· 17 17 #include "ui/console.h" 18 18 #include "trace.h" 19 19 #include "sysemu/dma.h" 20 + #include "sysemu/sysemu.h" 20 21 #include "hw/virtio/virtio.h" 21 22 #include "migration/qemu-file-types.h" 22 23 #include "hw/virtio/virtio-gpu.h"
+1
hw/misc/macio/macio.c
··· 35 35 #include "hw/char/escc.h" 36 36 #include "hw/misc/macio/macio.h" 37 37 #include "hw/intc/heathrow_pic.h" 38 + #include "sysemu/sysemu.h" 38 39 #include "trace.h" 39 40 40 41 /* Note: this code is strongly inspirated from the corresponding code
+1
hw/net/virtio-net.c
··· 31 31 #include "hw/virtio/virtio-access.h" 32 32 #include "migration/misc.h" 33 33 #include "standard-headers/linux/ethtool.h" 34 + #include "sysemu/sysemu.h" 34 35 #include "trace.h" 35 36 36 37 #define VIRTIO_NET_VM_VERSION 11
+1
hw/s390x/s390-ccw.c
··· 19 19 #include "hw/s390x/css.h" 20 20 #include "hw/s390x/css-bridge.h" 21 21 #include "hw/s390x/s390-ccw.h" 22 + #include "sysemu/sysemu.h" 22 23 23 24 IOInstEnding s390_ccw_cmd_request(SubchDev *sch) 24 25 {
+1
hw/s390x/s390-virtio-ccw.c
··· 40 40 #include "hw/nmi.h" 41 41 #include "hw/qdev-properties.h" 42 42 #include "hw/s390x/tod.h" 43 + #include "sysemu/sysemu.h" 43 44 44 45 S390CPU *s390_cpu_addr2state(uint16_t cpu_addr) 45 46 {
+1
hw/scsi/scsi-bus.c
··· 10 10 #include "scsi/constants.h" 11 11 #include "sysemu/block-backend.h" 12 12 #include "sysemu/blockdev.h" 13 + #include "sysemu/sysemu.h" 13 14 #include "trace.h" 14 15 #include "sysemu/dma.h" 15 16 #include "qemu/cutils.h"
+1
hw/scsi/vhost-scsi.c
··· 30 30 #include "hw/fw-path-provider.h" 31 31 #include "hw/qdev-properties.h" 32 32 #include "qemu/cutils.h" 33 + #include "sysemu/sysemu.h" 33 34 34 35 /* Features supported by host kernel. */ 35 36 static const int kernel_feature_bits[] = {
+1
hw/scsi/vhost-user-scsi.c
··· 28 28 #include "hw/virtio/virtio.h" 29 29 #include "hw/virtio/virtio-access.h" 30 30 #include "chardev/char-fe.h" 31 + #include "sysemu/sysemu.h" 31 32 32 33 /* Features supported by the host application */ 33 34 static const int user_feature_bits[] = {
+1
hw/usb/hcd-ehci.c
··· 35 35 #include "trace.h" 36 36 #include "qemu/error-report.h" 37 37 #include "qemu/main-loop.h" 38 + #include "sysemu/sysemu.h" 38 39 39 40 #define FRAME_TIMER_FREQ 1000 40 41 #define FRAME_TIMER_NS (NANOSECONDS_PER_SECOND / FRAME_TIMER_FREQ)
-1
hw/usb/hcd-ehci.h
··· 21 21 #include "qemu/timer.h" 22 22 #include "hw/usb.h" 23 23 #include "sysemu/dma.h" 24 - #include "sysemu/sysemu.h" 25 24 #include "hw/pci/pci.h" 26 25 #include "hw/sysbus.h" 27 26
+1
hw/virtio/virtio-rng.c
··· 17 17 #include "hw/qdev-properties.h" 18 18 #include "hw/virtio/virtio-rng.h" 19 19 #include "sysemu/rng.h" 20 + #include "sysemu/sysemu.h" 20 21 #include "qom/object_interfaces.h" 21 22 #include "trace.h" 22 23
+1
hw/virtio/virtio.c
··· 26 26 #include "hw/qdev-properties.h" 27 27 #include "hw/virtio/virtio-access.h" 28 28 #include "sysemu/dma.h" 29 + #include "sysemu/sysemu.h" 29 30 30 31 /* 31 32 * The alignment to use between consumer and producer parts of vring.
+2 -1
include/hw/ide/internal.h
··· 6 6 * only files in hw/ide/ are supposed to include this file. 7 7 * non-internal declarations are in hw/ide.h 8 8 */ 9 + 10 + #include "qapi/qapi-types-run-state.h" 9 11 #include "hw/ide.h" 10 12 #include "hw/irq.h" 11 13 #include "hw/isa/isa.h" 12 14 #include "sysemu/dma.h" 13 - #include "sysemu/sysemu.h" 14 15 #include "hw/block/block.h" 15 16 #include "scsi/constants.h" 16 17
-1
include/hw/ppc/spapr_xive.h
··· 12 12 13 13 #include "hw/ppc/spapr_irq.h" 14 14 #include "hw/ppc/xive.h" 15 - #include "sysemu/sysemu.h" 16 15 17 16 #define TYPE_SPAPR_XIVE "spapr-xive" 18 17 #define SPAPR_XIVE(obj) OBJECT_CHECK(SpaprXive, (obj), TYPE_SPAPR_XIVE)
-1
include/hw/scsi/scsi.h
··· 4 4 #include "block/aio.h" 5 5 #include "hw/block/block.h" 6 6 #include "hw/qdev-core.h" 7 - #include "sysemu/sysemu.h" 8 7 #include "scsi/utils.h" 9 8 #include "qemu/notify.h" 10 9
-1
include/hw/virtio/virtio.h
··· 17 17 #include "exec/memory.h" 18 18 #include "hw/qdev-core.h" 19 19 #include "net/net.h" 20 - #include "sysemu/sysemu.h" 21 20 #include "migration/vmstate.h" 22 21 #include "qemu/event_notifier.h" 23 22 #include "standard-headers/linux/virtio_config.h"
+1
include/qemu/typedefs.h
··· 118 118 typedef struct SSIBus SSIBus; 119 119 typedef struct VirtIODevice VirtIODevice; 120 120 typedef struct Visitor Visitor; 121 + typedef struct VMChangeStateEntry VMChangeStateEntry; 121 122 typedef struct VMStateDescription VMStateDescription; 122 123 123 124 /*
-1
include/sysemu/sysemu.h
··· 22 22 int runstate_is_running(void); 23 23 bool runstate_needs_reset(void); 24 24 bool runstate_store(char *str, size_t size); 25 - typedef struct vm_change_state_entry VMChangeStateEntry; 26 25 typedef void VMChangeStateHandler(void *opaque, int running, RunState state); 27 26 28 27 VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb,
+3 -3
vl.c
··· 1362 1362 return 1; 1363 1363 } 1364 1364 1365 - struct vm_change_state_entry { 1365 + struct VMChangeStateEntry { 1366 1366 VMChangeStateHandler *cb; 1367 1367 void *opaque; 1368 - QTAILQ_ENTRY(vm_change_state_entry) entries; 1368 + QTAILQ_ENTRY(VMChangeStateEntry) entries; 1369 1369 int priority; 1370 1370 }; 1371 1371 1372 - static QTAILQ_HEAD(, vm_change_state_entry) vm_change_state_head; 1372 + static QTAILQ_HEAD(, VMChangeStateEntry) vm_change_state_head; 1373 1373 1374 1374 /** 1375 1375 * qemu_add_vm_change_state_handler_prio: