Let's reuse qemu_get_guest_simple_memory_mapping(), which does exactly what we want.
Cc: Marc-André Lureau <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Cc: Alex Williamson <[email protected]> Cc: Dr. David Alan Gilbert <[email protected]> Cc: Igor Mammedov <[email protected]> Cc: Claudio Fontana <[email protected]> Cc: Thomas Huth <[email protected]> Cc: "Alex Bennée" <[email protected]> Cc: Peter Xu <[email protected]> Cc: Laurent Vivier <[email protected]> Cc: Stefan Berger <[email protected]> Signed-off-by: David Hildenbrand <[email protected]> --- softmmu/memory_mapping.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/softmmu/memory_mapping.c b/softmmu/memory_mapping.c index 18d0b8067c..2677392de7 100644 --- a/softmmu/memory_mapping.c +++ b/softmmu/memory_mapping.c @@ -289,8 +289,6 @@ void qemu_get_guest_memory_mapping(MemoryMappingList *list, Error **errp) { CPUState *cpu, *first_paging_enabled_cpu; - GuestPhysBlock *block; - ram_addr_t offset, length; first_paging_enabled_cpu = find_paging_enabled_cpu(first_cpu); if (first_paging_enabled_cpu) { @@ -310,11 +308,7 @@ void qemu_get_guest_memory_mapping(MemoryMappingList *list, * If the guest doesn't use paging, the virtual address is equal to physical * address. */ - QTAILQ_FOREACH(block, &guest_phys_blocks->head, next) { - offset = block->target_start; - length = block->target_end - block->target_start; - create_new_memory_mapping(list, offset, offset, length); - } + qemu_get_guest_simple_memory_mapping(list, guest_phys_blocks); } void qemu_get_guest_simple_memory_mapping(MemoryMappingList *list, -- 2.29.2
