Hi Daniel, I'm still not keen on qmessage_context allocating a string.
If we *did* allocate a string, it should be a GString so that we can easily append to that. The only benefit I see from this is that we would collect all of the output and it would reach stderr atomically. However, I think it's better to not collect the message and just output the pieces. Something like the following. The names are horrible and I didn't document the patches well. r~ Richard Henderson (4): util: Introduce LogOutput util: Drop QMESSAGE_CONTEXT_SKIP_MONITOR util/message: Use LogOutput util/error-report: Use LogOutput in vreport include/monitor/monitor.h | 4 +++ include/qemu/log-output.h | 14 ++++++++ include/qemu/message.h | 21 +++-------- monitor/monitor.c | 54 +++++++++++++++++++++++------ stubs/error-printf.c | 11 ++++++ util/error-report.c | 73 +++++++++++++++++++-------------------- util/log.c | 23 +++++------- util/message.c | 45 ++++++++++-------------- 8 files changed, 139 insertions(+), 106 deletions(-) create mode 100644 include/qemu/log-output.h -- 2.43.0
