From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 5/9] KVM: Adds ability to signal userspace using a file-descriptor Date: Wed, 16 May 2007 13:07:07 +0300 Message-ID: <464AD7CB.5030901@qumranet.com> References: <20070515031217.9382.44999.stgit@novell1.haskins.net> <20070515031536.9382.16826.stgit@novell1.haskins.net> <4649650E.2070102@qumranet.com> <464968D6.BA47.005A.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Davide Libenzi To: Gregory Haskins Return-path: In-Reply-To: <464968D6.BA47.005A.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Gregory Haskins wrote: >>>> On Tue, May 15, 2007 at 3:45 AM, in message <4649650E.2070102-atKUWr5tajBWk0Htik3J/w@public.gmane.org>, >>>> > Avi Kivity wrote: > >> Gregory Haskins wrote: >> >>> Signed- off- by: Gregory Haskins >>> --- >>> >>> drivers/kvm/kvm.h | 1 + >>> drivers/kvm/kvm_main.c | 52 ++++++++++++++++++++++++++++++++++++++++++------ >>> include/linux/kvm.h | 1 + >>> 3 files changed, 48 insertions(+), 6 deletions(- ) >>> >>> diff -- git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h >>> index 7b5d5e6..f5731c4 100644 >>> --- a/drivers/kvm/kvm.h >>> +++ b/drivers/kvm/kvm.h >>> @@ - 333,6 +333,7 @@ struct kvm_vcpu_irq { >>> int deferred; >>> struct task_struct *task; >>> int guest_mode; >>> + int eventfd; >>> >>> >> Best to convert the fd to a filp when you install it. This avoids the >> conversion during runtime and allows you to do error checking earlier. >> > > > That was my initial impression also, but then I realized there was a problem with that: Eventfd doesnt appear to have any way to notify other entities when the fd is closed. Therefore the filp could be left dangling in this case. By using the fd instead, I can validate the pointer each time I need it. Perhaps Davide will have a suggestion here. > eventfd_fget() will bump the reference count. -- 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/