Peter Maydell <peter.mayd...@linaro.org> writes:

> On 26 November 2012 14:33, Anthony Liguori <aligu...@us.ibm.com> wrote:
>> VirtioBusInfo is not a great name.  This is a proxy class that allows
>> for a device to implement the virtio bus interface.
>>
>> This could be done as an interface but since nothing else uses
>> interfaces, I'm okay with something like this.  But the first argument
>> ought to be an opaque for all methods.
>
> We have at least one user of Interface in the tree IIRC.
> I'd much rather we did this the right way -- the only reason
> it's the way Fred has coded it is that there's no obvious
> body of code in the tree to copy, so we're thrashing around
> a bit. If you tell us what the correct set of structs/classes/
> interfaces/etc is then we can implement it :-)

I really think extending virtio-bus to a virtio-pci-bus and then
initializing it with a link to the PCI device is the best approach.

It's by far the simpliest approach in terms of coding.

Did I explain it adequately?  To recap:

virtio-bus extends bus-state
 - implements everything that VirtIOBindings implements as methods

virtio-pci-bus extends virtio-bus
 - is constructed with a pointer to a PCIDevice
 - implements the methods necessary to be a virtio bus

virtio-device extends device-state
 - implements methods used by virtio-bus

Regards,

Anthony Liguori

>
> -- PMM


Reply via email to