Patchwork [v2,4/6] qdev: introduce a helper function which triggers reset from a given device

login
register
mail settings
Submitter Isaku Yamahata
Date Nov. 19, 2010, 9:56 a.m.
Message ID <b5e5323c22a8b18f45d0791a4e3284d54e2360b6.1290160397.git.yamahata@valinux.co.jp>
Download mbox | patch
Permalink /patch/72230/
State New
Headers show

Comments

Isaku Yamahata - Nov. 19, 2010, 9:56 a.m.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 hw/qdev.c |    5 +++++
 hw/qdev.h |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/qdev.c b/hw/qdev.c
index b76da07..b65b63e 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 5ac084f..3fac364 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);