From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQd1G-0001aj-6F for qemu-devel@nongnu.org; Tue, 23 Oct 2012 07:51:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQd1C-00051M-5H for qemu-devel@nongnu.org; Tue, 23 Oct 2012 07:51:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39587) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQd1B-00051G-T0 for qemu-devel@nongnu.org; Tue, 23 Oct 2012 07:51:34 -0400 Message-ID: <508684BE.1080103@redhat.com> Date: Tue, 23 Oct 2012 13:51:26 +0200 From: Paolo Bonzini 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> <5085140F.2070603@redhat.com> In-Reply-To: <5085140F.2070603@redhat.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: Avi Kivity Cc: Liu Ping Fan , Stefan Hajnoczi , Marcelo Tosatti , qemu-devel@nongnu.org, Anthony Liguori , Jan Kiszka Il 22/10/2012 11:38, Avi Kivity ha scritto: >> > >> > 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). So the stop_machine idea is thrown away? I really believe we're going down a rat's nest with reference counting. Paolo