From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq5Hg-0000Kj-2Y for qemu-devel@nongnu.org; Mon, 09 Dec 2013 13:10:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vq5Ha-0005gy-42 for qemu-devel@nongnu.org; Mon, 09 Dec 2013 13:10:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vq5CN-0003yo-BW for qemu-devel@nongnu.org; Mon, 09 Dec 2013 13:04:51 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB9I4oKN020910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Dec 2013 13:04:50 -0500 Message-ID: <52A6063F.5070408@redhat.com> Date: Mon, 09 Dec 2013 19:04:47 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1386348867-25038-1-git-send-email-pbonzini@redhat.com> <1386348867-25038-4-git-send-email-pbonzini@redhat.com> <52A59256.6030105@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit 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: Bandan Das Cc: qemu-devel@nongnu.org, mst@redhat.com 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