diff options
author | Claudio Fontana | 2021-03-22 14:27:44 +0100 |
---|---|---|
committer | Paolo Bonzini | 2021-05-10 21:41:50 +0200 |
commit | 9ea057dc641b150ecbfd45acfe18fe043641a551 (patch) | |
tree | cff91686711453fcaf8e5d1a286feb4c81d69ab8 /target/i386/tcg | |
parent | target/i386: fix host_cpu_adjust_phys_bits error handling (diff) | |
download | qemu-9ea057dc641b150ecbfd45acfe18fe043641a551.tar.gz qemu-9ea057dc641b150ecbfd45acfe18fe043641a551.tar.xz qemu-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 'target/i386/tcg')
-rw-r--r-- | target/i386/tcg/tcg-cpu.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 1d3d6d1c6a..23e1f5f0c3 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -96,7 +96,7 @@ static void x86_cpu_machine_done(Notifier *n, void *unused) } } -static void tcg_cpu_realizefn(CPUState *cs, Error **errp) +static bool tcg_cpu_realizefn(CPUState *cs, Error **errp) { X86CPU *cpu = X86_CPU(cs); @@ -132,12 +132,14 @@ static void tcg_cpu_realizefn(CPUState *cs, Error **errp) /* ... SMRAM with higher priority, linked from /machine/smram. */ cpu->machine_done.notify = x86_cpu_machine_done; qemu_add_machine_init_done_notifier(&cpu->machine_done); + return true; } #else /* CONFIG_USER_ONLY */ -static void tcg_cpu_realizefn(CPUState *cs, Error **errp) +static bool tcg_cpu_realizefn(CPUState *cs, Error **errp) { + return true; } #endif /* !CONFIG_USER_ONLY */ |