* [Qemu-devel] printf in qemu
@ 2014-01-30 7:16 Ayaz Akram
2014-01-30 9:08 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Ayaz Akram @ 2014-01-30 7:16 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 410 bytes --]
I observed that if i place printf in qemu at certain places like in
hw./serial.c file, I can see the printing when my guest OS is running on
qemu, while there are some other places like in pckbd.c (emulation of
keyboard), where if printf is used, I am not able to see any printing while
guest OS is running, but when I press ctrl+A and x i can see that
printing...... Any idea why this different behavior ??
[-- Attachment #2: Type: text/html, Size: 439 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] printf in qemu
2014-01-30 7:16 [Qemu-devel] printf in qemu Ayaz Akram
@ 2014-01-30 9:08 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2014-01-30 9:08 UTC (permalink / raw)
To: Ayaz Akram; +Cc: qemu-devel
On Thu, Jan 30, 2014 at 12:16:26PM +0500, Ayaz Akram wrote:
> I observed that if i place printf in qemu at certain places like in
> hw./serial.c file, I can see the printing when my guest OS is running on
> qemu, while there are some other places like in pckbd.c (emulation of
> keyboard), where if printf is used, I am not able to see any printing while
> guest OS is running, but when I press ctrl+A and x i can see that
> printing...... Any idea why this different behavior ??
Usually the problem is stdout buffering. See fflush(3) and use
fprintf(stderr) instead for debugging. stderr is unbuffered by default
on POSIX systems. I think on Windows you need to explicitly disable
buffering for stderr.
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-30 9:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-30 7:16 [Qemu-devel] printf in qemu Ayaz Akram
2014-01-30 9:08 ` 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).