qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Question about nonblocking stderr and lost logs
@ 2015-11-30  5:34 Sam Bobroff
  2015-12-04  6:33 ` Stefan Hajnoczi
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Bobroff @ 2015-11-30  5:34 UTC (permalink / raw)
  To: qemu-devel

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-12-22  6:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-30  5:34 [Qemu-devel] Question about nonblocking stderr and lost logs Sam Bobroff
2015-12-04  6:33 ` 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

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).