mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
hostmem: allow preallocation of any memory region
And allow preallocation of file-based memory even without -mem-prealloc. Some care is necessary because -mem-prealloc does not allow disabling preallocation for hostmem-file. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
605d0a945d
commit
a35ba7be4b
7 changed files with 75 additions and 0 deletions
|
@ -533,6 +533,16 @@ bool memory_region_is_logging(MemoryRegion *mr);
|
|||
*/
|
||||
bool memory_region_is_rom(MemoryRegion *mr);
|
||||
|
||||
/**
|
||||
* memory_region_get_fd: Get a file descriptor backing a RAM memory region.
|
||||
*
|
||||
* Returns a file descriptor backing a file-based RAM memory region,
|
||||
* or -1 if the region is not a file-based RAM memory region.
|
||||
*
|
||||
* @mr: the RAM or alias memory region being queried.
|
||||
*/
|
||||
int memory_region_get_fd(MemoryRegion *mr);
|
||||
|
||||
/**
|
||||
* memory_region_get_ram_ptr: Get a pointer into a RAM memory region.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue