* [Qemu-devel] Question in QEMU : The result of printf does not appear in the qemu VM's log.
@ 2019-05-08 1:51 S KH
2019-05-08 9:15 ` Daniel P. Berrangé
0 siblings, 1 reply; 3+ messages in thread
From: S KH @ 2019-05-08 1:51 UTC (permalink / raw)
To: qemu-devel
Hello.
I'am student studying QEMU hypervisor and SPICE.
In order to find out the calling order of functions in QEMU source, I input
and compiled 'printf ("% s \ n", __ func__) "into source.
And when I run the VM and open 'domain_name.log' in '/ var / log / libvirt
/ qemu', I see that no output from printf is displayed.
I installed qemu on Centos now, but I did not have this problem when I used
qemu in Ubuntu.
I wonder why.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Question in QEMU : The result of printf does not appear in the qemu VM's log.
2019-05-08 1:51 [Qemu-devel] Question in QEMU : The result of printf does not appear in the qemu VM's log S KH
@ 2019-05-08 9:15 ` Daniel P. Berrangé
[not found] ` <CAE519-niSfXffzKMY09_JJZ7q3KDRf+z-AU-XNeNqD=Z-DAeoA@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Daniel P. Berrangé @ 2019-05-08 9:15 UTC (permalink / raw)
To: S KH; +Cc: qemu-devel
On Wed, May 08, 2019 at 10:51:00AM +0900, S KH wrote:
> Hello.
>
> I'am student studying QEMU hypervisor and SPICE.
>
> In order to find out the calling order of functions in QEMU source, I input
> and compiled 'printf ("% s \ n", __ func__) "into source.
If using printf() output is buffered so may not appear immediately in
the logs. For debugging it is best to use g_printerr("%s\n", __func__)
which gets sent to stderr which is unbuffered so will appear immediately.
Of course the other possib8lity is that the code where you put ehe
printf statements is not being invoked by the tests you're trying.
> And when I run the VM and open 'domain_name.log' in '/ var / log / libvirt
> / qemu', I see that no output from printf is displayed.
The log file libvirt creates will capture both stdout & stderr.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Question in QEMU : The result of printf does not appear in the qemu VM's log.
[not found] ` <CAE519-niSfXffzKMY09_JJZ7q3KDRf+z-AU-XNeNqD=Z-DAeoA@mail.gmail.com>
@ 2019-05-08 10:12 ` Daniel P. Berrangé
0 siblings, 0 replies; 3+ messages in thread
From: Daniel P. Berrangé @ 2019-05-08 10:12 UTC (permalink / raw)
To: qemu-devel, S KH
Re-adding qemu-devel - please don't take mailing list threads private.
On Wed, May 08, 2019 at 07:07:01PM +0900, S KH wrote:
> Hello.
>
> Thanks to help, I can see the results of the output in the log file. Thank
> you very much for your help. I am currently working with the QEMU source as
> well as the SPICE source. After checking the source, I found that the QEMU
> source calls the SPICE function. So I used the 'g_printerr' function in the
> SPICE source to figure out the flow. Maybe it should be obvious,
> 'g_printerr' used by SPICE will not show in 'domain_name.log' file
> 'in/var/log/libvirt/qemu.' It may not be a good question for qemu-devel,
> but I wonder where the 'g_printerr' results from SPICE sources can be seen.
The SPICE server library is linked directly to QEMU so g_printerr should
work fine from SPICE code in the same way as QEMU code. If you're not
seeing the results, then my guess would be that the QEMU you are launching
is not actually using the SPICE library you built with debugging. It is
probably still using the SPICE library from the OS distro.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-05-08 10:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-08 1:51 [Qemu-devel] Question in QEMU : The result of printf does not appear in the qemu VM's log S KH
2019-05-08 9:15 ` Daniel P. Berrangé
[not found] ` <CAE519-niSfXffzKMY09_JJZ7q3KDRf+z-AU-XNeNqD=Z-DAeoA@mail.gmail.com>
2019-05-08 10:12 ` Daniel P. Berrangé
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).