From 0333ae80eb4f7cca346b4b7e28dd1797f22bf6a2 Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Thu, 18 Feb 2016 13:16:52 +0800 Subject: 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 Reviewed-by: Fam Zheng Message-Id: <1455772616-8668-8-git-send-email-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- include/sysemu/dump.h | 1 + include/sysemu/memory_mapping.h | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h index 1da3ddb..06393c3 100644 --- a/include/sysemu/dump.h +++ b/include/sysemu/dump.h @@ -181,6 +181,7 @@ typedef struct DumpState { bool has_format; /* whether format is provided */ DumpGuestMemoryFormat format; /* valid only if has_format == true */ + QemuThread dump_thread; /* thread for detached dump */ } DumpState; uint16_t cpu_to_dump16(DumpState *s, uint16_t val); diff --git a/include/sysemu/memory_mapping.h b/include/sysemu/memory_mapping.h index a75d59a..d46d879 100644 --- a/include/sysemu/memory_mapping.h +++ b/include/sysemu/memory_mapping.h @@ -16,6 +16,7 @@ #include "qemu/queue.h" #include "qemu/typedefs.h" +#include "exec/memory.h" typedef struct GuestPhysBlock { /* visible to guest, reflects PCI hole, etc */ @@ -27,6 +28,9 @@ typedef struct GuestPhysBlock { /* points into host memory */ uint8_t *host_addr; + /* points to the MemoryRegion that this block belongs to */ + MemoryRegion *mr; + QTAILQ_ENTRY(GuestPhysBlock) next; } GuestPhysBlock; -- cgit v1.1