aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-06-10 19:15:23 +0800
committerMichael S. Tsirkin <mst@redhat.com>2014-06-19 18:44:20 +0300
commita35ba7be4b696d4c7b47318fd2022e6c3eca0a63 (patch)
treef206d1f7d758c159e96724fb066c8c6c3d38c57b /exec.c
parent605d0a945d020e3024aa7faf8a0e8b471371d8ff (diff)
downloadqemu-a35ba7be4b696d4c7b47318fd2022e6c3eca0a63.zip
qemu-a35ba7be4b696d4c7b47318fd2022e6c3eca0a63.tar.gz
qemu-a35ba7be4b696d4c7b47318fd2022e6c3eca0a63.tar.bz2
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 'exec.c')
-rw-r--r--exec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 997ef6a..a27923a 100644
--- a/exec.c
+++ b/exec.c
@@ -1448,6 +1448,13 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t length)
}
#endif /* !_WIN32 */
+int qemu_get_ram_fd(ram_addr_t addr)
+{
+ RAMBlock *block = qemu_get_ram_block(addr);
+
+ return block->fd;
+}
+
/* Return a host pointer to ram allocated with qemu_ram_alloc.
With the exception of the softmmu code in this file, this should
only be used for local memory (e.g. video ram) that the device owns,