diff mbox

[3/6] qdev: introduce a helper function which triggers reset from a given device.

Message ID d036b76e4ad24ddbc71e57b53ea6dd9f682ca895.1283417726.git.yamahata@valinux.co.jp
State New
Headers show

Commit Message

Isaku Yamahata Sept. 2, 2010, 9:25 a.m. UTC
introduce a helper function which triggers reset on device tree
from a given device.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 hw/qdev-core.h |    1 +
 hw/qdev.c      |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/hw/qdev-core.h b/hw/qdev-core.h
index 49ac87a..20ebe1f 100644
--- a/hw/qdev-core.h
+++ b/hw/qdev-core.h
@@ -195,6 +195,7 @@  int qdev_walk_children(DeviceState *dev, qdev_walkerfn *devfn,
 DeviceState *qbus_find_child_dev(BusState *bus, const char *id);
 BusState *qbus_find_child_bus(BusState *bus, const char *id);
 
+void qdev_reset_all(DeviceState *dev);
 void qbus_reset_all(BusState *bus);
 void qbus_realize_all(BusState *bus);
 
diff --git a/hw/qdev.c b/hw/qdev.c
index 9300d7f..191dfac 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -174,6 +174,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);