mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
dump-guest-memory: add "detach" support
If "detach" is provided, one thread is created to do the dump work, while main thread will return immediately. For each GuestPhysBlock, adding one more field "mr" to points to MemoryRegion that it belongs, also ref the mr before use. Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Message-Id: <1455772616-8668-8-git-send-email-peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
63e27f28f2
commit
1fbeff72c2
4 changed files with 34 additions and 1 deletions
|
@ -178,6 +178,7 @@ void guest_phys_blocks_free(GuestPhysBlockList *list)
|
|||
|
||||
QTAILQ_FOREACH_SAFE(p, &list->head, next, q) {
|
||||
QTAILQ_REMOVE(&list->head, p, next);
|
||||
memory_region_unref(p->mr);
|
||||
g_free(p);
|
||||
}
|
||||
list->num = 0;
|
||||
|
@ -241,6 +242,8 @@ static void guest_phys_blocks_region_add(MemoryListener *listener,
|
|||
block->target_start = target_start;
|
||||
block->target_end = target_end;
|
||||
block->host_addr = host_addr;
|
||||
block->mr = section->mr;
|
||||
memory_region_ref(section->mr);
|
||||
|
||||
QTAILQ_INSERT_TAIL(&g->list->head, block, next);
|
||||
++g->list->num;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue