On 21 May 2013 11:57, Paolo Bonzini <pbonz...@redhat.com> wrote: > From: Alexey Kardashevskiy <a...@ozlabs.ru> > > The "info mtree" command in QEMU console prints only "memory" and "I/O" > address spaces while there are actually a lot more other AddressSpace > structs created by PCI and VIO devices. Those devices do not normally > have names and therefore not present in "info mtree" output.
> @@ -815,7 +815,8 @@ static PCIDevice *do_pci_register_device(PCIDevice > *pci_dev, PCIBus *bus, > memory_region_init_alias(&pci_dev->bus_master_enable_region, "bus > master", > dma_as->root, 0, > memory_region_size(dma_as->root)); > memory_region_set_enabled(&pci_dev->bus_master_enable_region, false); > - address_space_init(&pci_dev->bus_master_as, > &pci_dev->bus_master_enable_region); > + address_space_init(&pci_dev->bus_master_as, > &pci_dev->bus_master_enable_region, > + name); Overlong line. > @@ -858,8 +858,9 @@ void mtree_info(fprintf_function mon_printf, void *f); > * > * @as: an uninitialized #AddressSpace > * @root: a #MemoryRegion that routes addesses for the address space > + * @name: an address space name Does this need to be a unique name? Does it matter if it changes? (compare/contrast the documentation of memory_region_init()'s name param) > */ > -void address_space_init(AddressSpace *as, MemoryRegion *root); > +void address_space_init(AddressSpace *as, MemoryRegion *root, const char > *name); > > > /** > diff --git a/memory.c b/memory.c > index e3970bf..66258e2 100644 > --- a/memory.c > +++ b/memory.c > @@ -1605,7 +1605,7 @@ void memory_listener_unregister(MemoryListener > *listener) > QTAILQ_REMOVE(&memory_listeners, listener, link); > } > > -void address_space_init(AddressSpace *as, MemoryRegion *root) > +void address_space_init(AddressSpace *as, MemoryRegion *root, const char > *name) > { > memory_region_transaction_begin(); > as->root = root; > @@ -1614,7 +1614,7 @@ void address_space_init(AddressSpace *as, MemoryRegion > *root) > as->ioeventfd_nb = 0; > as->ioeventfds = NULL; > QTAILQ_INSERT_TAIL(&address_spaces, as, address_spaces_link); > - as->name = NULL; > + as->name = g_strdup(name?name:"anonymous"); This needs spaces round the ? and :. thanks -- PMM