From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: Re: [Qemu-devel] [RFC PATCH 3/6] RAMBlock: Add a name field Date: Wed, 09 Jun 2010 09:28:20 +0200 Message-ID: <4C0F4294.6070105@redhat.com> References: <20100608191447.4451.47795.stgit@localhost.localdomain> <20100608191557.4451.30384.stgit@localhost.localdomain> <201006090330.10324.paul@codesourcery.com> <4C0EFF39.9070602@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Paul Brook , qemu-devel@nongnu.org, chrisw@redhat.com, Alex Williamson , kvm@vger.kernel.org, quintela@redhat.com To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:45722 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750739Ab0FIH2h (ORCPT ); Wed, 9 Jun 2010 03:28:37 -0400 In-Reply-To: <4C0EFF39.9070602@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: On 06/09/10 04:40, Anthony Liguori wrote: > On 06/08/2010 09:30 PM, Paul Brook 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. >>> @@ -1924,7 +1925,9 @@ static int pci_add_option_rom(PCIDevice *pdev) >>> + snprintf(name, sizeof(name), "pci:%02x.%x.rom", >>> + PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn)); >>> + pdev->rom_offset = qemu_ram_alloc(name, size); >> This looks pretty bogus. It should be associated with the device, >> rather than >> incorrectly trying to generate a globally unique name. > > Not all ram is associated with a device. Nevertheless qdev could carry a list of any device specific ram, so qdev_free() could automagically cleanup for you on unplug. You could also reuse DeviceState->info->vmsd->name for the ram section naming. cheers, Gerd