|
From: | Avi Kivity |
Subject: | Re: [Qemu-devel] [RFC PATCH 3/6] RAMBlock: Add a name field |
Date: | Wed, 09 Jun 2010 14:58:42 +0300 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Thunderbird/3.0.4 |
On 06/09/2010 05:54 AM, Paul Brook 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.Maybe not, but where it is we should be using that information. Absolute minimum we should be using the existing qdev address rather than inventing a new one. Duplicating this logic inside every device seems like a bad idea so I suggest identifying ram blocks by a (name, device) pair. For now we can allow a NULL device for system memory.
I agree, this is duplicating the qdev tree in a string. Devices/BARs should have ram qdev fields and so ram can be enumerated completely via qdev.
System memory can be part of a system device. -- error compiling committee.c: too many arguments to function
[Prev in Thread] | Current Thread | [Next in Thread] |