On 25/1/25 17:05, Philippe Mathieu-Daudé wrote:
All handlers have been converted to SysemuCPUOps::has_work().
Remove CPUClass::has_work along with cpu_common_has_work()
and simplify cpu_has_work(), making SysemuCPUOps::has_work
handler mandatory.

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
  include/hw/core/cpu.h            | 2 --
  include/hw/core/sysemu-cpu-ops.h | 2 +-
  cpu-target.c                     | 4 ++++
  hw/core/cpu-common.c             | 6 ------
  hw/core/cpu-system.c             | 7 +------
  5 files changed, 6 insertions(+), 15 deletions(-)


diff --git a/cpu-target.c b/cpu-target.c
index 98e9e7cc4a1..15aa8afef55 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -217,6 +217,10 @@ void cpu_class_init_props(DeviceClass *dc)
  {
  #ifndef CONFIG_USER_ONLY
      ObjectClass *oc = OBJECT_CLASS(dc);
+    const CPUClass *cc = CPU_CLASS(OBJECT_CLASS(oc));
+
+    /* Check mandatory SysemuCPUOps handlers */
+    g_assert(cc->sysemu_ops->has_work);

Thinking about it again, this function is about properties, thus
this isn't the correct place to do that check. I'll revisit.

/*
       * We can't use DEFINE_PROP_BOOL in the Property array for this

Reply via email to