On 06/10/2011 06:43 PM, Anthony Liguori wrote:
What exactly is so very wrong about buses that they need to die?
They force a device tree. The device model shouldn't be a tree, but a
directed graph.
Right. As an example, you configure PCI interrupt routing and the
memory controller by writing to a PCI device, which logically doesn't
have access to any of this stuff if it's behind the PCI bus.
However, I don't think buses should die. They should be available as an
easy way to model the devices that do follow the rules. But we should
also expose everything else for the exceptional cases.
It's perfectly fine to have a type called PCIBus that I440FX extends,
but qdev shouldn't have explicit knowledge of something called a "bus"
IMHO. Doing this forces a limited mechanism of connecting devices
because it creates an artificial tree (by implying a parent/child
relationship). It makes composition difficult if not impossible.
I think qdev buses are useful as long as they don't enforce their
interfaces. That is, a qdev that is a child of a qbus has access to the
qbus's interfaces, but also access to other stuff. That makes the easy
devices easy and the hard ones possible.
--
error compiling committee.c: too many arguments to function