On Fri, Mar 28, 2025 at 05:45:12PM +0100, Denis V. Lunev via Devel wrote: > On 3/27/25 11:14, Nikolai Barybin wrote: > > When libvirt processes VM crash event it always dumps core in raw > > format. > > > > This series makes it possible to configure dump format via domain xml. > > This would be especcialy helpful for Windows guests, because it requires > > a lot effort to convert raw dump into wingdb. > > > > Nikolai Barybin (4): > > conf: schemas: add coredump_format element to events section > > src: conf: add parsing/formatting for 'coredump_format' value > > qemu: use configurable dump format in doCoreDumpToAutoDumpPath() > > docs: formatdomain: document 'coredump_format' element > > > > docs/formatdomain.rst | 9 +++++ > > src/conf/domain_conf.c | 64 +++++++++++++++++++++++++++++++ > > src/conf/domain_conf.h | 2 + > > src/conf/schemas/domaincommon.rng | 19 +++++++++ > > src/libvirt_private.syms | 2 + > > src/qemu/qemu_driver.c | 2 +- > > 6 files changed, 97 insertions(+), 1 deletion(-) > > > The idea is that correct Windows dump could be collected > only at the moment of the dump collection as dump > collector code in QEMU uses some information from > Windows drivers. Later conversion using external tools > proven to be complex. > > That is why we either should specify the type of the > dump inside the configuration file or autoguess the > format. I though that latter could be implemented as > the next step using f.e. presence of HyperV feature or > checking OS type in metadata. > > I think that this thing would be useful.
Effectively QEMU has three dump formats - WinDump, KDump and ELF, with the KDump format being overloaded to express 6 different sub-variants. The global qemu.conf setting is effectively useless as far as the 'win-dmp' format goes, because it is highly unlikely to have a single host running exclusively windows guests. Anyone know if the KDump format is only interesting for Linux guests, or can it be useful for dumping any guest OS types ? Looking at the QEMU impl, IIUC the WinDump format can only be requested if the guest OS has exposed the Win Dump note in fw_cfg via the vmcoreinfo device, otherwise we'll hit a hard error on the check if (s->guest_note_size != VMCOREINFO_WIN_DUMP_NOTE_SIZE32 && s->guest_note_size != VMCOREINFO_WIN_DUMP_NOTE_SIZE64) { error_setg(errp, "win-dump: invalid vmcoreinfo note size"); return; } This in turn depends on whether the KVM guest drivers are installed in the guest. IOW, we can't auto-choose WinDump merely based on presence of the HyperV fature, nor even libosinfo OS type in metadata. 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 ? 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 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 :|