qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/4] qdev: allow both pre- and post-order vists


From: Bandan Das
Subject: Re: [Qemu-devel] [PATCH 3/4] qdev: allow both pre- and post-order vists in qdev walking functions
Date: Mon, 09 Dec 2013 13:15:34 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Paolo Bonzini <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]