From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [RFC PATCH 3/6] RAMBlock: Add a name field Date: Tue, 08 Jun 2010 14:09:40 -0600 Message-ID: <1276027780.3079.1.camel@x201> References: <20100608191447.4451.47795.stgit@localhost.localdomain> <20100608191557.4451.30384.stgit@localhost.localdomain> <4C0EA301.4020605@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, quintela@redhat.com, chrisw@redhat.com To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:9287 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752431Ab0FHUJq (ORCPT ); Tue, 8 Jun 2010 16:09:46 -0400 In-Reply-To: <4C0EA301.4020605@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: 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