From d29275f10382844e000ddaafaddc6780555e8d83 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 25 Sep 2009 21:42:35 +0200 Subject: Add exit callback to DeviceInfo. This adds a exit callback for device destruction to DeviceInfo, so we can hook cleanups into qdev device destruction. Followup patches will put that into use. Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori --- hw/qdev.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hw/qdev.c') diff --git a/hw/qdev.c b/hw/qdev.c index 7b204f9517..064389dcd0 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -245,6 +245,8 @@ void qdev_free(DeviceState *dev) #endif if (dev->info->reset) qemu_unregister_reset(dev->info->reset, dev); + if (dev->info->exit) + dev->info->exit(dev); } QLIST_REMOVE(dev, sibling); qemu_free(dev); -- cgit 1.4.1