qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [questions] about qemu log


From: Eric Blake
Subject: Re: [Qemu-devel] [questions] about qemu log
Date: Tue, 29 Jul 2014 13:51:46 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 07/25/2014 08:28 PM, Zhang Haoyu wrote:

>> In a shell you would write something like:
>>
>> 2> stderr.log
>>
>> You may also want to toggle QEMU's -msg timestamp=on option.
>>
> I think the "-msg -msg timestamp=on" option will add timestamp to the output 
> of error_report(fmt, ...),
> but where is the output? Which file saves the output?

The output is on qemu's stderr.  You are in control of what that stderr is.

> And where is the output of fprintf(stderr, fmt, ...)?

Also on stderr.

> Should I redirect of stderr to specified log file?

Yes, if you want that output going to a specified file.

> 
> In libvirt code, when start a vm(qemuProcessStart), it will create a qemu log 
> file named /var/log/libvirt/qemu/vmname.log,
> and redirect the stderr and stdout to file descriptor of this qemu log file.
> 
> But if I run a vm directly by qemu command, bypass libvirt, then how to 
> configure qemu to assure that each vm has its own log file,
> and how to redirect the stderr, stdout to each vm's own log file?

If you are going to bypass libvirt, then you have to do your own shell
redirections (as mentioned above) to ensure that file descriptor 2 as
inherited by qemu is whatever file you want errors logged in.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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