mirror of
https://github.com/mii443/qemu.git
synced 2025-12-09 22:18:23 +00:00
Include generated QAPI headers less
Some of the generated qapi-types-MODULE.h are included all over the
place. Changing a QAPI type can trigger massive recompiling. Top
scorers recompile more than 1000 out of some 6600 objects (not
counting tests and objects that don't depend on qemu/osdep.h):
6300 qapi/qapi-builtin-types.h
5700 qapi/qapi-types-run-state.h
3900 qapi/qapi-types-common.h
3300 qapi/qapi-types-sockets.h
3000 qapi/qapi-types-misc.h
3000 qapi/qapi-types-crypto.h
3000 qapi/qapi-types-job.h
3000 qapi/qapi-types-block-core.h
2800 qapi/qapi-types-block.h
1300 qapi/qapi-types-net.h
Clean up headers to include generated QAPI headers only where needed.
Impact is negligible except for hw/qdev-properties.h.
This header includes qapi/qapi-types-block.h and
qapi/qapi-types-misc.h. They are used only in expansions of property
definition macros such as DEFINE_PROP_BLOCKDEV_ON_ERROR() and
DEFINE_PROP_OFF_AUTO(). Moving their inclusion from
hw/qdev-properties.h to the users of these macros avoids pointless
recompiles. This is how other property definition macros, such as
DEFINE_PROP_NETDEV(), already work.
Improves things for some of the top scorers:
3600 qapi/qapi-types-common.h
2800 qapi/qapi-types-sockets.h
900 qapi/qapi-types-misc.h
2200 qapi/qapi-types-crypto.h
2100 qapi/qapi-types-job.h
2100 qapi/qapi-types-block-core.h
270 qapi/qapi-types-block.h
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190812052359.30071-3-armbru@redhat.com>
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
#include "hw/qdev.h"
|
#include "hw/qdev.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "hw/pci/pci.h"
|
#include "hw/pci/pci.h"
|
||||||
|
#include "qapi/qapi-types-block.h"
|
||||||
|
#include "qapi/qapi-types-misc.h"
|
||||||
#include "qapi/qmp/qerror.h"
|
#include "qapi/qmp/qerror.h"
|
||||||
#include "qemu/ctype.h"
|
#include "qemu/ctype.h"
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include <linux/kvm.h>
|
#include <linux/kvm.h>
|
||||||
|
#include "qapi/qapi-types-misc.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "qemu/module.h"
|
#include "qemu/module.h"
|
||||||
#include "qemu/timer.h"
|
#include "qemu/timer.h"
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "hw/hw.h"
|
#include "hw/hw.h"
|
||||||
#include "sysemu/dma.h"
|
#include "sysemu/dma.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
|
#include "qapi/qapi-types-block.h"
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
#include "qemu/module.h"
|
#include "qemu/module.h"
|
||||||
#include "hw/ide/internal.h"
|
#include "hw/ide/internal.h"
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#define QAUTHZ_LISTFILE_H
|
#define QAUTHZ_LISTFILE_H
|
||||||
|
|
||||||
#include "authz/list.h"
|
#include "authz/list.h"
|
||||||
#include "qapi/qapi-types-authz.h"
|
|
||||||
#include "qemu/filemonitor.h"
|
#include "qemu/filemonitor.h"
|
||||||
|
|
||||||
#define TYPE_QAUTHZ_LIST_FILE "authz-list-file"
|
#define TYPE_QAUTHZ_LIST_FILE "authz-list-file"
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#define BLOCK_H
|
#define BLOCK_H
|
||||||
|
|
||||||
#include "block/aio.h"
|
#include "block/aio.h"
|
||||||
#include "qapi/qapi-types-block-core.h"
|
|
||||||
#include "block/aio-wait.h"
|
#include "block/aio-wait.h"
|
||||||
#include "qemu/iov.h"
|
#include "qemu/iov.h"
|
||||||
#include "qemu/coroutine.h"
|
#include "qemu/coroutine.h"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#ifndef ACPI_DEV_INTERFACE_H
|
#ifndef ACPI_DEV_INTERFACE_H
|
||||||
#define ACPI_DEV_INTERFACE_H
|
#define ACPI_DEV_INTERFACE_H
|
||||||
|
|
||||||
|
#include "qapi/qapi-types-misc.h"
|
||||||
#include "qom/object.h"
|
#include "qom/object.h"
|
||||||
#include "hw/boards.h"
|
#include "hw/boards.h"
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#ifndef MEMORY_DEVICE_H
|
#ifndef MEMORY_DEVICE_H
|
||||||
#define MEMORY_DEVICE_H
|
#define MEMORY_DEVICE_H
|
||||||
|
|
||||||
|
#include "qapi/qapi-types-misc.h"
|
||||||
#include "qom/object.h"
|
#include "qom/object.h"
|
||||||
#include "hw/qdev.h"
|
#include "hw/qdev.h"
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
#define HW_SPAPR_DRC_H
|
#define HW_SPAPR_DRC_H
|
||||||
|
|
||||||
#include <libfdt.h>
|
#include <libfdt.h>
|
||||||
#include "qapi/qapi-types-run-state.h"
|
|
||||||
#include "qom/object.h"
|
#include "qom/object.h"
|
||||||
#include "sysemu/sysemu.h"
|
#include "sysemu/sysemu.h"
|
||||||
#include "hw/qdev.h"
|
#include "hw/qdev.h"
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
#ifndef QEMU_QDEV_PROPERTIES_H
|
#ifndef QEMU_QDEV_PROPERTIES_H
|
||||||
#define QEMU_QDEV_PROPERTIES_H
|
#define QEMU_QDEV_PROPERTIES_H
|
||||||
|
|
||||||
#include "qapi/qapi-types-block.h"
|
|
||||||
#include "qapi/qapi-types-misc.h"
|
|
||||||
#include "hw/qdev-core.h"
|
#include "hw/qdev-core.h"
|
||||||
|
|
||||||
/*** qdev-properties.c ***/
|
/*** qdev-properties.c ***/
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#define HW_VIRTIO_PMEM_H
|
#define HW_VIRTIO_PMEM_H
|
||||||
|
|
||||||
#include "hw/virtio/virtio.h"
|
#include "hw/virtio/virtio.h"
|
||||||
|
#include "qapi/qapi-types-misc.h"
|
||||||
#include "sysemu/hostmem.h"
|
#include "sysemu/hostmem.h"
|
||||||
|
|
||||||
#define TYPE_VIRTIO_PMEM "virtio-pmem"
|
#define TYPE_VIRTIO_PMEM "virtio-pmem"
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#ifndef QEMU_MIGRATION_GLOBAL_STATE_H
|
#ifndef QEMU_MIGRATION_GLOBAL_STATE_H
|
||||||
#define QEMU_MIGRATION_GLOBAL_STATE_H
|
#define QEMU_MIGRATION_GLOBAL_STATE_H
|
||||||
|
|
||||||
#include "qapi/qapi-types-run-state.h"
|
|
||||||
#include "sysemu/sysemu.h"
|
#include "sysemu/sysemu.h"
|
||||||
|
|
||||||
void register_global_state(void);
|
void register_global_state(void);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#ifndef JOB_H
|
#ifndef JOB_H
|
||||||
#define JOB_H
|
#define JOB_H
|
||||||
|
|
||||||
#include "qapi/qapi-types-block-core.h"
|
#include "qapi/qapi-types-job.h"
|
||||||
#include "qemu/queue.h"
|
#include "qemu/queue.h"
|
||||||
#include "qemu/coroutine.h"
|
#include "qemu/coroutine.h"
|
||||||
#include "block/aio.h"
|
#include "block/aio.h"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#ifndef QEMU_ARCH_INIT_H
|
#ifndef QEMU_ARCH_INIT_H
|
||||||
#define QEMU_ARCH_INIT_H
|
#define QEMU_ARCH_INIT_H
|
||||||
|
|
||||||
#include "qapi/qapi-types-misc.h"
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
QEMU_ARCH_ALL = -1,
|
QEMU_ARCH_ALL = -1,
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <epoxy/gl.h>
|
#include <epoxy/gl.h>
|
||||||
#include <epoxy/egl.h>
|
#include <epoxy/egl.h>
|
||||||
#include <gbm.h>
|
#include <gbm.h>
|
||||||
#include "qapi/qapi-types-ui.h"
|
|
||||||
#include "ui/console.h"
|
#include "ui/console.h"
|
||||||
#include "ui/shader.h"
|
#include "ui/shader.h"
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include "chardev/char-fe.h"
|
#include "chardev/char-fe.h"
|
||||||
#include "monitor/monitor.h"
|
#include "monitor/monitor.h"
|
||||||
#include "qapi/qapi-types-misc.h"
|
|
||||||
#include "qapi/qmp/dispatch.h"
|
#include "qapi/qmp/dispatch.h"
|
||||||
#include "qapi/qmp/json-parser.h"
|
#include "qapi/qmp/json-parser.h"
|
||||||
#include "qemu/readline.h"
|
#include "qemu/readline.h"
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include "sysemu/sev.h"
|
#include "sysemu/sev.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "sev_i386.h"
|
#include "sev_i386.h"
|
||||||
|
#include "qapi/qapi-commands-misc-target.h"
|
||||||
#include "qapi/qapi-commands-misc.h"
|
#include "qapi/qapi-commands-misc.h"
|
||||||
|
|
||||||
/* Perform linear address sign extension */
|
/* Perform linear address sign extension */
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#include "sysemu/kvm.h"
|
#include "sysemu/kvm.h"
|
||||||
#include "sysemu/sev.h"
|
#include "sysemu/sev.h"
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
#include "qapi/qapi-commands-misc-target.h"
|
#include "qapi/qapi-types-misc-target.h"
|
||||||
|
|
||||||
#define SEV_POLICY_NODBG 0x1
|
#define SEV_POLICY_NODBG 0x1
|
||||||
#define SEV_POLICY_NOKS 0x2
|
#define SEV_POLICY_NOKS 0x2
|
||||||
|
|||||||
Reference in New Issue
Block a user