diff --git a/cpu-target.c b/cpu-target.c
index 98e9e7cc4a1..778f622b07a 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -230,6 +230,14 @@ void cpu_class_init_props(DeviceClass *dc)
device_class_set_props(dc, cpu_common_props);
}
+void cpu_exec_class_post_init(CPUClass *cc, void *data)
+{
+#ifndef CONFIG_USER_ONLY
+ /* Check mandatory SysemuCPUOps handlers */
+ g_assert(cc->sysemu_ops->has_work);
+#endif
+}
+
@@ -319,6 +313,11 @@ static void cpu_common_class_init(ObjectClass *klass, void
*data)
dc->user_creatable = false;
}
+static void cpu_common_post_class_init(ObjectClass *klass, void *data)
+{
+ cpu_exec_class_post_init(CPU_CLASS(klass), data);
+}