cpu: Fix VMSTATE_CPU() semantics

Commit 1a1562f5ea prepared a VMSTATE_CPU()
macro for device-style VMStateDescription registration, but missed to
adapt cpu_exec_init(), so that the "cpu_common" VMStateDescription was
still registered for AlphaCPU (fe31e73742)
and OpenRISCCPU (da69721460). Fix this.

Cc: Richard Henderson <rth@twiddle.net>
Tested-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
Andreas Färber 2013-07-29 04:07:50 +02:00
parent 1197cbb9ed
commit e0d4794458

5
exec.c
View File

@ -402,11 +402,14 @@ void cpu_exec_init(CPUArchState *env)
#if defined(CONFIG_USER_ONLY) #if defined(CONFIG_USER_ONLY)
cpu_list_unlock(); cpu_list_unlock();
#endif #endif
vmstate_register(NULL, cpu_index, &vmstate_cpu_common, cpu); if (qdev_get_vmsd(DEVICE(cpu)) == NULL) {
vmstate_register(NULL, cpu_index, &vmstate_cpu_common, cpu);
}
#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY) #if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
register_savevm(NULL, "cpu", cpu_index, CPU_SAVE_VERSION, register_savevm(NULL, "cpu", cpu_index, CPU_SAVE_VERSION,
cpu_save, cpu_load, env); cpu_save, cpu_load, env);
assert(cc->vmsd == NULL); assert(cc->vmsd == NULL);
assert(qdev_get_vmsd(DEVICE(cpu)) == NULL);
#endif #endif
if (cc->vmsd != NULL) { if (cc->vmsd != NULL) {
vmstate_register(NULL, cpu_index, cc->vmsd, cpu); vmstate_register(NULL, cpu_index, cc->vmsd, cpu);