diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2020-02-24 10:58:17 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-03-17 15:18:46 +0100 |
commit | 83696c8f78303d916fd8d126bc28b67f25320acb (patch) | |
tree | 318f4ae45c1611189c49796d5baec9a0faff10c2 /memory.c | |
parent | 39fa93c4438e7c5efb93d859224d27d04e5c2160 (diff) | |
download | qemu-83696c8f78303d916fd8d126bc28b67f25320acb.zip qemu-83696c8f78303d916fd8d126bc28b67f25320acb.tar.gz qemu-83696c8f78303d916fd8d126bc28b67f25320acb.tar.bz2 |
memory: Simplify memory_region_init_rom_nomigrate() to ease review
memory_region_init_rom_nomigrate() has the same content than
memory_region_init_ram_shared_nomigrate(), with setting the
readonly mode. The code is easier to review as creating a
readonly ram/shared/nomigrate region.
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -1660,19 +1660,8 @@ void memory_region_init_rom_nomigrate(MemoryRegion *mr, uint64_t size, Error **errp) { - Error *err = NULL; - memory_region_init(mr, owner, name, size); - mr->ram = true; + memory_region_init_ram_shared_nomigrate(mr, owner, name, size, false, errp); mr->readonly = true; - mr->terminates = true; - mr->destructor = memory_region_destructor_ram; - mr->ram_block = qemu_ram_alloc(size, false, mr, &err); - mr->dirty_log_mask = tcg_enabled() ? (1 << DIRTY_MEMORY_CODE) : 0; - if (err) { - mr->size = int128_zero(); - object_unparent(OBJECT(mr)); - error_propagate(errp, err); - } } void memory_region_init_rom_device_nomigrate(MemoryRegion *mr, |