Il 09/12/2013 18:56, Bandan Das ha scritto: >> > This is a generic walk function. >> > For reset you want post-order, but in other cases pre-order may make >> > more sense, for example realize. > Sorry, not sure if I get it. What I meant was will this work ? > > int qbus_walk_children(BusState *bus, qdev_walkerfn *devfn, > - qbus_walkerfn *busfn, void *opaque) > + qbus_walkerfn *busfn, bool ispostorder, void *opaque)
Yes, but it is a bit less flexible. > Or there's a case where we would like to traverse pre for parent and post > for children's buses (or something similar).. Probably not, but there may be a case where you want both pre and post (i.e. before and after). For example a "display tree" functionality where the post-order callbacks simply decrement the current indentation. Paolo