mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
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 <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
419831d710
commit
d5627ce8a4
1 changed files with 10 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue