[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] error: only prepend timestamp on stderr
From: |
Frank Schreuder |
Subject: |
Re: [Qemu-devel] [PATCH v2] error: only prepend timestamp on stderr |
Date: |
Mon, 10 Aug 2015 17:49:02 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
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 <address@hidden>
> Cc: Seiji Aguchi <address@hidden>
> Cc: Frank Schreuder <address@hidden>
> Cc: Daniel P. Berrange <address@hidden>
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
> 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 <address@hidden>
Regards,
Frank