[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework
From: |
Alex Williamson |
Subject: |
Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework |
Date: |
Mon, 14 Nov 2011 19:29:48 -0700 |
On Mon, 2011-11-14 at 13:54 -0700, Alex Williamson wrote:
> On Fri, 2011-11-11 at 18:14 -0600, Scott Wood wrote:
> > On 11/03/2011 03:12 PM, Alex Williamson wrote:
> > > + int (*get)(void *);
> > > + void (*put)(void *);
> > > + ssize_t (*read)(void *, char __user *,
> > > + size_t, loff_t *);
> > > + ssize_t (*write)(void *, const char __user *,
> > > + size_t, loff_t *);
> > > + long (*ioctl)(void *, unsigned int, unsigned long);
> > > + int (*mmap)(void *, struct vm_area_struct *);
> > > +};
> >
> > When defining an API, please do not omit parameter names.
>
> ok
>
> > Should specify what the driver is supposed to do with get/put -- I guess
> > not try to unbind when the count is nonzero? Races could still lead the
> > unbinder to be blocked, but I guess it lets the driver know when it's
> > likely to succeed.
>
> Right, for the pci bus driver, it's mainly for reference counting,
> including the module_get to prevent vfio-pci from being unloaded. On
> the first get for a device, we also do a pci_enable() and pci_disable()
> on last put. I'll try to clarify in the docs.
Looking at these again, I should just rename them to open/release. That
matches the points when they're called. I suspect I started with just
reference counting and it grew to more of a full blown open/release.
Thanks,
Alex
Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework, Scott Wood, 2011/11/11
Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework, David Gibson, 2011/11/15
- Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework, Alex Williamson, 2011/11/15
- Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework, David Gibson, 2011/11/16
- Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework, Alex Williamson, 2011/11/18
- Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework, Scott Wood, 2011/11/18
- Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework, Alex Williamson, 2011/11/22
- Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework, Scott Wood, 2011/11/22
- Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework, Alex Williamson, 2011/11/22
Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework, David Gibson, 2011/11/20
Re: [Qemu-devel] [RFC PATCH] vfio: VFIO Driver core framework, Alex Williamson, 2011/11/22