From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v5 3/5] Add functions for assigning ioeventfd and irqfds. Date: Mon, 10 May 2010 18:17:51 +0300 Message-ID: <4BE8239F.6000207@redhat.com> References: <1271872408-22842-1-git-send-email-cam@cs.ualberta.ca> <1271872408-22842-2-git-send-email-cam@cs.ualberta.ca> <1271872408-22842-3-git-send-email-cam@cs.ualberta.ca> <1271872408-22842-4-git-send-email-cam@cs.ualberta.ca> <4BE7E347.9050705@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org To: Cam Macdonell Return-path: Received: from mx1.redhat.com ([209.132.183.28]:29014 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752460Ab0EJPRz (ORCPT ); Mon, 10 May 2010 11:17:55 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 05/10/2010 06:13 PM, Cam Macdonell wrote: > >>> +int kvm_set_ioeventfd_mmio_long(int fd, uint32_t addr, uint32_t val, bool >>> assign) >>> +{ >>> + >>> + int ret; >>> + struct kvm_ioeventfd iofd; >>> + >>> + iofd.datamatch = val; >>> + iofd.addr = addr; >>> + iofd.len = 4; >>> + iofd.flags = KVM_IOEVENTFD_FLAG_DATAMATCH; >>> + iofd.fd = fd; >>> + >>> + if (!kvm_enabled()) >>> + return -ENOSYS; >>> + if (!assign) >>> + iofd.flags |= KVM_IOEVENTFD_FLAG_DEASSIGN; >>> >>> >> May be more usable to have separate assign and deassign functions (that can >> call into a single internal implementation). >> > I believe the convention so far is to use the 'assign' flag as > Michael's patch and the PIO version kvm_set_ioeventfd_pio_word() do. > I dislike bool arguments since they're hard to understand at the call site. However if there's precedent we can stick to it and perhaps change it all later. -- error compiling committee.c: too many arguments to function