aboutsummaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2020-02-24 10:13:00 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2020-03-17 15:18:45 +0100
commit39fa93c4438e7c5efb93d859224d27d04e5c2160 (patch)
tree2020e4e8a389bf9c5e84bc1e9e657b97a73254d4 /memory.c
parentac90871cf8030753a7bcef26fa1662c4e3c90078 (diff)
downloadqemu-39fa93c4438e7c5efb93d859224d27d04e5c2160.zip
qemu-39fa93c4438e7c5efb93d859224d27d04e5c2160.tar.gz
qemu-39fa93c4438e7c5efb93d859224d27d04e5c2160.tar.bz2
memory: Correctly return alias region type
Since memory region aliases are neither rom nor ram, they are described as i/o, which is often incorrect. Return instead the type of the original region we are aliasing. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index 404ff4e..fc99e7f 100644
--- a/memory.c
+++ b/memory.c
@@ -2819,6 +2819,9 @@ void address_space_destroy(AddressSpace *as)
static const char *memory_region_type(MemoryRegion *mr)
{
+ if (mr->alias) {
+ return memory_region_type(mr->alias);
+ }
if (memory_region_is_ram_device(mr)) {
return "ramd";
} else if (memory_region_is_romd(mr)) {