Skip to content

Commit

Permalink
dump: Add arch cleanup function
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
  • Loading branch information
frankjaa authored and huth committed Nov 14, 2023
1 parent 816644b commit e72629e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dump/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ uint64_t cpu_to_dump64(DumpState *s, uint64_t val)

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);
memory_mapping_list_free(&s->list);
close(s->fd);
Expand Down
1 change: 1 addition & 0 deletions include/sysemu/dump-arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ typedef struct ArchDumpInfo {
void (*arch_sections_add_fn)(DumpState *s);
uint64_t (*arch_sections_write_hdr_fn)(DumpState *s, uint8_t *buff);
int (*arch_sections_write_fn)(DumpState *s, uint8_t *buff);
void (*arch_cleanup_fn)(DumpState *s);
} ArchDumpInfo;

struct GuestPhysBlockList; /* memory_mapping.h */
Expand Down

0 comments on commit e72629e

Please sign in to comment.