mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 18:44:58 -06:00
exec/cpu: Have cpu_exec_realize() return a boolean
Following the example documented since commit e3fe3988d7
("error:
Document Error API usage rules"), have cpu_exec_realizefn()
return a boolean indicating whether an error is set or not.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230918160257.30127-22-philmd@linaro.org>
This commit is contained in:
parent
3a9d0d7b64
commit
79a99091c1
2 changed files with 5 additions and 3 deletions
|
@ -131,13 +131,13 @@ const VMStateDescription vmstate_cpu_common = {
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void cpu_exec_realizefn(CPUState *cpu, Error **errp)
|
bool cpu_exec_realizefn(CPUState *cpu, Error **errp)
|
||||||
{
|
{
|
||||||
/* cache the cpu class for the hotpath */
|
/* cache the cpu class for the hotpath */
|
||||||
cpu->cc = CPU_GET_CLASS(cpu);
|
cpu->cc = CPU_GET_CLASS(cpu);
|
||||||
|
|
||||||
if (!accel_cpu_common_realize(cpu, errp)) {
|
if (!accel_cpu_common_realize(cpu, errp)) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait until cpu initialization complete before exposing cpu. */
|
/* Wait until cpu initialization complete before exposing cpu. */
|
||||||
|
@ -159,6 +159,8 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp)
|
||||||
vmstate_register(NULL, cpu->cpu_index, cpu->cc->sysemu_ops->legacy_vmsd, cpu);
|
vmstate_register(NULL, cpu->cpu_index, cpu->cc->sysemu_ops->legacy_vmsd, cpu);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_USER_ONLY */
|
#endif /* CONFIG_USER_ONLY */
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpu_exec_unrealizefn(CPUState *cpu)
|
void cpu_exec_unrealizefn(CPUState *cpu)
|
||||||
|
|
|
@ -1152,7 +1152,7 @@ G_NORETURN void cpu_abort(CPUState *cpu, const char *fmt, ...)
|
||||||
/* $(top_srcdir)/cpu.c */
|
/* $(top_srcdir)/cpu.c */
|
||||||
void cpu_class_init_props(DeviceClass *dc);
|
void cpu_class_init_props(DeviceClass *dc);
|
||||||
void cpu_exec_initfn(CPUState *cpu);
|
void cpu_exec_initfn(CPUState *cpu);
|
||||||
void cpu_exec_realizefn(CPUState *cpu, Error **errp);
|
bool cpu_exec_realizefn(CPUState *cpu, Error **errp);
|
||||||
void cpu_exec_unrealizefn(CPUState *cpu);
|
void cpu_exec_unrealizefn(CPUState *cpu);
|
||||||
void cpu_exec_reset_hold(CPUState *cpu);
|
void cpu_exec_reset_hold(CPUState *cpu);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue