[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 02/16] error-report: introduce "detailed" variable
From: |
marcandre . lureau |
Subject: |
[PATCH v3 02/16] error-report: introduce "detailed" variable |
Date: |
Wed, 10 Aug 2022 16:48:43 +0400 |
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>
Reviewed-by: Markus Armbruster <armbru@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 98f242b75b..893da10f19 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);
}
--
2.37.1
- [PATCH v3 00/16] Preliminary patches for subproject split, marcandre . lureau, 2022/08/10
- [PATCH v3 01/16] error-report: misc comment fix, marcandre . lureau, 2022/08/10
- [PATCH v3 02/16] error-report: introduce "detailed" variable,
marcandre . lureau <=
- [PATCH v3 03/16] error-report: simplify print_loc(), marcandre . lureau, 2022/08/10
- [PATCH v3 04/16] error-report: introduce overridable error_is_detailed(), marcandre . lureau, 2022/08/10
- [PATCH v3 05/16] stubs: remove needless error_vprintf_unless_qmp(), marcandre . lureau, 2022/08/10
- [PATCH v3 06/16] qapi: move QEMU-specific dispatch code in monitor, marcandre . lureau, 2022/08/10
- [PATCH v3 07/16] qapi: remove QEMU-specific monitor dependency from dispatch, marcandre . lureau, 2022/08/10
- [PATCH v3 08/16] scripts/qapi-gen: add -i option, marcandre . lureau, 2022/08/10
- [PATCH v3 13/16] qemu-common: move glib-compat.h, marcandre . lureau, 2022/08/10
- [PATCH v3 16/16] qemu-common: add error-report test, marcandre . lureau, 2022/08/10
- [PATCH v3 12/16] qemu-common: move scripts/qapi, marcandre . lureau, 2022/08/10
- [PATCH v3 14/16] qemu-common: move error-report, marcandre . lureau, 2022/08/10