mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -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
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue