qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: berrange@redhat.com
Subject: [RFC 0/4] util: qmessage_context followup
Date: Tue,  2 Sep 2025 12:30:06 +0200	[thread overview]
Message-ID: <20250902103010.309094-1-richard.henderson@linaro.org> (raw)

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



             reply	other threads:[~2025-09-02 10:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02 10:30 Richard Henderson [this message]
2025-09-02 10:30 ` [RFC 1/4] util: Introduce LogOutput Richard Henderson
2025-09-02 10:30 ` [RFC 2/4] util: Drop QMESSAGE_CONTEXT_SKIP_MONITOR Richard Henderson
2025-09-02 10:30 ` [RFC 3/4] util/message: Use LogOutput Richard Henderson
2025-09-02 10:30 ` [RFC 4/4] util/error-report: Use LogOutput in vreport Richard Henderson
2025-09-02 16:47 ` [RFC 0/4] util: qmessage_context followup Daniel P. Berrangé
2025-09-10 18:05 ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250902103010.309094-1-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).