On 9/10/25 18:03, Daniel P. Berrangé wrote:
The error_report function can include the guest name in any
messages it prints. The qemu_log function has no equivalent
behaviour.

This introduces support for a "workload name" in the new
messages API, which in the case of system emulators will
be the guest name. The possibility of defining a workload
name for other binaries is left as an exercise for the
future.

This change has no impact on the output of the error_report
function, but will change the qemu_log function. This can
be easily seen with the 'log' trace backend, and how it is
now more closely matching error_report output.

Before:

   # qemu-system-x86_64 -msg guest-name=on -name blah -object 
tls-creds-x509,id=t0,dir=fish -d 'trace:qcrypto*'
   qcrypto_tls_creds_x509_load TLS creds x509 load creds=0x55b3af3fd870 dir=fish
   qcrypto_tls_creds_get_path TLS creds path creds=0x55b3af3fd870 
filename=ca-cert.pem path=<none>
   blah qemu-system-x86_64: Unable to access credentials fish/ca-cert.pem: No 
such file or directory

After:

   # qemu-system-x86_64 -msg guest-name=on -name blah -object 
tls-creds-x509,id=t0,dir=fish -d 'trace:qcrypto*'
   blah qcrypto_tls_creds_x509_load TLS creds x509 load creds=0x55b3af3fd870 
dir=fish
   blah qcrypto_tls_creds_get_path TLS creds path creds=0x55b3af3fd870 
filename=ca-cert.pem path=<none>
   blah qemu-system-x86_64: Unable to access credentials fish/ca-cert.pem: No 
such file or directory

Signed-off-by: Daniel P. Berrangé<berra...@redhat.com>
---
  include/qemu/error-report.h |  3 ---
  include/qemu/message.h      | 10 ++++++++++
  system/vl.c                 |  6 ++++--
  util/error-report.c         |  7 -------
  util/message.c              | 12 +++++++++++-
  5 files changed, 25 insertions(+), 13 deletions(-)

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

r~

Reply via email to