qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

error: Fix -msg timestamp default

-msg parameter "timestamp" defaults to "off" if you don't specify msg,
and to "on" if you do. Messed up right in commit 5e2ac51917 "add
timestamp to error_report()". Mostly harmless, because "timestamp" is
the only parameter, so "if you do" is "-msg ''", which nobody does.

Change the default to "off" no matter what.

While there, rename enable_timestamp_msg to error_with_timestamp, and
polish documentation.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20191010081508.8978-1-armbru@redhat.com>

+14 -7
+2 -1
include/qemu/error-report.h
··· 73 73 }) 74 74 75 75 const char *error_get_progname(void); 76 - extern bool enable_timestamp_msg; 76 + 77 + extern bool error_with_timestamp; 77 78 78 79 #endif
+7 -3
qemu-options.hx
··· 4167 4167 4168 4168 DEF("msg", HAS_ARG, QEMU_OPTION_msg, 4169 4169 "-msg timestamp[=on|off]\n" 4170 - " change the format of messages\n" 4171 - " on|off controls leading timestamps (default:on)\n", 4170 + " control error message format\n" 4171 + " timestamp=on enables timestamps (default: off)\n", 4172 4172 QEMU_ARCH_ALL) 4173 4173 STEXI 4174 4174 @item -msg timestamp[=on|off] 4175 4175 @findex -msg 4176 - prepend a timestamp to each log message.(default:on) 4176 + Control error message format. 4177 + @table @option 4178 + @item timestamp=on|off 4179 + Prefix messages with a timestamp. Default is off. 4180 + @end table 4177 4181 ETEXI 4178 4182 4179 4183 DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate,
+4 -2
util/qemu-error.c
··· 24 24 REPORT_TYPE_INFO, 25 25 } report_type; 26 26 27 + /* Prepend timestamp to messages */ 28 + bool error_with_timestamp; 29 + 27 30 int error_printf(const char *fmt, ...) 28 31 { 29 32 va_list ap; ··· 191 194 } 192 195 } 193 196 194 - bool enable_timestamp_msg; 195 197 /* 196 198 * Print a message to current monitor if we have one, else to stderr. 197 199 * @report_type is the type of message: error, warning or informational. ··· 204 206 GTimeVal tv; 205 207 gchar *timestr; 206 208 207 - if (enable_timestamp_msg && !cur_mon) { 209 + if (error_with_timestamp && !cur_mon) { 208 210 g_get_current_time(&tv); 209 211 timestr = g_time_val_to_iso8601(&tv); 210 212 error_printf("%s ", timestr);
+1 -1
vl.c
··· 1139 1139 1140 1140 static void configure_msg(QemuOpts *opts) 1141 1141 { 1142 - enable_timestamp_msg = qemu_opt_get_bool(opts, "timestamp", true); 1142 + error_with_timestamp = qemu_opt_get_bool(opts, "timestamp", false); 1143 1143 } 1144 1144 1145 1145