[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 100/136] memory: Simplify memory_region_init_rom_nomigrate() to ea
From: |
Paolo Bonzini |
Subject: |
[PULL 100/136] memory: Simplify memory_region_init_rom_nomigrate() to ease review |
Date: |
Tue, 25 Feb 2020 12:50:30 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
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.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Supersedes: <address@hidden>
---
memory.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/memory.c b/memory.c
index ce11798..6a327a5 100644
--- a/memory.c
+++ b/memory.c
@@ -1659,19 +1659,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,
--
1.8.3.1
- [PULL 091/136] hw/virtio: Let virtqueue_map_iovec() use a boolean 'is_write' argument, (continued)
- [PULL 091/136] hw/virtio: Let virtqueue_map_iovec() use a boolean 'is_write' argument, Paolo Bonzini, 2020/02/25
- [PULL 092/136] hw/virtio: Let vhost_memory_map() use a boolean 'is_write' argument, Paolo Bonzini, 2020/02/25
- [PULL 093/136] exec: Let address_space_unmap() use a boolean 'is_write' argument, Paolo Bonzini, 2020/02/25
- [PULL 096/136] exec: Let cpu_[physical]_memory API use a boolean 'is_write' argument, Paolo Bonzini, 2020/02/25
- [PULL 094/136] Let address_space_rw() calls pass a boolean 'is_write' argument, Paolo Bonzini, 2020/02/25
- [PULL 099/136] memory: Correctly return alias region type, Paolo Bonzini, 2020/02/25
- [PULL 097/136] Let cpu_[physical]_memory() calls pass a boolean 'is_write' argument, Paolo Bonzini, 2020/02/25
- [PULL 098/136] Avoid cpu_physical_memory_rw() with a constant is_write argument, Paolo Bonzini, 2020/02/25
- [PULL 095/136] Avoid address_space_rw() with a constant is_write argument, Paolo Bonzini, 2020/02/25
- [PULL 102/136] scripts/cocci: Patch to replace memory_region_init_{ram, readonly -> rom}, Paolo Bonzini, 2020/02/25
- [PULL 100/136] memory: Simplify memory_region_init_rom_nomigrate() to ease review,
Paolo Bonzini <=
- [PULL 101/136] scripts/cocci: Rename memory-region-{init-ram -> housekeeping}, Paolo Bonzini, 2020/02/25
- [PULL 103/136] hw/arm: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 104/136] hw/display: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 103/136] hw/arm: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 105/136] hw/mips: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 106/136] hw/m68k: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 107/136] hw/net: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 108/136] hw/pci-host: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 110/136] hw/riscv: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/02/25
- [PULL 113/136] scripts/cocci: Patch to detect potential use of memory_region_init_rom, Paolo Bonzini, 2020/02/25