@samitouri / QOSamiQemu / commits / dd272c8c87

qapi/dump: add allowed-by-guest feature to win-dmp

Commit 1c0e259c5a35 ("dump: make win_dump_available() check vmcoreinfo for a Windows dump header") changed two things in a way that is visible to QMP clients but not to introspection: query-dump-guest-memory-capability now lists win-dmp only for a guest that has published a Windows dump header through the vmcoreinfo device, and dump-guest-memory, which shares win_dump_available(), rejects the format otherwise. Before that, both accepted win-dmp on any x86 machine. A client that wants to select win-dmp automatically therefore cannot trust the capability query on its own: on an older QEMU it reports win-dmp for every x86 guest, Linux ones included, where the resulting dump is useless. libvirt ran into exactly this while picking a format for on_crash and watchdog triggered dumps, and has no way to tell the two behaviours apart. Add an 'allowed-by-guest' feature to the win-dmp member of DumpGuestMemoryFormat so the fixed behaviour becomes discoverable. DumpGuestMemoryFormat is reachable from both query-dump-guest-memory-capability's return type and dump-guest-memory's arguments, so a single flag covers both halves of the change. Where the feature is absent, a reported win-dmp says nothing about the guest, and a client that needs the dump to be loadable afterwards should fall back to elf. CC: Eric Blake <eblake@redhat.com> CC: Markus Armbruster <armbru@redhat.com> CC: "Marc-André Lureau" <marcandre.lureau@redhat.com> Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Denis V. Lunev <den@openvz.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260731155001.1204103-1-den@openvz.org>

Denis V. Lunev committed Jul 31, 2026 at 17:50 UTC dd272c8c87f165d41c945946242c5c8619e7122f
1 file changed +8 -1
qapi/dump.json
+8 -1
@@ -38,6 +38,13 @@
38 # @win-dmp: Windows full crashdump format, can be used instead of ELF
39 # converting (since 2.13)
40 #
41 +# Features:
42 +#
43 +# @allowed-by-guest: If present, @win-dmp is listed by
44 +# `query-dump-guest-memory-capability`, and accepted by
45 +# `dump-guest-memory`, only when the guest has published a Windows
46 +# dump header through the vmcoreinfo device (since 11.1)
47 +#
48 # Since: 2.0
49 ##
50 { 'enum': 'DumpGuestMemoryFormat',
@@ -45,7 +52,7 @@
52 'elf',
53 'kdump-zlib', 'kdump-lzo', 'kdump-snappy',
54 'kdump-raw-zlib', 'kdump-raw-lzo', 'kdump-raw-snappy',
48 - 'win-dmp' ] }
55 + { 'name': 'win-dmp', 'features': ['allowed-by-guest'] } ] }
56
57 ##
58 # @dump-guest-memory: