* [Qemu-devel] [PATCH v2] error: only prepend timestamp on stderr
@ 2015-08-10 13:15 Stefan Hajnoczi
2015-08-10 13:19 ` Daniel P. Berrange
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2015-08-10 13:15 UTC (permalink / raw)
To: qemu-devel
Cc: Seiji Aguchi, Markus Armbruster, Stefan Hajnoczi, Frank Schreuder
The -msg timestamp=on option prepends a timestamp to error messages.
This is useful on stderr where it allows users to identify when an error
was raised.
Timestamps do not make sense on the monitor since error_report() is
called in response to a synchronous monitor command and the user already
knows "when" the command was issued. Additionally, the rest of the
monitor conversation lacks timestamps so the error timestamp cannot be
correlated with other activity.
Only prepend timestamps on stderr. This fixes libvirt's 'drive_del'
processing, which did not expect a timestamp. Other QEMU monitor
clients are probably equally confused by timestamps on monitor error
messages.
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Seiji Aguchi <seiji.aguchi@hds.com>
Cc: Frank Schreuder <fschreuder@transip.nl>
Cc: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
util/qemu-error.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/qemu-error.c b/util/qemu-error.c
index 77ea6c6..c1574bb 100644
--- a/util/qemu-error.c
+++ b/util/qemu-error.c
@@ -210,7 +210,7 @@ void error_vreport(const char *fmt, va_list ap)
GTimeVal tv;
gchar *timestr;
- if (enable_timestamp_msg) {
+ if (enable_timestamp_msg && !cur_mon) {
g_get_current_time(&tv);
timestr = g_time_val_to_iso8601(&tv);
error_printf("%s ", timestr);
--
2.4.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v2] error: only prepend timestamp on stderr
2015-08-10 13:15 [Qemu-devel] [PATCH v2] error: only prepend timestamp on stderr Stefan Hajnoczi
@ 2015-08-10 13:19 ` Daniel P. Berrange
2015-08-10 15:49 ` Frank Schreuder
2015-09-12 11:26 ` Markus Armbruster
2 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrange @ 2015-08-10 13:19 UTC (permalink / raw)
To: Stefan Hajnoczi
Cc: Frank Schreuder, Seiji Aguchi, qemu-devel, Markus Armbruster
On Mon, Aug 10, 2015 at 02:15:41PM +0100, Stefan Hajnoczi wrote:
> The -msg timestamp=on option prepends a timestamp to error messages.
> This is useful on stderr where it allows users to identify when an error
> was raised.
>
> Timestamps do not make sense on the monitor since error_report() is
> called in response to a synchronous monitor command and the user already
> knows "when" the command was issued. Additionally, the rest of the
> monitor conversation lacks timestamps so the error timestamp cannot be
> correlated with other activity.
>
> Only prepend timestamps on stderr. This fixes libvirt's 'drive_del'
> processing, which did not expect a timestamp. Other QEMU monitor
> clients are probably equally confused by timestamps on monitor error
> messages.
>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Seiji Aguchi <seiji.aguchi@hds.com>
> Cc: Frank Schreuder <fschreuder@transip.nl>
> Cc: Daniel P. Berrange <berrange@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> util/qemu-error.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v2] error: only prepend timestamp on stderr
2015-08-10 13:15 [Qemu-devel] [PATCH v2] error: only prepend timestamp on stderr Stefan Hajnoczi
2015-08-10 13:19 ` Daniel P. Berrange
@ 2015-08-10 15:49 ` Frank Schreuder
2015-09-12 11:26 ` Markus Armbruster
2 siblings, 0 replies; 4+ messages in thread
From: Frank Schreuder @ 2015-08-10 15:49 UTC (permalink / raw)
To: Stefan Hajnoczi, qemu-devel; +Cc: Seiji Aguchi, Markus Armbruster
Op 8/10/2015 om 3:15 PM schreef Stefan Hajnoczi:
> The -msg timestamp=on option prepends a timestamp to error messages.
> This is useful on stderr where it allows users to identify when an error
> was raised.
>
> Timestamps do not make sense on the monitor since error_report() is
> called in response to a synchronous monitor command and the user already
> knows "when" the command was issued. Additionally, the rest of the
> monitor conversation lacks timestamps so the error timestamp cannot be
> correlated with other activity.
>
> Only prepend timestamps on stderr. This fixes libvirt's 'drive_del'
> processing, which did not expect a timestamp. Other QEMU monitor
> clients are probably equally confused by timestamps on monitor error
> messages.
>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Seiji Aguchi <seiji.aguchi@hds.com>
> Cc: Frank Schreuder <fschreuder@transip.nl>
> Cc: Daniel P. Berrange <berrange@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> util/qemu-error.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/util/qemu-error.c b/util/qemu-error.c
> index 77ea6c6..c1574bb 100644
> --- a/util/qemu-error.c
> +++ b/util/qemu-error.c
> @@ -210,7 +210,7 @@ void error_vreport(const char *fmt, va_list ap)
> GTimeVal tv;
> gchar *timestr;
>
> - if (enable_timestamp_msg) {
> + if (enable_timestamp_msg && !cur_mon) {
> g_get_current_time(&tv);
> timestr = g_time_val_to_iso8601(&tv);
> error_printf("%s ", timestr);
Tested-by: Frank Schreuder <fschreuder@transip.nl>
Regards,
Frank
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v2] error: only prepend timestamp on stderr
2015-08-10 13:15 [Qemu-devel] [PATCH v2] error: only prepend timestamp on stderr Stefan Hajnoczi
2015-08-10 13:19 ` Daniel P. Berrange
2015-08-10 15:49 ` Frank Schreuder
@ 2015-09-12 11:26 ` Markus Armbruster
2 siblings, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2015-09-12 11:26 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Seiji Aguchi, qemu-devel, Frank Schreuder
Stefan Hajnoczi <stefanha@redhat.com> writes:
> The -msg timestamp=on option prepends a timestamp to error messages.
> This is useful on stderr where it allows users to identify when an error
> was raised.
>
> Timestamps do not make sense on the monitor since error_report() is
> called in response to a synchronous monitor command and the user already
> knows "when" the command was issued. Additionally, the rest of the
> monitor conversation lacks timestamps so the error timestamp cannot be
> correlated with other activity.
>
> Only prepend timestamps on stderr. This fixes libvirt's 'drive_del'
> processing, which did not expect a timestamp. Other QEMU monitor
> clients are probably equally confused by timestamps on monitor error
> messages.
>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Seiji Aguchi <seiji.aguchi@hds.com>
> Cc: Frank Schreuder <fschreuder@transip.nl>
> Cc: Daniel P. Berrange <berrange@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
I'll take this through my tree. Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-09-12 11:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-10 13:15 [Qemu-devel] [PATCH v2] error: only prepend timestamp on stderr Stefan Hajnoczi
2015-08-10 13:19 ` Daniel P. Berrange
2015-08-10 15:49 ` Frank Schreuder
2015-09-12 11:26 ` Markus Armbruster
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).