aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exec.c10
-rw-r--r--include/qom/cpu.h1
-rw-r--r--qom/cpu.c2
3 files changed, 9 insertions, 4 deletions
diff --git a/exec.c b/exec.c
index 6d7f600c0c..902dac597b 100644
--- a/exec.c
+++ b/exec.c
@@ -610,11 +610,8 @@ void cpu_exec_exit(CPUState *cpu)
}
}
-void cpu_exec_init(CPUState *cpu, Error **errp)
+void cpu_exec_initfn(CPUState *cpu)
{
- CPUClass *cc ATTRIBUTE_UNUSED = CPU_GET_CLASS(cpu);
- Error *local_err ATTRIBUTE_UNUSED = NULL;
-
cpu->as = NULL;
cpu->num_ases = 0;
@@ -635,6 +632,11 @@ void cpu_exec_init(CPUState *cpu, Error **errp)
cpu->memory = system_memory;
object_ref(OBJECT(cpu->memory));
#endif
+}
+
+void cpu_exec_init(CPUState *cpu, Error **errp)
+{
+ CPUClass *cc ATTRIBUTE_UNUSED = CPU_GET_CLASS(cpu);
cpu_list_add(cpu);
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 6d481a1dc0..d7648a9333 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -946,6 +946,7 @@ AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx);
void QEMU_NORETURN cpu_abort(CPUState *cpu, const char *fmt, ...)
GCC_FMT_ATTR(2, 3);
+void cpu_exec_initfn(CPUState *cpu);
void cpu_exec_exit(CPUState *cpu);
#ifdef CONFIG_SOFTMMU
diff --git a/qom/cpu.c b/qom/cpu.c
index c40f774a0c..85f1132043 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -362,6 +362,8 @@ static void cpu_common_initfn(Object *obj)
QTAILQ_INIT(&cpu->watchpoints);
cpu->trace_dstate = bitmap_new(trace_get_vcpu_event_count());
+
+ cpu_exec_initfn(cpu);
}
static void cpu_common_finalize(Object *obj)