40238397 | 31-Oct-2023 |
Markus Armbruster <armbru@redhat.com> |
dump: Drop redundant check for empty dump
dump_init() first computes the size of the dump, taking the filter area into account, and fails if its zero. It then looks for memory in the filter area, a
dump: Drop redundant check for empty dump
dump_init() first computes the size of the dump, taking the filter area into account, and fails if its zero. It then looks for memory in the filter area, and fails if there is none.
This is redundant: if the size of the dump is zero, there is no memory, and vice versa. Delete this check.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20231031104531.3169721-6-armbru@redhat.com>
show more ...
|
28035bed | 31-Oct-2023 |
Markus Armbruster <armbru@redhat.com> |
dump: Improve some dump-guest-memory error messages
Zero @length is rejected with "Invalid parameter 'length'". Improve to "parameter 'length' expects a non-zero length".
qemu_open_old() is a wrap
dump: Improve some dump-guest-memory error messages
Zero @length is rejected with "Invalid parameter 'length'". Improve to "parameter 'length' expects a non-zero length".
qemu_open_old() is a wrapper around qemu_open_internal() that throws away error information. Switch to the wrapper that doesn't: qemu_create(). Example improvement:
(qemu) dump-guest-memory /dev/fdset/x 0 1 Error: Could not open '/dev/fdset/x': Invalid argument
becomes
Error: Could not parse fdset /dev/fdset/x
@protocol values not starting with "fd:" or "file:" are rejected with "Invalid parameter 'protocol'". Improve to "parameter 'protocol' must start with 'file:' or 'fd:'".
While there, make the conditional checking @protocol a little more obvious.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20231031104531.3169721-5-armbru@redhat.com>
show more ...
|
f8c49724 | 31-Oct-2023 |
Markus Armbruster <armbru@redhat.com> |
dump: Recognize "fd:" protocols on Windows hosts
A few QMP command can work with named file descriptors.
The only way to create a named file descriptor used to be QMP command getfd, which only work
dump: Recognize "fd:" protocols on Windows hosts
A few QMP command can work with named file descriptors.
The only way to create a named file descriptor used to be QMP command getfd, which only works on POSIX hosts. Thus, named file descriptors were actually usable only there.
They became usable on Windows hosts when we added QMP command get-win32-socket (commit 4cda177c601 "qmp: add 'get-win32-socket'").
Except in dump-guest-memory, because qmp_dump_guest_memory() compiles its named file descriptor code only #if !defined(WIN32).
Compile it unconditionally, like we do for the other commands supporting them.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20231031104531.3169721-4-armbru@redhat.com>
show more ...
|
96afbc57 | 31-Oct-2023 |
Markus Armbruster <armbru@redhat.com> |
dump: Fix g_array_unref(NULL) in dump-guest-memory
When dump_init()'s check for non-zero @length fails, dump_cleanup() passes null s->string_table_buf to g_array_unref(), which spews "GLib: g_array_
dump: Fix g_array_unref(NULL) in dump-guest-memory
When dump_init()'s check for non-zero @length fails, dump_cleanup() passes null s->string_table_buf to g_array_unref(), which spews "GLib: g_array_unref: assertion 'array' failed" to stderr.
Guard the g_array_unref().
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20231031104531.3169721-3-armbru@redhat.com>
show more ...
|
8beaeed7 | 31-Oct-2023 |
Markus Armbruster <armbru@redhat.com> |
dump: Rename qmp_dump_guest_memory() parameter to match QAPI schema
The name of the second parameter differs between QAPI schema and C implementation: it's @protocol in the former and @file in the l
dump: Rename qmp_dump_guest_memory() parameter to match QAPI schema
The name of the second parameter differs between QAPI schema and C implementation: it's @protocol in the former and @file in the latter. Potentially confusing. Change the C implementation to match the QAPI schema.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20231031104531.3169721-2-armbru@redhat.com>
show more ...
|
e6549197 | 18-Sep-2023 |
Stephen Brennan <stephen.s.brennan@oracle.com> |
dump: Add command interface for kdump-raw formats
The QMP dump API represents the dump format as an enumeration. Add three new enumerators, one for each supported kdump compression, each named "kdum
dump: Add command interface for kdump-raw formats
The QMP dump API represents the dump format as an enumeration. Add three new enumerators, one for each supported kdump compression, each named "kdump-raw-*".
For the HMP command line, rather than adding a new flag corresponding to each format, it seems more human-friendly to add a single flag "-R" to switch the kdump formats to "raw" mode. The choice of "-R" also correlates nicely to the "makedumpfile -R" option, which would serve to reassemble a flattened vmcore.
Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> [ Marc-André: replace loff_t with off_t, indent fixes ] Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230918233233.1431858-4-stephen.s.brennan@oracle.com>
show more ...
|
d43a01db | 18-Sep-2023 |
Stephen Brennan <stephen.s.brennan@oracle.com> |
dump: Allow directly outputting raw kdump format
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 flat
dump: Allow directly outputting raw kdump format
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 <stephen.s.brennan@oracle.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> [ Marc-André: replace loff_t with off_t ] Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230918233233.1431858-3-stephen.s.brennan@oracle.com>
show more ...
|
97244862 | 23-Feb-2023 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
dump: Add create_win_dump() stub for non-x86 targets
Implement the non-x86 create_win_dump(). We can remove the last TARGET_X86_64 #ifdef'ry in dump.c, which thus becomes target-independent. Update
dump: Add create_win_dump() stub for non-x86 targets
Implement the non-x86 create_win_dump(). We can remove the last TARGET_X86_64 #ifdef'ry in dump.c, which thus becomes target-independent. Update meson accordingly.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230225094903.53167-6-philmd@linaro.org>
show more ...
|
efc3146a | 23-Feb-2023 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
dump: Simplify compiling win_dump.o by introducing win_dump_available()
To make dump.c less target dependent, move the TARGET_X86_64 #ifdef'ry from dump.c to win_dump.c (introducing a win_dump_avail
dump: Simplify compiling win_dump.o by introducing win_dump_available()
To make dump.c less target dependent, move the TARGET_X86_64 #ifdef'ry from dump.c to win_dump.c (introducing a win_dump_available() method there). By doing so we can build win_dump.c on any target, and simplify the meson rule.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230225094903.53167-5-philmd@linaro.org>
show more ...
|
ac978771 | 23-Feb-2023 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
dump: Clean included headers
"qemu/win_dump_defs.h" is only required by win_dump.c, but win_dump.h requires "sysemu/dump.h" which declares the DumpState type. Remove various unused headers.
Reviewe
dump: Clean included headers
"qemu/win_dump_defs.h" is only required by win_dump.c, but win_dump.h requires "sysemu/dump.h" which declares the DumpState type. Remove various unused headers.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230225094903.53167-4-philmd@linaro.org>
show more ...
|
c5d40b22 | 23-Feb-2023 |
Philippe Mathieu-Daudé <philmd@linaro.org> |
dump: Replace TARGET_PAGE_SIZE -> qemu_target_page_size()
TARGET_PAGE_SIZE is target specific. In preparation of making dump.c target-agnostic, replace the compile-time TARGET_PAGE_SIZE definition b
dump: Replace TARGET_PAGE_SIZE -> qemu_target_page_size()
TARGET_PAGE_SIZE is target specific. In preparation of making dump.c target-agnostic, replace the compile-time TARGET_PAGE_SIZE definition by runtime qemu_target_page_size().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230225094903.53167-3-philmd@linaro.org>
show more ...
|