Paolo Bonzini <pbonz...@redhat.com> writes:

> 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.

Well, my motivation was that very soon we will have an infinite number of
arguments to the walk functions (oh wait! we already have) :)

>> 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.

Oh so there is such a case. Ok, got it now, thanks!

> Paolo

Reply via email to