hw/uefi: add query-firmware-log monitor command

Starting with the edk2-stable202508 tag OVMF (and ArmVirt too) have
optional support for logging to a memory buffer.  There is guest side
support -- for example in linux kernels v6.17+ -- to read that buffer.
But that might not helpful if your guest stops booting early enough that
guest tooling can not be used yet.  So host side support to read that
log buffer is a useful thing to have.

This patch implements the query-firmware-log qmp monitor command to
read the firmware log.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <20251017115006.2696991-2-kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann
2025-10-17 13:50:03 +02:00
parent 3c0b42c68f
commit 1b2fda5916
4 changed files with 260 additions and 1 deletions

View File

@@ -1839,6 +1839,30 @@
'returns': 'HumanReadableText',
'features': [ 'unstable' ]}
##
# @FirmwareLog:
#
# @version: Firmware version.
#
# @log: Firmware debug log, in base64 encoding. First and last log
# line might be incomplete.
#
# Since: 10.2
##
{ 'struct': 'FirmwareLog',
'data': { '*version': 'str',
'log': 'str' } }
##
# @query-firmware-log:
#
# Find firmware memory log buffer in guest memory, return content.
#
# Since: 10.2
##
{ 'command': 'query-firmware-log',
'returns': 'FirmwareLog' }
##
# @dump-skeys:
#