Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M9Jw5-00026E-AA for qemu-devel@nongnu.org; Wed, 27 May 2009 10:16:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M9Jw0-00023z-Jf for qemu-devel@nongnu.org; Wed, 27 May 2009 10:16:52 -0400 Received: from [199.232.76.173] (port=50985 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9Jw0-00023p-CL for qemu-devel@nongnu.org; Wed, 27 May 2009 10:16:48 -0400 Received: from verein.lst.de ([213.95.11.210]:35146) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1M9Jvz-0000xz-RT for qemu-devel@nongnu.org; Wed, 27 May 2009 10:16:48 -0400 Date: Wed, 27 May 2009 16:16:44 +0200 From: Christoph Hellwig Subject: Re: [Qemu-devel] [PATCH 1/3] Add PhysicalMemoryRegion type Message-ID: <20090527141644.GB29118@lst.de> References: <1243157375-14329-1-git-send-email-avi@redhat.com> <1243157375-14329-2-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1243157375-14329-2-git-send-email-avi@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org On Sun, May 24, 2009 at 12:29:33PM +0300, Avi Kivity wrote: > +struct PhysicalMemoryRegion { > + target_phys_addr_t start_addr; > + target_phys_addr_t size; > + ram_addr_t ram_addr; > + ram_addr_t region_offset; > +}; > + > +PhysicalMemoryRegion *physical_memory_region_register( > + target_phys_addr_t start_addr, > + target_phys_addr_t size, > + ram_addr_t ram_addr) > +{ > + return physical_memory_region_register_offset(start_addr, size, ram_addr, 0); > +} Wouldn't it be much easier if the client allocated the PhysicalMemoryRegion and just passed a pointer to it into physical_memory_region_register? That would also take care of the physical_memory_region_register vs physical_memory_region_register_offset split as the non-offset case would just not fill out the region_offset field and be done with it.