Re: [PATCH v6 19/27] util: fix interleaving of error & trace output
Markus Armbruster <[email protected]> Wed, 18 Feb 2026 13:45:50 +0100
| Newsgroups | org.nongnu.qemu-rust,org.nongnu.qemu-devel |
|---|---|
| Message-ID | <[email protected]> |
One more... Daniel P. Berrangé <[email protected]> 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; [...]