diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-12-06 17:54:26 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2013-12-23 13:12:35 +0200 |
commit | 0293214b8c5bf56a095d0a39c5821c9da66dd566 (patch) | |
tree | 3c56eaae6e5e925488bb86e6430939a88b26eaf0 /include/hw/qdev-core.h | |
parent | 9bdbbfc3a04c28dc43af5afffb32066623cb0022 (diff) |
qdev: allow both pre- and post-order vists in qdev walking functions
Resetting should be done in post-order, not pre-order. However,
qdev_walk_children and qbus_walk_children do not allow this. Fix
it by adding two extra arguments to the functions.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/qdev-core.h')
-rw-r--r-- | include/hw/qdev-core.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index f2043a69c2..ecf5cb316e 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -253,10 +253,15 @@ BusState *qbus_create(const char *typename, DeviceState *parent, const char *nam /* Returns > 0 if either devfn or busfn skip walk somewhere in cursion, * < 0 if either devfn or busfn terminate walk somewhere in cursion, * 0 otherwise. */ -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); +int qbus_walk_children(BusState *bus, + qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn, + qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn, + void *opaque); +int qdev_walk_children(DeviceState *dev, + qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn, + qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn, + void *opaque); + void qdev_reset_all(DeviceState *dev); /** |