[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/9] error-report: introduce "detailed" variable
From: |
Markus Armbruster |
Subject: |
Re: [PATCH 3/9] error-report: introduce "detailed" variable |
Date: |
Mon, 20 Jun 2022 09:22:51 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
marcandre.lureau@redhat.com writes:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Let's use a more explicit variable "detailed" instead of calling
> monitor_cur() multiple times.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> util/error-report.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/util/error-report.c b/util/error-report.c
> index 98f242b75bbf..893da10f19bc 100644
> --- a/util/error-report.c
> +++ b/util/error-report.c
> @@ -195,16 +195,17 @@ real_time_iso8601(void)
> */
> static void vreport(report_type type, const char *fmt, va_list ap)
> {
> + bool detailed = !monitor_cur();
> gchar *timestr;
>
> - if (message_with_timestamp && !monitor_cur()) {
> + if (message_with_timestamp && detailed) {
> timestr = real_time_iso8601();
> error_printf("%s ", timestr);
> g_free(timestr);
> }
>
> /* Only prepend guest name if -msg guest-name and -name guest=... are
> set */
> - if (error_with_guestname && error_guest_name && !monitor_cur()) {
> + if (error_with_guestname && error_guest_name && detailed) {
> error_printf("%s ", error_guest_name);
> }
Reviewed-by: Markus Armbruster <armbru@redhat.com>
- [PATCH 0/9] Preliminary patches for subproject split, marcandre . lureau, 2022/06/16
- [PATCH 3/9] error-report: introduce "detailed" variable, marcandre . lureau, 2022/06/16
- Re: [PATCH 3/9] error-report: introduce "detailed" variable,
Markus Armbruster <=
- [PATCH 2/9] error-report: misc comment fix, marcandre . lureau, 2022/06/16
- [PATCH 1/9] monitor: make error_vprintf_unless_qmp() static, marcandre . lureau, 2022/06/16
- [PATCH 4/9] error-report: simplify print_loc(), marcandre . lureau, 2022/06/16
- [PATCH 6/9] error-report: add a callback to overwrite error_vprintf, marcandre . lureau, 2022/06/16
- [PATCH 5/9] error-report: introduce ErrorReportDetailedFunc, marcandre . lureau, 2022/06/16
- [PATCH 7/9] qapi: move QEMU-specific dispatch code in monitor, marcandre . lureau, 2022/06/16
- [PATCH 9/9] scripts/qapi: add required system includes to visitor, marcandre . lureau, 2022/06/16