target-s390x: Unregister reset callback on finalization
PATCH 1/1 target-s390x: Unregister reset callback on finalization
Since commit "s390: Add CPU reset handler" the CPU's instance_init registers a reset callback. Unregister that on instance_finalize.
Signed-off-by Andreas Färber <[email protected]>
Cc Jens Freimann <[email protected]>
--- target-s390x/cpu.c | 10 ++++++++++
1 Datei geändert, 10 Zeilen hinzugefügt(+)
target-s390x/cpu.c +10 -0
@@ -126,6 +126,15 @@ static void s390_cpu_initfn(Object *obj)cpu_reset (CPU (cpu)); } +static void s390_cpu_finalize (Object *obj) +{ +#if !defined(CONFIG_USER_ONLY ) +S390CPU *cpu =S390_CPU (obj); + +qemu_unregister_reset (s390_cpu_machine_reset_cb, cpu); +#endif +} +static void s390_cpu_class_init (ObjectClass *oc,void *data) {S390CPUClass *scc =S390_CPU_CLASS (oc);
@@ -140,6 +149,7 @@ static const TypeInfo s390_cpu_type_info = { .parent = TYPE_CPU, .instance_size = sizeof(S390CPU), .instance_init = s390_cpu_initfn, + .instance_finalize = s390_cpu_finalize, .abstract = false, .class_size = sizeof(S390CPUClass), .class_init = s390_cpu_class_init,
Signature · 1 line
1.7.10.4
Alexander Graf
AppliedQuoted 5 lines · Andreas Färber
Since commit "s390: Add CPU reset handler" the CPU's
instance_initregisters a reset callback. Unregister that oninstance_finalize.Signed-off-by Andreas Färber <[email protected]>Cc Jens Freimann <[email protected]>
Thanks, applied to s390-next.c
Alex