From: David Hildenbrand <d...@linux.vnet.ibm.com> For TYPE_DEVICE, the dc->reset() function is not called on system resets yet. Until that is changed, we have to manually register a reset handler. Let's provide qdev_reset_all_fn(), that can directly be used - just like the reset handler that is already available for qbus.
Reviewed-by: Cornelia Huck <cornelia.h...@de.ibm.com> Signed-off-by: David Hildenbrand <d...@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.h...@de.ibm.com> --- hw/core/qdev.c | 5 +++++ include/hw/qdev-core.h | 1 + 2 files changed, 6 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 4ab04aa..b3ad467 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -325,6 +325,11 @@ void qdev_reset_all(DeviceState *dev) qdev_walk_children(dev, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL); } +void qdev_reset_all_fn(void *opaque) +{ + qdev_reset_all(DEVICE(opaque)); +} + void qbus_reset_all(BusState *bus) { qbus_walk_children(bus, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL); diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 8057aed..e6dbde4 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -337,6 +337,7 @@ int qdev_walk_children(DeviceState *dev, void *opaque); void qdev_reset_all(DeviceState *dev); +void qdev_reset_all_fn(void *opaque); /** * @qbus_reset_all: -- 2.6.3