diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-06-10 19:15:23 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-06-19 18:44:20 +0300 |
commit | a35ba7be4b696d4c7b47318fd2022e6c3eca0a63 (patch) | |
tree | f206d1f7d758c159e96724fb066c8c6c3d38c57b /include/exec/memory.h | |
parent | 605d0a945d020e3024aa7faf8a0e8b471371d8ff (diff) |
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>
Diffstat (limited to 'include/exec/memory.h')
-rw-r--r-- | include/exec/memory.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/exec/memory.h b/include/exec/memory.h index 4c7bacf959..1cf5981b2e 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -534,6 +534,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. * * Returns a host pointer to a RAM memory region (created with |