X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=memory_mapping.c;h=18d0b8067cb877e20e0187eae067194a65add16f;hb=2785f196318c759d2ba97a36c168e848ec38d362;hp=6a39d71da269acb950297b434e3e13d7a9c0b8b8;hpb=e80b4b8fb6babce7dcc91ea9ddeecbc351fd4646;p=mirror_qemu.git diff --git a/memory_mapping.c b/memory_mapping.c index 6a39d71da2..18d0b8067c 100644 --- a/memory_mapping.c +++ b/memory_mapping.c @@ -14,7 +14,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" -#include "qemu-common.h" #include "cpu.h" #include "sysemu/memory_mapping.h" #include "exec/memory.h" @@ -206,7 +205,8 @@ static void guest_phys_blocks_region_add(MemoryListener *listener, /* we only care about RAM */ if (!memory_region_is_ram(section->mr) || - memory_region_is_ram_device(section->mr)) { + memory_region_is_ram_device(section->mr) || + memory_region_is_nonvolatile(section->mr)) { return; } @@ -222,7 +222,7 @@ static void guest_phys_blocks_region_add(MemoryListener *listener, if (!QTAILQ_EMPTY(&g->list->head)) { hwaddr predecessor_size; - predecessor = QTAILQ_LAST(&g->list->head, GuestPhysBlockHead); + predecessor = QTAILQ_LAST(&g->list->head); predecessor_size = predecessor->target_end - predecessor->target_start; /* the memory API guarantees monotonically increasing traversal */ @@ -256,7 +256,7 @@ static void guest_phys_blocks_region_add(MemoryListener *listener, #ifdef DEBUG_GUEST_PHYS_REGION_ADD fprintf(stderr, "%s: target_start=" TARGET_FMT_plx " target_end=" - TARGET_FMT_plx ": %s (count: %u)\n", __FUNCTION__, target_start, + TARGET_FMT_plx ": %s (count: %u)\n", __func__, target_start, target_end, predecessor ? "joined" : "added", g->list->num); #endif } @@ -337,6 +337,7 @@ void memory_mapping_filter(MemoryMappingList *list, int64_t begin, if (cur->phys_addr >= begin + length || cur->phys_addr + cur->length <= begin) { QTAILQ_REMOVE(&list->head, cur, next); + g_free(cur); list->num--; continue; }