From: Sam Bobroff <sam.bobroff@au1.ibm.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Question about nonblocking stderr and lost logs
Date: Mon, 30 Nov 2015 16:34:47 +1100 [thread overview]
Message-ID: <20151130053447.GA24435@tungsten.ozlabs.ibm.com> (raw)
Hi QEMU programmers,
While doing some experimental work on QEMU that has involved adding a lot of
new log messages (using qemu_log_mask()), I've discovered that under some
conditions a lot of my log messages go missing.
I've tracked the issue down to qemu_logfile being left at the default (stderr)
(so when not using -D) and according to strace what is happening is that the
debug messages are being passed to write() but write() is returning EWOULDBLOCK
and the messags are dropped.
This seems to be happening because stderr is being set non-blocking (which is a
bit odd to me), and it seems like NONBLOCK is being set as qmp_chardev_add() adds a
device for stdout (yes stdout, not stderr; perhaps file descriptors have been
dup'd by that point?).
Is this by design to prevent a slow console from blocking QEMU? If not, should
I delve further and try to prevent non-blocking being set on stderr?
(Unfortunately I don't have a replication for this using an unmodified QEMU but
I suspect I could find one if necessary.)
Cheers,
Sam.
next reply other threads:[~2015-11-30 5:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-30 5:34 Sam Bobroff [this message]
2015-12-04 6:33 ` [Qemu-devel] Question about nonblocking stderr and lost logs Stefan Hajnoczi
2015-12-07 3:22 ` Sam Bobroff
2015-12-10 8:37 ` Stefan Hajnoczi
2015-12-14 5:19 ` Sam Bobroff
2015-12-14 7:29 ` Stefan Hajnoczi
2015-12-16 0:53 ` Sam Bobroff
2015-12-22 6:43 ` Stefan Hajnoczi
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=20151130053447.GA24435@tungsten.ozlabs.ibm.com \
--to=sam.bobroff@au1.ibm.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).