[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/13] Add exit callback to DeviceInfo.
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 09/13] Add exit callback to DeviceInfo. |
Date: |
Tue, 22 Sep 2009 11:29:23 +0200 |
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 <address@hidden>
---
hw/qdev.c | 2 ++
hw/qdev.h | 2 ++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/hw/qdev.c b/hw/qdev.c
index 4931da1..a25245a 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);
diff --git a/hw/qdev.h b/hw/qdev.h
index c036aff..0db2d32 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -107,6 +107,7 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char
*name);
/*** Device API. ***/
typedef int (*qdev_initfn)(DeviceState *dev, DeviceInfo *info);
+typedef int (*qdev_exitfn)(DeviceState *dev);
struct DeviceInfo {
const char *name;
@@ -124,6 +125,7 @@ struct DeviceInfo {
/* Private to qdev / bus. */
qdev_initfn init;
+ qdev_exitfn exit;
BusInfo *bus_info;
struct DeviceInfo *next;
};
--
1.6.2.5
- Re: [Qemu-devel] [PATCH 10/13] Implement scsi device destruction, (continued)
- Re: [Qemu-devel] [PATCH 10/13] Implement scsi device destruction, Gerd Hoffmann, 2009/09/25
- Re: [Qemu-devel] [PATCH 10/13] Implement scsi device destruction, Markus Armbruster, 2009/09/25
- Re: [Qemu-devel] [PATCH 10/13] Implement scsi device destruction, Gerd Hoffmann, 2009/09/25
- Re: [Qemu-devel] [PATCH 10/13] Implement scsi device destruction, Artyom Tarasenko, 2009/09/25
- Re: [Qemu-devel] [PATCH 10/13] Implement scsi device destruction, Markus Armbruster, 2009/09/25
[Qemu-devel] [PATCH 12/13] pci: move unregister from PCIDevice to PCIDeviceInfo, Gerd Hoffmann, 2009/09/22
[Qemu-devel] [PATCH 09/13] Add exit callback to DeviceInfo.,
Gerd Hoffmann <=
[Qemu-devel] [PATCH 13/13] usb: hook unplug into qdev, cleanups + fixes., Gerd Hoffmann, 2009/09/22
[Qemu-devel] [PATCH 06/13] convert pci bridge to qdev, Gerd Hoffmann, 2009/09/22