On Wed, Apr 02, 2025 at 11:15:41AM +0100, Daniel P. Berrangé via Devel wrote:
QEMU itself should always knows whether or not it can use WinDump
format,
as it can see the fw_cfg data, but I can't see any way this is exposed
to the mgmt app, but potentially that could be expressed via a new qmp
command if needed ?
Essentially I'm wondering whether there's any pratical way we can
"do the right thing" without manual configuration of each guest ?
So QEMU exposes a QMP command
(QEMU) query-dump-guest-memory-capability
{"return": {"formats": ["elf", "kdump-zlib",
"kdump-raw-zlib", "kdump-lzo", "kdump-raw-lzo",
"kdump-snappy", "kdump-raw-snappy", "win-dmp"]}}
but this is a lie
(QEMU) dump-guest-memory format=win-dmp paging=false protocol=file:foo.dmp
{"error": {"class": "GenericError", "desc":
"win-dump: invalid vmcoreinfo note size"}}
QEMU's impl of 'query-dump-guest-memory-capability' does
if (win_dump_available(NULL)) {
QAPI_LIST_APPEND(tail, DUMP_GUEST_MEMORY_FORMAT_WIN_DMP);
}
where win_dump_available is:
#if defined(TARGET_X86_64)
bool win_dump_available(Error **errp)
{
return true;
}
#else
bool win_dump_available(Error **errp)
{
error_setg(errp, "Windows dump is only available for x86-64");
return false;
}
#endif
This is a broken impl IMHO, as it should only report 'win-dump' if the
running guest is actually capable of it.
If it is just a choice between using win-dmp vs the qemu.conf
setting
it might be doable, assuming the various kdump,elf formats are viable
for /all/ guest types. If we needed to auto-detct kdump vs elf it gets
harder
Assuming we can fix QEMU to accurately report 'win-dump', then we can
make libvirt "do the right thing(tm)" out of the box, without needing
a per-guest XML knob.
ie, if 'win-dump' is reported as available, use that, otherwise use
the format configured in qemu.conf.
With regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|