Hello, In response to patches from Juan [1], this series implements a declarative way for CPUs to register their CPU-specific VMStateDescription.
v3 dropped alpha and openrisc, leaving only x86 as prereq for my qom-cpu-9 and lm32 as proof of concept for leave-CPUArchState-untouched-if-not-needed. Available here: git://github.com/afaerber/qemu-cpu.git qom-cpu-vmstate.v3 https://github.com/afaerber/qemu-cpu/commits/qom-cpu-vmstate.v3 Preview of QOM CPUState part 9 v2 as follow-up to the x86 patch: https://github.com/afaerber/qemu-cpu/commits/qom-cpu-9 >From v1: What triggered this series was moving the halted and interrupt_request fields from CPU_COMMON to CPUState: https://lists.nongnu.org/archive/html/qemu-devel/2013-02/msg00203.html Since both are in vmstate_cpu_common, they needed to be moved together, and "cpu_common" will need to operate on CPUState then. At the same time x86 can no longer access the halted field from CPUX86State via VMSTATE_ macros, so either we need to drop uses of such fields (i.e., version 5) or make it possible to access CPUState fields in x86 VMState through parent_obj field. Further, in explaining intended uses of S390CPU vs. CPUS390XState I was reminded that VMState is currently a limiting factor for placing fields into CPUState-derived types rather than into CPU*State. Regards, Andreas [1] https://lists.nongnu.org/archive/html/qemu-devel/2012-05/msg00524.html v2 -> v3: * Inlined vmstate_register() into vmstate.h rather than adding stub (Eduardo). * Introduced cpu_class_set_vmsd() function/macro (Juan). => Lets us drop #include "migration/vmstate.h" in target-lm32/cpu.c. * Used VMSTATE_STRUCT() to leave CPULM32State unchanged for now (Juan). * Dropped alpha and openrisc patches. => To be redone with DeviceClass::vmsd and embedded cpu_common state. v1 -> v2: * Add vmstate_register() and vmstate_dummy stubs to avoid #ifdefs (Eduardo). Cc: Juan Quintela <quint...@redhat.com> Cc: Michael Roth <mdr...@linux.vnet.ibm.com> Cc: Anthony Liguori <anth...@codemonkey.ws> Cc: Blue Swirl <blauwir...@gmail.com> Cc: Eduardo Habkost <ehabk...@redhat.com> Cc: Igor Mammedov <imamm...@redhat.com> Cc: Richard Henderson <r...@twiddle.net> Cc: Michael Walle <mich...@walle.cc> Cc: Jia Liu <pro...@gmail.com> Andreas Färber (6): vmstate: Make vmstate_register() static inline stubs: Add a vmstate_dummy struct for CONFIG_USER_ONLY cpu: Register VMStateDescription through CPUState cpu: Introduce cpu_class_set_vmsd() target-i386: Update VMStateDescription to X86CPU target-lm32: Update VMStateDescription to LM32CPU exec.c | 11 ++- include/migration/vmstate.h | 16 +++- include/qom/cpu.h | 20 ++++ savevm.c | 7 -- stubs/vmstate.c | 2 + target-i386/cpu-qom.h | 4 + target-i386/cpu.c | 2 + target-i386/cpu.h | 2 - target-i386/machine.c | 215 +++++++++++++++++++++---------------------- target-lm32/cpu-qom.h | 4 + target-lm32/cpu.c | 2 + target-lm32/cpu.h | 2 - target-lm32/machine.c | 25 ++--- 13 Dateien geändert, 177 Zeilen hinzugefügt(+), 135 Zeilen entfernt(-) -- 1.7.10.4