diff options
| author | Paolo Bonzini | 2014-06-10 13:15:24 +0200 |
|---|---|---|
| committer | Michael S. Tsirkin | 2014-06-19 17:44:20 +0200 |
| commit | dbcb8981183592be129b2e624b7bcd4245e75fbc (patch) | |
| tree | 639391848fc2cb66c281fb7e8a9fae377bee87f1 /memory.c | |
| parent | hostmem: allow preallocation of any memory region (diff) | |
| download | qemu-dbcb8981183592be129b2e624b7bcd4245e75fbc.tar.gz qemu-dbcb8981183592be129b2e624b7bcd4245e75fbc.tar.xz qemu-dbcb8981183592be129b2e624b7bcd4245e75fbc.zip | |
hostmem: add property to map memory with MAP_SHARED
A new "share" property can be used with the "memory-file" backend to
map memory with MAP_SHARED instead of MAP_PRIVATE.
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 'memory.c')
| -rw-r--r-- | memory.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1038,6 +1038,7 @@ void memory_region_init_ram_from_file(MemoryRegion *mr, struct Object *owner, const char *name, uint64_t size, + bool share, const char *path, Error **errp) { @@ -1045,7 +1046,7 @@ void memory_region_init_ram_from_file(MemoryRegion *mr, mr->ram = true; mr->terminates = true; mr->destructor = memory_region_destructor_ram; - mr->ram_addr = qemu_ram_alloc_from_file(size, mr, path, errp); + mr->ram_addr = qemu_ram_alloc_from_file(size, mr, share, path, errp); } #endif |
