Re: [RFC PATCH 3/6] RAMBlock: Add a name field

Chris Wright
2010-06-08T21:41:08Z

* Alex Williamson (alex.williamson@redhat.com) wrote:
> + // XXX check duplicates

Yes, definitely. You created a notion of a hierarchical namespace,
can this be formalized any more? Currently scattered...

> + char name[14];
> + snprintf(name, sizeof(name), "pci:%02x.%x.bar%d",
> + PCI_SLOT(pci_dev->dev.devfn),
> + PCI_FUNC(pci_dev->dev.devfn), i);
> + pci_dev->v_addrs[i].memory_index = qemu_ram_map(name,
> + cur_region->size, virtbase);
> + ram_addr = qemu_ram_alloc("ram.pc.lowmem", below_4g_mem_size);
> + ram_addr = qemu_ram_alloc("ram.pc.highmem", above_4g_mem_size);
> + bios_offset = qemu_ram_alloc("ram.pc.bios", bios_size);
> + option_rom_offset = qemu_ram_alloc("ram.pc.rom", PC_ROM_SIZE);
> + char name[13];
(13, 14...good to be consistent, maybe w/ helper like, pci_ram_alloc_{bar,rom})
> + snprintf(name, sizeof(name), "pci:%02x.%x.rom",
> + PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
> + pdev->rom_offset = qemu_ram_alloc(name, size);
> + s->vram_offset = qemu_ram_alloc("ram.vga.vram", vga_ram_size);
> + s->fifo_offset = qemu_ram_alloc("ram.vmsvga.fifo", s->fifo_size);

So far we have:
ram.
pc.
lowmem
highmem
bios
rom
vga.
vram
vmsvga.
fifo
pci.
D.F. (B:D.F?)
bar
rom