From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6TOv-0003Rr-U8 for qemu-devel@nongnu.org; Mon, 26 Apr 2010 14:51:26 -0400 Received: from [140.186.70.92] (port=38361 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6TOt-0003Nu-Ch for qemu-devel@nongnu.org; Mon, 26 Apr 2010 14:51:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6TOr-0007kY-LH for qemu-devel@nongnu.org; Mon, 26 Apr 2010 14:51:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7383) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6TOr-0007kM-Cu for qemu-devel@nongnu.org; Mon, 26 Apr 2010 14:51:21 -0400 Date: Mon, 26 Apr 2010 15:49:28 -0300 From: Marcelo Tosatti Message-ID: <20100426184928.GF21425@amt.cnet> References: <2e085c19aac78e6c4335eac4fffeb5cfca4bbb26.1272304746.git.mtosatti@redhat.com> <4BD5DB12.6020406@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BD5DB12.6020406@codemonkey.ws> Subject: [Qemu-devel] Re: [PATCH 10/10] introduce qemu_ram_map List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Anthony Liguori , Cam Macdonell , qemu-devel@nongnu.org, kvm@vger.kernel.org On Mon, Apr 26, 2010 at 01:27:30PM -0500, Anthony Liguori wrote: > On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: > >Which allows drivers to register an mmaped region into ram block mappings. > >To be used by device assignment driver. > > This doesn't make much sense to me. > > Do you use this like: > > qemu_ram_map(64k, ptr); > assert(qemu_ram_alloc(64k) == ptr); No. hw/device-assignment.c in qemu-kvm mmaps /sys/bus/pci/devices/x:y:z/resourcen (the PCI devices memory regions) to the guest. > If so, I think this is not the best API. I'd rather see > qemu_ram_map() register a symbolic name for the region and for there > to be a qemu_ram_alloc() variant that allocated by name. > > Regards, > > Anthony Liguori >