From: Isaku Yamahata Date: Fri, 19 Nov 2010 09:56:01 +0000 (+0900) Subject: qdev: trigger reset from a given device X-Git-Tag: v0.14.0-rc0~403^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5af0a04bea1f1704432b7c118c00a466e862bf00;p=thirdparty%2Fqemu.git qdev: trigger reset from a given device Introduce a helper function which triggers reset from a given device. Will be used by pci bus emulation. Signed-off-by: Isaku Yamahata Signed-off-by: Anthony Liguori Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/qdev.c b/hw/qdev.c index b76da078088..b65b63e10ee 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -322,6 +322,11 @@ static int qbus_reset_one(BusState *bus, void *opaque) return 0; } +void qdev_reset_all(DeviceState *dev) +{ + qdev_walk_children(dev, qdev_reset_one, qbus_reset_one, NULL); +} + void qbus_reset_all(BusState *bus) { qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL); diff --git a/hw/qdev.h b/hw/qdev.h index 5ac084f7de2..3fac364c6bb 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -189,6 +189,7 @@ int qbus_walk_children(BusState *bus, qdev_walkerfn *devfn, qbus_walkerfn *busfn, void *opaque); int qdev_walk_children(DeviceState *dev, qdev_walkerfn *devfn, qbus_walkerfn *busfn, void *opaque); +void qdev_reset_all(DeviceState *dev); void qbus_reset_all(BusState *bus); void qbus_free(BusState *bus);