Re: [PATCH 1/6] virtio interace

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

 



On Fri, 2007-09-21 at 14:05 +0200, Arnd Bergmann wrote:
> On Thursday 20 September 2007, Rusty Russell wrote:
> > +int register_virtio_driver(struct virtio_driver *drv);
> > +void unregister_virtio_driver(struct virtio_driver *drv);
> > +
> > +/* The particular virtio backend supplies these. */
> > +struct virtio_backend_ops {
> > +       int (*register_driver)(struct virtio_driver *drv);
> > +       void (*unregister_driver)(struct virtio_driver *drv);
> > +};
> > +extern struct virtio_backend_ops virtio_backend_ops;
> 
> This still seems a little awkward. From what I understand, you register
> a virtio_driver, which leads to a pci_driver (or whatever you are based on)
> to be registered behind the covers, so that the pci_device can be used
> directly as the virtio device.

Hi Arnd,

	Yes, and I dislike it too. 

> I think there should instead be a pci_driver that automatically binds
> to all PCI based virtio imlpementations and creates a child device for
> the actual virtio_device.

I'm not sure I understand.  For PCI probing to work, you want to have
identified yourself as a driver for each PCI id claimed by a virtio
device.

Hmm, I guess we could have a PCI driver which claims all VIRTIO vendor
devices.  Then it can call virtio_find_driver() (?) at the top of its
probe function to find if there's a matching virtio driver.  This PCI
driver would have to be initialized after all the virtio drivers are
registered, but that's easy.

The virtio layer would simply maintain a linked list of drivers and
implement the virtio_find_driver() matching function.

And since we've suppressed normal PCI driver request_module (since it
always finds "the driver") then we can implement that in
virtio_find_driver(), and not use a PCI MODULE_DEVICE_TABLE.  Then we
don't need (full) PCI ids at all.

OK, I have some coding to do now...
Rusty.

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux