mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
memory: add getter for owner
Whenever memory regions are accessed outside the BQL, they need to be preserved against hot-unplug. MemoryRegions actually do not have their own reference count; they piggyback on a QOM object, their "owner". The owner is set at creation time, and there is a function to retrieve the owner. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
b7e95164d1
commit
803c0816a7
2 changed files with 13 additions and 0 deletions
|
@ -381,6 +381,13 @@ void memory_region_init_iommu(MemoryRegion *mr,
|
|||
*/
|
||||
void memory_region_destroy(MemoryRegion *mr);
|
||||
|
||||
/**
|
||||
* memory_region_owner: get a memory region's owner.
|
||||
*
|
||||
* @mr: the memory region being queried.
|
||||
*/
|
||||
struct Object *memory_region_owner(MemoryRegion *mr);
|
||||
|
||||
/**
|
||||
* memory_region_size: get a memory region's size.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue