summaryrefslogtreecommitdiff
path: root/cpu.c
diff options
context:
space:
mode:
authorClaudio Fontana <cfontana@suse.de>2021-03-22 14:27:44 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2021-05-10 15:41:50 -0400
commit9ea057dc641b150ecbfd45acfe18fe043641a551 (patch)
treecff91686711453fcaf8e5d1a286feb4c81d69ab8 /cpu.c
parentce21726525da53053432b19e27e9fd2a49086d78 (diff)
downloadqemu-9ea057dc641b150ecbfd45acfe18fe043641a551.zip
accel-cpu: make cpu_realizefn return a bool
overall, all devices' realize functions take an Error **errp, but return void. hw/core/qdev.c code, which realizes devices, therefore does: local_err = NULL; dc->realize(dev, &local_err); if (local_err != NULL) { goto fail; } However, we can improve at least accel_cpu to return a meaningful bool value. Signed-off-by: Claudio Fontana <cfontana@suse.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210322132800.7470-9-cfontana@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'cpu.c')
-rw-r--r--cpu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpu.c b/cpu.c
index 25e6fbfa2c..34a0484bf4 100644
--- a/cpu.c
+++ b/cpu.c
@@ -130,8 +130,9 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp)
CPUClass *cc = CPU_GET_CLASS(cpu);
cpu_list_add(cpu);
- accel_cpu_realizefn(cpu, errp);
-
+ if (!accel_cpu_realizefn(cpu, errp)) {
+ return;
+ }
#ifdef CONFIG_TCG
/* NB: errp parameter is unused currently */
if (tcg_enabled()) {