Received: from eggs.gnu.org ([2001:4830:134:3::10]:48361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq5Ms-0006T3-Sb for qemu-devel@nongnu.org; Mon, 09 Dec 2013 13:15:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vq5Mm-0007i2-So for qemu-devel@nongnu.org; Mon, 09 Dec 2013 13:15:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq5Mm-0007hy-Ks for qemu-devel@nongnu.org; Mon, 09 Dec 2013 13:15:36 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB9IFZK9004791 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Dec 2013 13:15:35 -0500 From: Bandan Das References: <1386348867-25038-1-git-send-email-pbonzini@redhat.com> <1386348867-25038-4-git-send-email-pbonzini@redhat.com> <52A59256.6030105@redhat.com> <52A6063F.5070408@redhat.com> Date: Mon, 09 Dec 2013 13:15:34 -0500 In-Reply-To: <52A6063F.5070408@redhat.com> (Paolo Bonzini's message of "Mon, 09 Dec 2013 19:04:47 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 3/4] qdev: allow both pre- and post-order vists in qdev walking functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, mst@redhat.com Paolo Bonzini 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