From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQESw-0007eU-NB for qemu-devel@nongnu.org; Mon, 22 Oct 2012 05:38:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQESs-00023C-Rp for qemu-devel@nongnu.org; Mon, 22 Oct 2012 05:38:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQESs-000234-JF for qemu-devel@nongnu.org; Mon, 22 Oct 2012 05:38:30 -0400 Message-ID: <5085140F.2070603@redhat.com> Date: Mon, 22 Oct 2012 11:38:23 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1350897839-29593-1-git-send-email-pingfank@linux.vnet.ibm.com> <1350897839-29593-6-git-send-email-pingfank@linux.vnet.ibm.com> In-Reply-To: <1350897839-29593-6-git-send-email-pingfank@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [patch v4 05/16] memory: introduce ref, unref interface for MemoryRegionOps List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Ping Fan Cc: Stefan Hajnoczi , Marcelo Tosatti , qemu-devel@nongnu.org, Anthony Liguori , Jan Kiszka , Paolo Bonzini On 10/22/2012 11:23 AM, Liu Ping Fan wrote: > This pair of interface help to decide when dispatching, whether > we can pin mr without big lock or not. > > Signed-off-by: Liu Ping Fan > --- > memory.h | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/memory.h b/memory.h > index bd1bbae..9039411 100644 > --- a/memory.h > +++ b/memory.h > @@ -25,6 +25,7 @@ > #include "iorange.h" > #include "ioport.h" > #include "int128.h" > +#include "qemu/object.h" Unneeded. > > typedef struct MemoryRegionOps MemoryRegionOps; > typedef struct MemoryRegion MemoryRegion; > @@ -66,6 +67,8 @@ struct MemoryRegionOps { > target_phys_addr_t addr, > uint64_t data, > unsigned size); > + int (*ref)(MemoryRegion *mr); > + void (*unref)(MemoryRegion *mr); > Why return an int? Should succeed unconditionally. Please fold into 7 (along with 6). -- error compiling committee.c: too many arguments to function