aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2010-11-19 18:56:01 +0900
committerMichael S. Tsirkin <mst@redhat.com>2010-11-22 10:00:07 +0200
commit5af0a04bea1f1704432b7c118c00a466e862bf00 (patch)
treecadd0eaaeb25d23e4382a0eeb4f0f0236067825b /hw
parentb4694b7ce8bd87c4b9c6c14ad74075a31b15c784 (diff)
downloadqemu-5af0a04bea1f1704432b7c118c00a466e862bf00.zip
qemu-5af0a04bea1f1704432b7c118c00a466e862bf00.tar.gz
qemu-5af0a04bea1f1704432b7c118c00a466e862bf00.tar.bz2
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 <yamahata@valinux.co.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/qdev.c5
-rw-r--r--hw/qdev.h1
2 files changed, 6 insertions, 0 deletions
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);