qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] printf in qemu


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] printf in qemu
Date: Thu, 30 Jan 2014 10:08:50 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]