From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52682 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZfYg-0001U0-38 for qemu-devel@nongnu.org; Fri, 16 Jul 2010 03:43:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZfYH-0006q1-Ms for qemu-devel@nongnu.org; Fri, 16 Jul 2010 03:41:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24320) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZfYH-0006lI-GF for qemu-devel@nongnu.org; Fri, 16 Jul 2010 03:41:45 -0400 Date: Fri, 16 Jul 2010 10:35:53 +0300 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] Re: [PATCH 1/2] pci/bridge: allocate PCIBus dynamically for PCIBridge. Message-ID: <20100716073553.GA21454@redhat.com> References: <8ab6e42be20518d6491e0cd0d5985f7df6912c01.1278037560.git.yamahata@valinux.co.jp> <20100706121852.GA20208@redhat.com> <20100707023858.GB30653@valinux.co.jp> <20100708140432.GB31905@redhat.com> <20100708154318.GA14985@valinux.co.jp> <20100708164934.GB4392@redhat.com> <20100716014651.GA32307@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100716014651.GA32307@valinux.co.jp> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: blauwirbel@gmail.com, qemu-devel@nongnu.org, Gerd Hoffmann On Fri, Jul 16, 2010 at 10:46:52AM +0900, Isaku Yamahata wrote: > On Thu, Jul 08, 2010 at 07:49:35PM +0300, Michael S. Tsirkin wrote: > > > > For root bus: > > > - pci_host_bus_new()/pci_host_bus_new_inplace() > > > qbus style api. pci segment must be specified. > > > New code should use this. > > > > I'd prefer a simple _init which works like _inplace. > > Allocating memory is simple enough for users. > > How about the following patch? > - replaced pci_bus_new(), pci_bus_new_inplace() with > pci_host_bus_init()/pci_host_bus_cleanup() > - eliminated memory allocation by embedding PCIBus into PCIHostState. > I've tested it with only piix4 yet. > If this direction is okay, I'll give it more tests and post it. > Looks good to me. What do others think? Let's also make pci_host_bus_init_simple inline. -- MST