All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] question: Does qemu-pr-helper have its own log files?
@ 2019-04-23  3:12 ` Jie Wang
  0 siblings, 0 replies; 12+ messages in thread
From: Jie Wang @ 2019-04-23  3:12 UTC (permalink / raw)
  To: qemu-devel, qemu-block; +Cc: Fangyi (C), Zhangbo (Oscar)

 Does qemu-pr-helper have its own log files?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-devel] question: Does qemu-pr-helper have its own log files?
@ 2019-04-23  3:12 ` Jie Wang
  0 siblings, 0 replies; 12+ messages in thread
From: Jie Wang @ 2019-04-23  3:12 UTC (permalink / raw)
  To: qemu-devel, qemu-block; +Cc: Zhangbo (Oscar), Fangyi (C)

 Does qemu-pr-helper have its own log files?











^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] question: Does qemu-pr-helper have its own log files?
@ 2019-04-23  9:42   ` Daniel P. Berrangé
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel P. Berrangé @ 2019-04-23  9:42 UTC (permalink / raw)
  To: Jie Wang; +Cc: qemu-devel, qemu-block, Zhangbo (Oscar), Fangyi (C)

On Tue, Apr 23, 2019 at 11:12:40AM +0800, Jie Wang wrote:
>  Does qemu-pr-helper have its own log files?

When QEMU launches it, i think it just inherits stdout/err from
QEMU itself, so errors appear mixed into QEMU's stdout output.

When libvirt launches it, there stdout is connected to /dev/null
and stderr is connected to a pipe which libvirt closes almost
immediately. This means any errors are lost as any attempt to
write to stderr will get EPIPE :-(



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] 12+ messages in thread

* Re: [Qemu-devel]  question: Does qemu-pr-helper have its own log files?
@ 2019-04-23  9:42   ` Daniel P. Berrangé
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel P. Berrangé @ 2019-04-23  9:42 UTC (permalink / raw)
  To: Jie Wang; +Cc: Zhangbo (Oscar), qemu-devel, qemu-block, Fangyi (C)

On Tue, Apr 23, 2019 at 11:12:40AM +0800, Jie Wang wrote:
>  Does qemu-pr-helper have its own log files?

When QEMU launches it, i think it just inherits stdout/err from
QEMU itself, so errors appear mixed into QEMU's stdout output.

When libvirt launches it, there stdout is connected to /dev/null
and stderr is connected to a pipe which libvirt closes almost
immediately. This means any errors are lost as any attempt to
write to stderr will get EPIPE :-(



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] 12+ messages in thread

* Re: [Qemu-devel] [Qemu-block] question: Does qemu-pr-helper have its own log files?
@ 2019-04-23 13:56   ` Stefan Hajnoczi
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Hajnoczi @ 2019-04-23 13:56 UTC (permalink / raw)
  To: Jie Wang; +Cc: qemu-devel, qemu-block, Zhangbo (Oscar), Fangyi (C)

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

On Tue, Apr 23, 2019 at 11:12:40AM +0800, Jie Wang wrote:
>  Does qemu-pr-helper have its own log files?

No, it does not.  qemu-pr-helper uses stderr for errors and there is not
much output during normal operation.

Check journalctl(1) for errors if you are launching it as a systemd
service.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel]  [Qemu-block] question: Does qemu-pr-helper have its own log files?
@ 2019-04-23 13:56   ` Stefan Hajnoczi
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Hajnoczi @ 2019-04-23 13:56 UTC (permalink / raw)
  To: Jie Wang; +Cc: Zhangbo (Oscar), qemu-devel, qemu-block, Fangyi (C)

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

On Tue, Apr 23, 2019 at 11:12:40AM +0800, Jie Wang wrote:
>  Does qemu-pr-helper have its own log files?

No, it does not.  qemu-pr-helper uses stderr for errors and there is not
much output during normal operation.

Check journalctl(1) for errors if you are launching it as a systemd
service.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [Qemu-block] question: Does qemu-pr-helper have its own log files?
@ 2019-04-24  2:37     ` Zhangbo (Oscar)
  0 siblings, 0 replies; 12+ messages in thread
From: Zhangbo (Oscar) @ 2019-04-24  2:37 UTC (permalink / raw)
  To: Stefan Hajnoczi, wangjie (P), qemu-devel@nongnu.org,
	qemu-block@nongnu.org
  Cc: Fangyi (C), Wangjing (King)

>From: Stefan Hajnoczi [mailto:stefanha@gmail.com]
>Sent: Tuesday, April 23, 2019 9:57 PM
>On Tue, Apr 23, 2019 at 11:12:40AM +0800, Jie Wang wrote:
>>  Does qemu-pr-helper have its own log files?
>
>No, it does not.  qemu-pr-helper uses stderr for errors and there is not
>much output during normal operation.
>
>Check journalctl(1) for errors if you are launching it as a systemd
>service.
>
>Stefan

The error messages that sent to *stderr* are *not* captured by anyone, then
these error messages seems helpless.
It's different form qemu's log,  qemu's stderr logs are transferred to virtlogd,
that means these logs are finally written into disk.
Any further development plan?

We thought of:
1 logging into syslog, but the malicious guest may cause large amount of error
  messages to overflow the message log.
2 or, let virtlogd to redirect its logs. But if virtlogd get restarted, the helper's log would
  no longer be logged, because, unlike qemu, there's no qmp socket between 
  libvirtd and the helper, the channel between the helper and virtlogd could not be
  re-established.
3 or, let qemu to log the helper's log, seems a little odd and complex.
4 or, let the helper realize its own logging scheme and log into itself's logfile ?

What's your suggestion? Thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel]  [Qemu-block] question: Does qemu-pr-helper have its own log files?
@ 2019-04-24  2:37     ` Zhangbo (Oscar)
  0 siblings, 0 replies; 12+ messages in thread
