* [Qemu-devel] [PATCH s390-next] target-s390x: Unregister reset callback on finalization
@ 2013-01-07 16:14 Andreas Färber
2013-01-07 16:54 ` Alexander Graf
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Färber @ 2013-01-07 16:14 UTC (permalink / raw)
To: qemu-devel; +Cc: Jens Freimann, agraf, Andreas Färber
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>
Cc: Jens Freimann <jfrei@linux.vnet.ibm.com>
---
target-s390x/cpu.c | 10 ++++++++++
1 Datei geändert, 10 Zeilen hinzugefügt(+)
diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c
index fcd195c..cdb2439 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,
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH s390-next] target-s390x: Unregister reset callback on finalization
2013-01-07 16:14 [Qemu-devel] [PATCH s390-next] target-s390x: Unregister reset callback on finalization Andreas Färber
@ 2013-01-07 16:54 ` Alexander Graf
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Graf @ 2013-01-07 16:54 UTC (permalink / raw)
To: Andreas Färber; +Cc: Jens Freimann, qemu-devel
On 07.01.2013, at 17:14, Andreas Färber wrote:
> 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>
> Cc: Jens Freimann <jfrei@linux.vnet.ibm.com>
Thanks, applied to s390-next.c
Alex
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-07 16:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-07 16:14 [Qemu-devel] [PATCH s390-next] target-s390x: Unregister reset callback on finalization Andreas Färber
2013-01-07 16:54 ` Alexander Graf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.