All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Zhang Haoyu" <zhanghy@sangfor.com>, "Andreas Färber" <afaerber@suse.de>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [questions] about qemu log
Date: Tue, 29 Jul 2014 13:51:46 -0600	[thread overview]
Message-ID: <53D7FB52.3080801@redhat.com> (raw)
In-Reply-To: <201407261028057289331@sangfor.com>

[-- Attachment #1: Type: text/plain, Size: 1363 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

  parent reply	other threads:[~2014-07-29 19:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25  6:42 [Qemu-devel] [questions] about qemu log Zhang Haoyu
2014-07-25 10:22 ` Alex Bennée
2014-07-25 11:07   ` Zhang Haoyu
2014-07-25 13:20     ` Andreas Färber
2014-07-26  2:28       ` Zhang Haoyu
2014-07-26  3:03         ` [Qemu-devel] [questions]_about_qemu_log Zhang Haoyu
2014-07-29 19:51         ` Eric Blake [this message]
2014-08-05 20:48           ` [Qemu-devel] [questions] about qemu log William Dauchy
2014-08-05 22:40             ` Peter Crosthwaite
2014-08-06  1:23               ` Zhang Haoyu
2014-08-06  2:49                 ` Peter Crosthwaite
2014-08-06  3:41                   ` Zhang Haoyu
2014-08-06  6:20                     ` Markus Armbruster
2014-08-06  7:00                       ` Zhang Haoyu
2014-08-06  7:42                         ` Markus Armbruster
2014-08-06 12:04                           ` Peter Crosthwaite
2014-08-06 10:43               ` William Dauchy
2014-08-06 20:42                 ` William Dauchy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53D7FB52.3080801@redhat.com \
    --to=eblake@redhat.com \
    --cc=afaerber@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhanghy@sangfor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.