]> git.proxmox.com Git - mirror_qemu.git/commitdiff
memory: Correctly return alias region type
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 24 Feb 2020 09:13:00 +0000 (10:13 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 17 Mar 2020 14:18:45 +0000 (15:18 +0100)
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>
memory.c

index 404ff4ed396723d98ea2a6b10c4969d42e8ce54b..fc99e7fa2c229755eedd5d180a5348f23699fbeb 100644 (file)
--- 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)) {