From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53291 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OM57L-000396-4w for qemu-devel@nongnu.org; Tue, 08 Jun 2010 16:09:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OM57J-0001LD-RR for qemu-devel@nongnu.org; Tue, 08 Jun 2010 16:09:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15610) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OM57J-0001Kv-HV for qemu-devel@nongnu.org; Tue, 08 Jun 2010 16:09:45 -0400 From: Alex Williamson In-Reply-To: <4C0EA301.4020605@codemonkey.ws> References: <20100608191447.4451.47795.stgit@localhost.localdomain> <20100608191557.4451.30384.stgit@localhost.localdomain> <4C0EA301.4020605@codemonkey.ws> Content-Type: text/plain; charset="UTF-8" Date: Tue, 08 Jun 2010 14:09:40 -0600 Message-ID: <1276027780.3079.1.camel@x201> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [RFC PATCH 3/6] RAMBlock: Add a name field List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: chrisw@redhat.com, qemu-devel@nongnu.org, kvm@vger.kernel.org, quintela@redhat.com On Tue, 2010-06-08 at 15:07 -0500, Anthony Liguori wrote: > On 06/08/2010 02:15 PM, Alex Williamson wrote: > > The offset given to a block created via qemu_ram_alloc/map() is arbitrary, > > let the caller specify a name so we can make a positive match. > > > > Note, this only addresses the qemu-kvm callers so far. > > > > -ram_addr_t qemu_ram_map(ram_addr_t size, void *host) > > +ram_addr_t qemu_ram_map(const char *name, ram_addr_t size, void *host) > > { > > RAMBlock *new_block; > > > > size = TARGET_PAGE_ALIGN(size); > > new_block = qemu_malloc(sizeof(*new_block)); > > > > + // XXX check duplicates > > + snprintf(new_block->name, sizeof(new_block->name), "%s", strdup(name)); > > > > That strdup() is probably unintentional. Yep, thanks. Alex