aboutsummaryrefslogtreecommitdiff
path: root/util/qemu-error.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-07-10 14:34:32 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2013-07-10 14:34:32 -0500
commitc170a23ca0097a95b44fc7cc604018cd3c3b7d44 (patch)
tree804bd99545123456168886337c520707bd77ea2b /util/qemu-error.c
parent51455c59ddc370612f6e070d8eb0e594aaa7ef24 (diff)
parent5e2ac5191772dea782ff78e95edd395985273019 (diff)
Merge remote-tracking branch 'luiz/queue/qmp' into staging
# By Kevin Wolf (4) and others # Via Luiz Capitulino * luiz/queue/qmp: add timestamp to error_report() qapi-schema: Use existing type for drive-backup arguments qapi-schema: Use BlockdevSnapshot type for blockdev-snapshot-sync qapi.py: Allow top-level type reference for command definitions qapi.py: Avoid code duplication qemu-char: Fix ringbuf option size Message-id: 1373478767-20965-1-git-send-email-lcapitulino@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'util/qemu-error.c')
-rw-r--r--util/qemu-error.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/qemu-error.c b/util/qemu-error.c
index 08a36f480c..fec02c6075 100644
--- a/util/qemu-error.c
+++ b/util/qemu-error.c
@@ -196,6 +196,7 @@ void error_print_loc(void)
}
}
+bool enable_timestamp_msg;
/*
* Print an error message to current monitor if we have one, else to stderr.
* Format arguments like sprintf(). The result should not contain
@@ -206,6 +207,15 @@ void error_print_loc(void)
void error_report(const char *fmt, ...)
{
va_list ap;
+ GTimeVal tv;
+ gchar *timestr;
+
+ if (enable_timestamp_msg) {
+ g_get_current_time(&tv);
+ timestr = g_time_val_to_iso8601(&tv);
+ error_printf("%s ", timestr);
+ g_free(timestr);
+ }
error_print_loc();
va_start(ap, fmt);