[vbox-dev] Mechanism to instantiate multiple devices

Knut St. Osmundsen bird at innotek.de
Sat May 5 17:46:29 GMT 2007


Robert Zeljko wrote:
> I think I know what is my problem.
> In the src/VBox/VMM/PDMDevice.cpp I'm running into assertion
> "Only one PCI device per device is currently implemented!".
> What would I have to do in order to implement this?
> Is this beyond what I could do in a day or two or is this something relatively
> straight forward?

IIRC there are a few places where the PCI bus device and/or the PDM 
makes assumptions about this 1:1 relationship between pci devices and 
PDM devices. Finding and correcting those assumptions might be a bit of 
work, but I cannot say exactly how much because it's quite a while since 
I last thought about this issue (it has never really been a subject with 
the hardware we're currently emulating).

> --- Robert Zeljko <robertzeljko at yahoo.com> wrote:
> 
>> PDMDEVREG data structure contains cbInstances field which I'm assuming
>> indicates max instance number of the device.
>> What is the mechanism to instantiate multiple devices except via VM
>> configuration changes, if any?

You mean cInstances here I assume. And yes, it's for restricting the 
number of device instances that can be created of a devices.

Currently the only way to create instances of a device is by adding the 
right configuration data (inspect a VM with multiple network cards for 
an example). (We might later wish to 'hotplug' device on the fly, but 
even here, configuration data is required to be provided when calling 
the API(s) for creating the device instance.)

Kind Regards,
  knut




More information about the vbox-dev mailing list