From: Zhangbo (Oscar) @ 2019-04-24  2:37 UTC (permalink / raw)
  To: Stefan Hajnoczi, wangjie (P), qemu-devel@nongnu.org,
	qemu-block@nongnu.org
  Cc: Wangjing (King), Fangyi (C)

>From: Stefan Hajnoczi [mailto:stefanha@gmail.com]
>Sent: Tuesday, April 23, 2019 9:57 PM
>On Tue, Apr 23, 2019 at 11:12:40AM +0800, Jie Wang wrote:
>>  Does qemu-pr-helper have its own log files?
>
>No, it does not.  qemu-pr-helper uses stderr for errors and there is not
>much output during normal operation.
>
>Check journalctl(1) for errors if you are launching it as a systemd
>service.
>
>Stefan

The error messages that sent to *stderr* are *not* captured by anyone, then
these error messages seems helpless.
It's different form qemu's log,  qemu's stderr logs are transferred to virtlogd,
that means these logs are finally written into disk.
Any further development plan?

We thought of:
1 logging into syslog, but the malicious guest may cause large amount of error
  messages to overflow the message log.
2 or, let virtlogd to redirect its logs. But if virtlogd get restarted, the helper's log would
  no longer be logged, because, unlike qemu, there's no qmp socket between 
  libvirtd and the helper, the channel between the helper and virtlogd could not be
  re-established.
3 or, let qemu to log the helper's log, seems a little odd and complex.
4 or, let the helper realize its own logging scheme and log into itself's logfile ?

What's your suggestion? Thanks!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [Qemu-block]  question: Does qemu-pr-helper have its own log files?
@ 2019-04-25  8:30     ` Stefan Hajnoczi
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Hajnoczi @ 2019-04-25  8:30 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Jie Wang, Zhangbo (Oscar), qemu-devel, qemu-block, Fangyi (C)

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

On Tue, Apr 23, 2019 at 10:42:17AM +0100, Daniel P. Berrangé wrote:
> On Tue, Apr 23, 2019 at 11:12:40AM +0800, Jie Wang wrote:
> >  Does qemu-pr-helper have its own log files?
> 
> When QEMU launches it, i think it just inherits stdout/err from
> QEMU itself, so errors appear mixed into QEMU's stdout output.

I thought QEMU does not launch qemu-pr-helper.  Have I missed something?

QEMU ships systemd .service and .socket files for managing
qemu-pr-helper externally.

> When libvirt launches it, there stdout is connected to /dev/null
> and stderr is connected to a pipe which libvirt closes almost
> immediately. This means any errors are lost as any attempt to
> write to stderr will get EPIPE :-(

For anyone looking at the code:
src/qemu/qemu_process.c:qemuProcessStartManagedPRDaemon()

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel]  [Qemu-block]  question: Does qemu-pr-helper have its own log files?
@ 2019-04-25  8:30     ` Stefan Hajnoczi
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Hajnoczi @ 2019-04-25  8:30 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Zhangbo (Oscar), Fangyi (C), qemu-devel, qemu-block, Jie Wang

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

On Tue, Apr 23, 2019 at 10:42:17AM +0100, Daniel P. Berrangé wrote:
> On Tue, Apr 23, 2019 at 11:12:40AM +0800, Jie Wang wrote:
> >  Does qemu-pr-helper have its own log files?
> 
> When QEMU launches it, i think it just inherits stdout/err from
> QEMU itself, so errors appear mixed into QEMU's stdout output.

I thought QEMU does not launch qemu-pr-helper.  Have I missed something?

QEMU ships systemd .service and .socket files for managing
qemu-pr-helper externally.

