From d43a01db285fd10f9c429476eb9c63fa5e00f3cc Mon Sep 17 00:00:00 2001 From: Stephen Brennan Date: Mon, 18 Sep 2023 16:32:32 -0700 Subject: dump: Allow directly outputting raw kdump format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The flattened format (currently output by QEMU) is used by makedumpfile only when it is outputting a vmcore to a file which is not seekable. The flattened format functions essentially as a set of instructions of the form "seek to the given offset, then write the given bytes out". The flattened format can be reconstructed using makedumpfile -R, or makedumpfile-R.pl, but it is a slow process because it requires copying the entire vmcore. The flattened format can also be directly read by crash, but still, it requires a lengthy reassembly phase. To sum up, the flattened format is not an ideal one: it should only be used on files which are actually not seekable. This is the exact strategy which makedumpfile uses, as seen in the implementation of "write_buffer()" in makedumpfile [1]. However, QEMU has always used the flattened format. For compatibility it is best not to change the default output format without warning. So, add a flag to DumpState which changes the output to use the normal (i.e. raw) format. This flag will be added to the QMP and HMP commands in the next change. [1]: https://github.com/makedumpfile/makedumpfile/blob/f23bb943568188a2746dbf9b6692668f5a2ac3b6/makedumpfile.c#L5008-L5040 Signed-off-by: Stephen Brennan Reviewed-by: Daniel P. Berrangé [ Marc-André: replace loff_t with off_t ] Reviewed-by: Marc-André Lureau Message-Id: <20230918233233.1431858-3-stephen.s.brennan@oracle.com> --- include/sysemu/dump.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h index e27af8f..d702854 100644 --- a/include/sysemu/dump.h +++ b/include/sysemu/dump.h @@ -157,6 +157,7 @@ typedef struct DumpState { MemoryMappingList list; bool resume; bool detached; + bool kdump_raw; hwaddr memory_offset; int fd; -- cgit v1.1