From 5ee163e8ea2fb6610339f494e039159e08a69066 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Tue, 6 Aug 2013 12:37:09 +0200 Subject: dump: introduce GuestPhysBlockList The vmcore must use physical addresses that are visible to the guest, not addresses that point into linear RAMBlocks. As first step, introduce the list type into which we'll collect the physical mappings in effect at the time of the dump. Related RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=981582 Signed-off-by: Laszlo Ersek Signed-off-by: Luiz Capitulino --- memory_mapping.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'memory_mapping.c') diff --git a/memory_mapping.c b/memory_mapping.c index 515a984..c70505b 100644 --- a/memory_mapping.c +++ b/memory_mapping.c @@ -165,6 +165,23 @@ void memory_mapping_list_init(MemoryMappingList *list) QTAILQ_INIT(&list->head); } +void guest_phys_blocks_free(GuestPhysBlockList *list) +{ + GuestPhysBlock *p, *q; + + QTAILQ_FOREACH_SAFE(p, &list->head, next, q) { + QTAILQ_REMOVE(&list->head, p, next); + g_free(p); + } + list->num = 0; +} + +void guest_phys_blocks_init(GuestPhysBlockList *list) +{ + list->num = 0; + QTAILQ_INIT(&list->head); +} + static CPUState *find_paging_enabled_cpu(CPUState *start_cpu) { CPUState *cpu; -- cgit v1.1