> When libvirt launches it, there stdout is connected to /dev/null
> and stderr is connected to a pipe which libvirt closes almost
> immediately. This means any errors are lost as any attempt to
> write to stderr will get EPIPE :-(

For anyone looking at the code:
src/qemu/qemu_process.c:qemuProcessStartManagedPRDaemon()

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [Qemu-block] question: Does qemu-pr-helper have its own log files?
@ 2019-04-25  8:32       ` Stefan Hajnoczi
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Hajnoczi @ 2019-04-25  8:32 UTC (permalink / raw)
  To: Zhangbo (Oscar)
  Cc: wangjie (P), qemu-devel@nongnu.org, qemu-block@nongnu.org,
	Fangyi (C), Wangjing (King)

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

On Wed, Apr 24, 2019 at 02:37:36AM +0000, Zhangbo (Oscar) wrote:
> >From: Stefan Hajnoczi [mailto:stefanha@gmail.com]
> >Sent: Tuesday, April 23, 2019 9:57 PM
> >On Tue, Apr 23, 2019 at 11:12:40AM +0800, Jie Wang wrote:
> >>  Does qemu-pr-helper have its own log files?
> >
> >No, it does not.  qemu-pr-helper uses stderr for errors and there is not
> >much output during normal operation.
> >
> >Check journalctl(1) for errors if you are launching it as a systemd
> >service.
> >
> >Stefan
> 
> The error messages that sent to *stderr* are *not* captured by anyone, then
> these error messages seems helpless.

This depends on how qemu-pr-helper was launched.

Daniel Berrange mentioned that stderr is not captured when libvirt
launches qemu-pr-helper.  So in this case there is a problem.

> It's different form qemu's log,  qemu's stderr logs are transferred to virtlogd,
> that means these logs are finally written into disk.
> Any further development plan?
> 
> We thought of:
> 1 logging into syslog, but the malicious guest may cause large amount of error
>   messages to overflow the message log.
> 2 or, let virtlogd to redirect its logs. But if virtlogd get restarted, the helper's log would
>   no longer be logged, because, unlike qemu, there's no qmp socket between 
>   libvirtd and the helper, the channel between the helper and virtlogd could not be
>   re-established.
> 3 or, let qemu to log the helper's log, seems a little odd and complex.
> 4 or, let the helper realize its own logging scheme and log into itself's logfile ?

Perhaps libvirt should be modified to handle stderr.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel]  [Qemu-block] question: Does qemu-pr-helper have its own log files?
@ 2019-04-25  8:32       ` Stefan Hajnoczi
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Hajnoczi @ 2019-04-25  8:32 UTC (permalink / raw)
  To: Zhangbo (Oscar)
  Cc: Wangjing (King), Fangyi (C), qemu-devel@nongnu.org,
	qemu-block@nongnu.org, wangjie (P)

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

On Wed, Apr 24, 2019 at 02:37:36AM +0000, Zhangbo (Oscar) wrote:
> >From: Stefan Hajnoczi [mailto:stefanha@gmail.com]
> >Sent: Tuesday, April 23, 2019 9:57 PM
> >On Tue, Apr 23, 2019 at 11:12:40AM +0800, Jie Wang wrote:
> >>  Does qemu-pr-helper have its own log files?
> >
> >No, it does not.  qemu-pr-helper uses stderr for errors and there is not
> >much output during normal operation.
> >
> >Check journalctl(1) for errors if you are launching it as a systemd
> >service.
> >
> >Stefan
> 
> The error messages that sent to *stderr* are *not* captured by anyone, then
> these error messages seems helpless.

This depends on how qemu-pr-helper was launched.

Daniel Berrange mentioned that stderr is not captured when libvirt
launches qemu-pr-helper.  So in this case there is a problem.

> It's different form qemu's log,  qemu's stderr logs are transferred to virtlogd,
> that means these logs are finally written into disk.
> Any further development plan?
> 
> We thought of:
> 1 logging into syslog, but the malicious guest may cause large amount of error
>   messages to overflow the message log.
> 2 or, let virtlogd to redirect its logs. But if virtlogd get restarted, the helper's log would
>   no longer be logged, because, unlike qemu, there's no qmp socket between 
>   libvirtd and the helper, the channel between the helper and virtlogd could not be
>   re-established.
> 3 or, let qemu to log the helper's log, seems a little odd and complex.
> 4 or, let the helper realize its own logging scheme and log into itself's logfile ?

Perhaps libvirt should be modified to handle stderr.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-04-25  8:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-23  3:12 [Qemu-devel] question: Does qemu-pr-helper have its own log files? Jie Wang
2019-04-23  3:12 ` Jie Wang
2019-04-23  9:42 ` Daniel P. Berrangé
2019-04-23  9:42   ` Daniel P. Berrangé
2019-04-25  8:30   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2019-04-25  8:30     ` Stefan Hajnoczi
2019-04-23 13:56 ` Stefan Hajnoczi
2019-04-23 13:56   ` Stefan Hajnoczi
2019-04-24  2:37   ` Zhangbo (Oscar)
2019-04-24  2:37     ` Zhangbo (Oscar)
2019-04-25  8:32     ` Stefan Hajnoczi
2019-04-25  8:32       ` Stefan Hajnoczi

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.