qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 1/2] pci/bridge: allocate PCIBus dynamically for


From: Michael S. Tsirkin
Subject: [Qemu-devel] Re: [PATCH 1/2] pci/bridge: allocate PCIBus dynamically for PCIBridge.
Date: Thu, 8 Jul 2010 17:04:32 +0300
User-agent: Mutt/1.5.20 (2009-12-10)

On Wed, Jul 07, 2010 at 11:38:58AM +0900, Isaku Yamahata wrote:
> But you claim it's only for root bus, not for secondary bus.

It is currently, isn't it?

> Now I realized why you've rejected such patches so far.
> Then, you also mean the current pci_register_secondary_bus() is broken.

Sorry about being dense, what is broken?

> I also think it's broken. So how do we want to fix it?
> My idea is as follows.
> 
> - introduce something like pci_secondary_bus_new()
>   (pci_sec_bus_new() for short?) for secondary bus. 
>   fix pci_register_secondary_bus() with it.
> 
> - introduce something like pci_host_bus_new() (or pci_root_bus_new()?)
>   for pci host bus which is more generic than pci_bus_new().
>   It's for
>   - to avoid confusion.

IMHO the confusion comes from the fact we have too
many functions that do almost, but not quite, the same
thing, and the function names do not say anything.

We have a ton of 5 line functions with names like
_allocate_inplace, _new, _register, _simple

>   - to eliminate assumption of pci_bus_new().
>     pci_bus_new() assumes that its pci segment is 0.
>     keep pci_bus_new() as a convenience wrapper of
>     pci_host_bus_new(segment = 0). Thus we can avoid fixing up
>     all the caller.

We have a single caller, right? I think you mean pci_register_bus?
So IIUC, you propose that we add pci_register_host_bus,
and make pci_register_bus a compatibility wrapper?
Sure, let's just add a comment this is deprecated.

I am not sure why do we need an API to deal with secondary bus:
it is always a part of the bridge, so all users can and should call
pci_bridge_init?

-- 
MST



reply via email to

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