diff options
author | Andreas Färber <afaerber@suse.de> | 2013-01-07 06:14:16 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-01-18 19:07:47 +0100 |
commit | d5627ce8a4fd8dd6d7afd3d4d1ff7e9f1fb86d45 (patch) | |
tree | 3058ffbec6905376c9ece543e6e4339f1a8b2eda | |
parent | 419831d7104e6876f47f5eccb758855115086bbd (diff) |
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>
-rw-r--r-- | target-s390x/cpu.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c index 6810246c31..0b68db8305 100644 --- a/target-s390x/cpu.c +++ b/target-s390x/cpu.c @@ -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, |