mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
memory: Replace skip_dump flag with "ram_device"
Setting skip_dump on a MemoryRegion allows us to modify one specific code path, but the restriction we're trying to address encompasses more than that. If we have a RAM MemoryRegion backed by a physical device, it not only restricts our ability to dump that region, but also affects how we should manipulate it. Here we recognize that MemoryRegions do not change to sometimes allow dumps and other times not, so we replace setting the skip_dump flag with a new initializer so that we know exactly the type of region to which we're applying this behavior. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
@@ -1355,9 +1355,14 @@ void memory_region_init_ram_ptr(MemoryRegion *mr,
|
||||
mr->ram_block = qemu_ram_alloc_from_ptr(size, ptr, mr, &error_fatal);
|
||||
}
|
||||
|
||||
void memory_region_set_skip_dump(MemoryRegion *mr)
|
||||
void memory_region_init_ram_device_ptr(MemoryRegion *mr,
|
||||
Object *owner,
|
||||
const char *name,
|
||||
uint64_t size,
|
||||
void *ptr)
|
||||
{
|
||||
mr->skip_dump = true;
|
||||
memory_region_init_ram_ptr(mr, owner, name, size, ptr);
|
||||
mr->ram_device = true;
|
||||
}
|
||||
|
||||
void memory_region_init_alias(MemoryRegion *mr,
|
||||
@@ -1491,9 +1496,9 @@ const char *memory_region_name(const MemoryRegion *mr)
|
||||
return mr->name;
|
||||
}
|
||||
|
||||
bool memory_region_is_skip_dump(MemoryRegion *mr)
|
||||
bool memory_region_is_ram_device(MemoryRegion *mr)
|
||||
{
|
||||
return mr->skip_dump;
|
||||
return mr->ram_device;
|
||||
}
|
||||
|
||||
uint8_t memory_region_get_dirty_log_mask(MemoryRegion *mr)
|
||||
|
||||
Reference in New Issue
Block a user