Introduce host, emulator, machine and CPU states
cover Introduce host, emulator, machine and CPU states
The overall plan is to gather some functions and structures around "states" representing host, emulator, machine and (later) CPU. I see qemu-common.h as a library of useful stuff, it also includes OS-dependent declarations.
Patches 1 to 7 are trivial. For 8 to 10, more review would be nice.
Patch 11 (CPU state) is just work in progress. CPU state gives me headaches. There are several different views:
- a few common files (cpu*.h)
- external view from boards (and devices)
- internal view of TCG
- internal view of KVM
- some things in exec.c etc.
I fear one object may not be enough.
Memory looks like a candidate for refactoring too.
Blue Swirl (11):
json-lexer: fix conflict with mingw32 ERROR definition Remove unused sysemu.h include directives
Use qemu-common.h or qemu-timer.h in place of sysemu.h Move generic or OS function declarations to qemu-common.h Move clock related functions to qemu-timer.h Move CPU related functions to cpus.h
migration: move some declarations to migration.h Introduce host state v2
Introduce emulator state v2
Introduce machine state v2
Introduce CPU state
acl.c | 1 - arch_init.h | 2 - arm-semi.c | 1 - balloon.c | 1 - bt-host.c | 1 - bt-vhci.c | 1 - buffered_file.c | 1 - cpu-all.h | 1 + cpu-state.h | 8 ++ cpus.h | 42 ++++++++++ device_tree.c | 1 - emulator-state.h | 52 ++++++++++++ gdbstub.h | 1 + host-state.h | 41 ++++++++++ hw/an5206.c | 1 - hw/armv7m.c | 1 - hw/axis_dev88.c | 1 - hw/blizzard.c | 1 - hw/bt-hci-csr.c | 1 - hw/cris-boot.c | 1 - hw/dummy_m68k.c | 1 - hw/etraxfs.c | 1 - hw/gumstix.c | 1 - hw/hw.h | 1 + hw/ide/ich.c | 1 - hw/ide/isa.c | 1 - hw/ide/macio.c | 1 - hw/ide/microdrive.c | 1 - hw/ide/mmio.c | 1 - hw/ide/pci.c | 1 - hw/integratorcp.c | 1 - hw/isa-bus.c | 1 - hw/lm32_boards.c | 1 - hw/mainstone.c | 1 - hw/omap.h | 2 + hw/omap_sx1.c | 1 - hw/pcie.c | 3 +- hw/ppc440_bamboo.c | 1 - hw/ppc4xx_devs.c | 1 - hw/smbios.c | 1 + hw/soc_dma.h | 2 + hw/stellaris.c | 1 - hw/sun4m.h | 2 +- hw/syborg.c | 1 - hw/syborg_virtio.c | 1 - hw/sysbus.c | 1 - hw/tc58128.c | 1 - hw/tosa.c | 1 - hw/twl92230.c | 1 - hw/usb-hid.c | 2 +- hw/virtio-balloon.c | 1 - hw/virtio.c | 1 - hw/vmport.c | 1 - hw/xen_console.c | 1 - hw/xen_domainbuild.c | 1 - hw/xen_machine_pv.c | 1 - hw/xenfb.c | 1 - hw/xilinx_timer.c | 1 - json-lexer.c | 6 +- kvm-stub.c | 1 - kvm.h | 1 + machine-state.h | 102 ++++++++++++++++++++++++ migration-exec.c | 1 - migration-fd.c | 1 - migration-tcp.c | 1 - migration-unix.c | 1 - migration.h | 9 ++ net.c | 1 - net/dump.c | 2 +- net/slirp.c | 1 - net/vde.c | 1 - osdep.c | 1 - qemu-common.h | 47 +++++------ qemu-config.c | 1 - qemu-error.c | 1 - qemu-timer.h | 21 +---- qemu-tool.c | 1 - savevm.c | 1 + scripts/feature_to_c.sh | 2 +- sysemu.h | 199 +---------------------------------------------- 80 files changed, 300 insertions(+), 306 deletions(-) create mode 100644 cpu-state.h create mode 100644 emulator-state.h create mode 100644 host-state.h create mode 100644 machine-state.h
Signature · 1 line
1.7.2.5
Quoted 6 lines · Blue Swirl
The overall plan is to gather some functions and structures around "states" representing host, emulator, machine and (later) CPU. I see
qemu-common.has a library of useful stuff, it also includes OS-dependent declarations.Patches 1 to 7 are trivial. For 8 to 10, more review would be nice.
I applied patches 1 to 7. I'm still not 100% happy with the rest of the patches, but maybe I'll apply in a few days if I don't come up with something smarter.