On 08/01/2016 10:29, Stefan Hajnoczi wrote: > As a side-note, the initial RAM that the guest started with might not > be modelled with a "pc-dimm" device and it can't be unplugged. > > The guest RAM itself isn't contained inside the "pc-dimm" object. > Instead the "pc-dimm" must be associated with a "memory-backend" > object.
Perhaps it's worth mentioning that the initial RAM can also be associated with one or more memory-backend objects, typically one per virtual NUMA node. The memory-backend is passed to QEMU via "-numa node,...,memdev=ID". > The MemoryRegion is the link between guest physical address space and > the RAMBlocks containing the memory. Each MemoryRegion has the > ram_addr_t offset of the RAMBlock and each RAMBlock has a MemoryRegion > pointer. As a side note (probably beyond the scope of your post) there is no reason for the MemoryRegion to use the ram_addr_t instead of the RAMBlock. It would actually be faster if the MemoryRegion contained the RAMBlock, since it's slow to look up the mmap address corresponding to the ram_addr_t. There is a 1-element MRU cache, but it's still slowish. Paolo