Davide Libenzi wrote: > On Wed, 16 May 2007, Avi Kivity wrote: > > >> IMO doing eventfd_fget() asap is best. I much prefer refcounted pointers to >> handles in the kernel: it's easier to see what things point to, and there is >> to context needed for dereferencing. >> > > There are concerns (from Al and Christoph) about file lifetime tracking of > an fd passed down to the kernel. >
What concerns are these? I have my own concerns about bare fds, which can change their backing file, and which are dependent on the context. The kernel appears to be moving away from handles to pointers, as seen by the pid -> task_struck/struct pid conversion. > Avi, how about you go the other way around? I expose you something like: > > long eventfd_create(unsigned int count, void (*release)(void *), > void *priv); > > This returns you an eventfd (or error), and lets you install a callback to > be used when the file_operations->release is called (basically, userspace > closed the last file instance). > Can KVM pass back an fd to userspace instead of the other way around? > That was my original thought, but when I saw your proposal I preferred that as more flexible. If we go this way, I prefer to have a struct file * and do away with the callback, but that brings us back to the file lifetime concerns. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel