diff options
Diffstat (limited to 'softmmu/memory.c')
-rw-r--r-- | softmmu/memory.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/softmmu/memory.c b/softmmu/memory.c index 333e1ed7b0..676c298b60 100644 --- a/softmmu/memory.c +++ b/softmmu/memory.c @@ -1587,15 +1587,18 @@ void memory_region_init_ram_from_file(MemoryRegion *mr, uint64_t align, uint32_t ram_flags, const char *path, + bool readonly, Error **errp) { Error *err = NULL; memory_region_init(mr, owner, name, size); mr->ram = true; + mr->readonly = readonly; mr->terminates = true; mr->destructor = memory_region_destructor_ram; mr->align = align; - mr->ram_block = qemu_ram_alloc_from_file(size, mr, ram_flags, path, &err); + mr->ram_block = qemu_ram_alloc_from_file(size, mr, ram_flags, path, + readonly, &err); if (err) { mr->size = int128_zero(); object_unparent(OBJECT(mr)); @@ -1618,7 +1621,7 @@ void memory_region_init_ram_from_fd(MemoryRegion *mr, mr->destructor = memory_region_destructor_ram; mr->ram_block = qemu_ram_alloc_from_fd(size, mr, share ? RAM_SHARED : 0, - fd, &err); + fd, false, &err); if (err) { mr->size = int128_zero(); object_unparent(OBJECT(mr)); |