diff options
author | Laszlo Ersek <lersek@redhat.com> | 2013-08-06 12:37:09 +0200 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2013-08-08 11:01:46 -0400 |
commit | 5ee163e8ea2fb6610339f494e039159e08a69066 (patch) | |
tree | 1920cb270da0408460aa213ee9c16286557cf7c8 /memory_mapping.c | |
parent | 2cac260768b9d4253737417ea7501cf2950e257f (diff) |
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 <lersek@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'memory_mapping.c')
-rw-r--r-- | memory_mapping.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/memory_mapping.c b/memory_mapping.c index 515a984e0d..c70505b7fa 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; |