qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.


From: Anthony Liguori
Subject: Re: [Qemu-devel] [RFC PATCH v2 1/3] virtio-bus : Introduce VirtioBus.
Date: Mon, 26 Nov 2012 10:59:16 -0600
User-agent: Notmuch/0.13.2+93~ged93d79 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu)

Peter Maydell <address@hidden> writes:

> On 26 November 2012 14:33, Anthony Liguori <address@hidden> 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

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