mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-23 18:12:00 -06:00
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>
This commit is contained in:
parent
9bdbbfc3a0
commit
0293214b8c
2 changed files with 42 additions and 16 deletions
|
@ -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);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue