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: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 3/4] qdev: allow both pre- and post-order vists in qdev walking functions
Date: Mon, 09 Dec 2013 19:04:47 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

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



reply via email to

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