mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-10-06 19:19:41 +00:00
dump: Add arch cleanup function
Some architectures (s390x) need to cleanup after a failed dump to be able to continue to run the vm. Add a cleanup function pointer and call it if it's set. Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20231109120443.185979-3-frankja@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
816644b121
commit
e72629e514
|
@ -96,6 +96,10 @@ uint64_t cpu_to_dump64(DumpState *s, uint64_t val)
|
||||||
|
|
||||||
static int dump_cleanup(DumpState *s)
|
static int dump_cleanup(DumpState *s)
|
||||||
{
|
{
|
||||||
|
if (s->dump_info.arch_cleanup_fn) {
|
||||||
|
s->dump_info.arch_cleanup_fn(s);
|
||||||
|
}
|
||||||
|
|
||||||
guest_phys_blocks_free(&s->guest_phys_blocks);
|
guest_phys_blocks_free(&s->guest_phys_blocks);
|
||||||
memory_mapping_list_free(&s->list);
|
memory_mapping_list_free(&s->list);
|
||||||
close(s->fd);
|
close(s->fd);
|
||||||
|
|
|
@ -24,6 +24,7 @@ typedef struct ArchDumpInfo {
|
||||||
void (*arch_sections_add_fn)(DumpState *s);
|
void (*arch_sections_add_fn)(DumpState *s);
|
||||||
uint64_t (*arch_sections_write_hdr_fn)(DumpState *s, uint8_t *buff);
|
uint64_t (*arch_sections_write_hdr_fn)(DumpState *s, uint8_t *buff);
|
||||||
int (*arch_sections_write_fn)(DumpState *s, uint8_t *buff);
|
int (*arch_sections_write_fn)(DumpState *s, uint8_t *buff);
|
||||||
|
void (*arch_cleanup_fn)(DumpState *s);
|
||||||
} ArchDumpInfo;
|
} ArchDumpInfo;
|
||||||
|
|
||||||
struct GuestPhysBlockList; /* memory_mapping.h */
|
struct GuestPhysBlockList; /* memory_mapping.h */
|
||||||
|
|
Loading…
Reference in a new issue