From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Fabiano Rosas <farosas@suse.de>,
Laurent Vivier <lvivier@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] system/qtest.c: Allow for multiple CHR_EVENT_CLOSED events
Date: Tue, 18 Nov 2025 19:32:31 +0100 [thread overview]
Message-ID: <f25dd5eb-260a-4bc2-acde-3fee7291f49b@linaro.org> (raw)
In-Reply-To: <20251107174306.1408139-1-peter.maydell@linaro.org>
On 7/11/25 18:43, Peter Maydell wrote:
> In the qtest_event() QEMUChrEvent handler, we create a timer
> and log OPENED on CHR_EVENT_OPENED, and we destroy the timer and
> log CLOSED on CHR_EVENT_CLOSED. However, the chardev subsystem
> can send us more than one CHR_EVENT_CLOSED if we're reading from
> a file chardev:
> * the first one happens when we read the last data from the file
> * the second one happens when the user hits ^C to exit QEMU
> and the chardev is finalized: char_fd_finalize()
>
> This causes us to call g_timer_elapsed() with a NULL timer
> (which glib complains about) and print an extra CLOSED log line
> with a zero timestamp:
>
> [I +0.063829] CLOSED
> qemu-system-aarch64: GLib: g_timer_elapsed: assertion 'timer != NULL' failed
> [I +0.000000] CLOSED
>
> Avoid this by ignoring a CHR_EVENT_CLOSED if we have already
> processed one.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> system/qtest.c | 4 ++++
> 1 file changed, 4 insertions(+)
Queued, thanks.
prev parent reply other threads:[~2025-11-18 18:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-07 17:43 [PATCH] system/qtest.c: Allow for multiple CHR_EVENT_CLOSED events Peter Maydell
2025-11-14 13:21 ` Peter Maydell
2025-11-14 19:53 ` Fabiano Rosas
2025-11-14 14:30 ` Laurent Vivier
2025-11-18 18:32 ` Philippe Mathieu-Daudé [this message]
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=f25dd5eb-260a-4bc2-acde-3fee7291f49b@linaro.org \
--to=philmd@linaro.org \
--cc=farosas@suse.de \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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).