One more... Daniel P. Berrangé <berrange@redhat.com> writes:
The monitor_cur_hmp() function will acquire/release mutex locks, which will trigger trace probes, which can in turn trigger qemu_log() calls. vreport() calls monitor_cur() multiple times through its execution both directly and indirectly via error_vprintf().
The result is that the prefix information printed by vreport() gets interleaved with qemu_log() output, when run outside the context of an HMP command dispatcher. This can be seen with:
[...]
diff --git a/util/error-report.c b/util/error-report.c index f3aa24ec22..b34a2bc7bc 100644 --- a/util/error-report.c +++ b/util/error-report.c
[...]
@@ -156,34 +176,34 @@ void loc_set_file(const char *fname, int lno) /* * Print current location to current monitor if we have one, else to stderr.
This is now misleading. Let's use * Print to @cur_mon if non-null, else to stderr.
*/ -static void print_loc(void) +static void print_loc(Monitor *cur) { const char *sep = ""; int i;
[...]