Introduce realizefn and set realized = true in cpu_s390x_init(). Signed-off-by: Andreas Färber <afaer...@suse.de> --- target-s390x/cpu.c | 10 ++++++++++ target-s390x/helper.c | 4 +++- 2 Dateien geändert, 13 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c index 2ed2312..94d8d93 100644 --- a/target-s390x/cpu.c +++ b/target-s390x/cpu.c @@ -45,6 +45,13 @@ static void s390_cpu_reset(CPUState *s) s390_add_running_cpu(env); } +static void s390_cpu_realizefn(DeviceState *dev, Error **errp) +{ + S390CPU *cpu = S390_CPU(dev); + + qemu_init_vcpu(&cpu->env); +} + static void s390_cpu_initfn(Object *obj) { S390CPU *cpu = S390_CPU(obj); @@ -73,6 +80,9 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) { S390CPUClass *scc = S390_CPU_CLASS(oc); CPUClass *cc = CPU_CLASS(scc); + DeviceClass *dc = DEVICE_CLASS(oc); + + dc->realize = s390_cpu_realizefn; scc->parent_reset = cc->reset; cc->reset = s390_cpu_reset; diff --git a/target-s390x/helper.c b/target-s390x/helper.c index 9a132e6..45020b2 100644 --- a/target-s390x/helper.c +++ b/target-s390x/helper.c @@ -85,7 +85,9 @@ S390CPU *cpu_s390x_init(const char *cpu_model) } env->cpu_model_str = cpu_model; - qemu_init_vcpu(env); + + object_property_set_bool(OBJECT(cpu), true, "realized", NULL); + return cpu; } -- 1.7.10.4