Skip to content
Snippets Groups Projects
Commit c6812473 authored by Janosch Frank's avatar Janosch Frank Committed by Marc-André Lureau
Browse files

dump: Consolidate elf note function


Just like with the other write functions let's move the 32/64 bit elf
handling to a function to improve readability.

Signed-off-by: default avatarJanosch Frank <frankja@linux.ibm.com>
Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220330123603.107120-10-frankja@linux.ibm.com>
parent 5ff2e5a3
No related branches found
No related tags found
No related merge requests found
......@@ -519,6 +519,15 @@ static void write_elf_loads(DumpState *s, Error **errp)
}
}
static void write_elf_notes(DumpState *s, Error **errp)
{
if (dump_is_64bit(s)) {
write_elf64_notes(fd_write_vmcore, s, errp);
} else {
write_elf32_notes(fd_write_vmcore, s, errp);
}
}
/* write elf header, PT_NOTE and elf note to vmcore. */
static void dump_begin(DumpState *s, Error **errp)
{
......@@ -578,13 +587,8 @@ static void dump_begin(DumpState *s, Error **errp)
}
}
if (dump_is_64bit(s)) {
/* write notes to vmcore */
write_elf64_notes(fd_write_vmcore, s, errp);
} else {
/* write notes to vmcore */
write_elf32_notes(fd_write_vmcore, s, errp);
}
/* write notes to vmcore */
write_elf_notes(s, errp);
}
static int get_next_block(DumpState *s, GuestPhysBlock *block)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment