On 05/17/2010 10:21 PM, Gerd Hoffmann wrote:
Dunno. Gerd, what do you think?
There is a PCIDevice for each function. PCIDevice->devfn (aka addr
property) contains slot+function. So hw/pci.c can figure which device
functions belong to the same slot. The pci hotplug code might need
some fixes to handle multi-function devices correctly though (I guess
this is the original issue?).
The original issue is that the code does not model reality. Yes, it
only hurts with multifunction devices.
We need a PCIDevice->devaddr and PCIDevice->function[]->fnaddr.
unplug is probably easy, plug might be harder. You have to plug-in all
functions belonging to the slot first, then signal the guest that the
slot has been hotplugged, which might need changes in the monitor
protocol.
We need to plug in a device, not functions.
--
Do not meddle in the internals of kernels, for they are subtle and quick to
panic.