From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNM0p-0005o8-L4 for qemu-devel@nongnu.org; Fri, 20 May 2011 05:28:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNM0o-0001hk-OD for qemu-devel@nongnu.org; Fri, 20 May 2011 05:28:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNM0o-0001hZ-BL for qemu-devel@nongnu.org; Fri, 20 May 2011 05:28:50 -0400 Message-ID: <4DD6344C.8020307@redhat.com> Date: Fri, 20 May 2011 12:28:44 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1305814352-15044-1-git-send-email-avi@redhat.com> <1305814352-15044-2-git-send-email-avi@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v1] Add declarations for hierarchical memory region API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org On 05/20/2011 12:11 AM, Stefan Hajnoczi wrote: > On Thu, May 19, 2011 at 3:12 PM, Avi Kivity wrote: > > +struct MemoryRegion { > > + /* All fields are private - violators will be prosecuted */ > > + const MemoryRegionOps *ops; > > + MemoryRegion *parent; > > In the case where a region is aliased (mapped twice into the address > space at different addresses) I need two MemoryRegions? Yes. > The > MemoryRegion describes an actual mapping in the ram_addr> tuple, not just the attributes of the region (ops, size, > ...). Correct. The region is not just a read-only descriptor. memory_region_add_subregion() can be used only once on a region (unless you _del_subregion() in between). (it also follows from the fact that there is no separate opaque for registration, and from the fact that RAM is owned by the region, not provided as part of registration). -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.