summaryrefslogtreecommitdiff
path: root/hw/intc/xics.c
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2017-05-24 19:40:43 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2017-05-25 11:31:33 +1000
commit62f94fc94f98095173146e753a1f03d7c2cc7ba3 (patch)
treec8188b9e7528e169c706b70dfa167caf414c85e1 /hw/intc/xics.c
parent16ee99805e069601ba3ce9da524bab377ab03866 (diff)
downloadqemu-62f94fc94f98095173146e753a1f03d7c2cc7ba3.zip
xics: add unrealize handler
Now that ICPState objects get finalized on CPU unplug, we should unregister reset handlers as well to avoid a QEMU crash at machine reset time. Signed-off-by: Greg Kurz <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/intc/xics.c')
-rw-r--r--hw/intc/xics.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index 292fffecd3..ea3516794a 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -357,6 +357,10 @@ static void icp_realize(DeviceState *dev, Error **errp)
qemu_register_reset(icp_reset, dev);
}
+static void icp_unrealize(DeviceState *dev, Error **errp)
+{
+ qemu_unregister_reset(icp_reset, dev);
+}
static void icp_class_init(ObjectClass *klass, void *data)
{
@@ -364,6 +368,7 @@ static void icp_class_init(ObjectClass *klass, void *data)
dc->vmsd = &vmstate_icp_server;
dc->realize = icp_realize;
+ dc->unrealize = icp_unrealize;
}
static const TypeInfo icp_info = {