From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtJlr-0002T7-W5 for qemu-devel@nongnu.org; Thu, 01 Oct 2009 07:24:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtJln-0002KG-RZ for qemu-devel@nongnu.org; Thu, 01 Oct 2009 07:24:27 -0400 Received: from [199.232.76.173] (port=41716 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtJln-0002Jp-Iz for qemu-devel@nongnu.org; Thu, 01 Oct 2009 07:24:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61571) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtJlm-0007FV-Uh for qemu-devel@nongnu.org; Thu, 01 Oct 2009 07:24:23 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n91BOLR1008034 for ; Thu, 1 Oct 2009 07:24:22 -0400 Received: from zweiblum.home.kraxel.org (vpn2-8-170.ams2.redhat.com [10.36.8.170]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n91BOJV6020745 for ; Thu, 1 Oct 2009 07:24:20 -0400 Message-ID: <4AC49162.6030302@redhat.com> Date: Thu, 01 Oct 2009 13:24:18 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 6/9] pci.c: factor out while(bus) bus->next loop logic into pci_find_bus_from(). References: <1247656509-32227-1-git-send-email-yamahata@valinux.co.jp> <1247656509-32227-7-git-send-email-yamahata@valinux.co.jp> <20090930114506.GI18802@redhat.com> <20091001032934.GM24813%yamahata@valinux.co.jp> <20091001062826.GD5142@redhat.com> In-Reply-To: <20091001062826.GD5142@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 10/01/09 08:28, Michael S. Tsirkin wrote: > On Thu, Oct 01, 2009 at 12:29:34PM +0900, Isaku Yamahata wrote: >>>> +static PCIBus *pci_find_bus_from(PCIBus *from, int bus_num) >>> >>> Why what is "from"? pci_find_parent_bus a better name? >> >> Its intention is to go down from a given parent bus >> to find child bus of a given bus number, bus_num. >> The current implementation arranges PCIBus in a single linked list, >> and a single linked list doesn't represent pci bus topology well. >> So it may find a pci bus which isn't child of a given bus. Can we have two pci busses with the same bus number in a system? > I won't be surprised if we need a tree to represent PCI bus topology. > But we already have it, don't we: each bus lists devices behind it, some > of these could be buses. Yes, the qdev device tree has all the needed info already. cheers, Gerd