aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorSeiji Aguchi <seiji.aguchi@hds.com>2013-07-03 23:02:46 -0400
committerLuiz Capitulino <lcapitulino@redhat.com>2013-07-10 13:42:09 -0400
commit5e2ac5191772dea782ff78e95edd395985273019 (patch)
tree804bd99545123456168886337c520707bd77ea2b /vl.c
parentf53cae50f81449596e55159cfe61efbef9246b2e (diff)
add timestamp to error_report()
[Issue] When we offer a customer support service and a problem happens in a customer's system, we try to understand the problem by comparing what the customer reports with message logs of the customer's system. In this case, we often need to know when the problem happens. But, currently, there is no timestamp in qemu's error messages. Therefore, we may not be able to understand the problem based on error messages. [Solution] Add a timestamp to qemu's error message logged by error_report() with g_time_val_to_iso8601(). Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index bea1a10cc6..25b8f2ff38 100644
--- a/vl.c
+++ b/vl.c
@@ -516,6 +516,18 @@ static QemuOptsList qemu_realtime_opts = {
},
};
+static QemuOptsList qemu_msg_opts = {
+ .name = "msg",
+ .head = QTAILQ_HEAD_INITIALIZER(qemu_msg_opts.head),
+ .desc = {
+ {
+ .name = "timestamp",
+ .type = QEMU_OPT_BOOL,
+ },
+ { /* end of list */ }
+ },
+};
+
/**
* Get machine options
*
@@ -1503,6 +1515,12 @@ static void configure_realtime(QemuOpts *opts)
}
}
+
+static void configure_msg(QemuOpts *opts)
+{
+ enable_timestamp_msg = qemu_opt_get_bool(opts, "timestamp", true);
+}
+
/***********************************************************/
/* USB devices */
@@ -2942,6 +2960,7 @@ int main(int argc, char **argv, char **envp)
qemu_add_opts(&qemu_object_opts);
qemu_add_opts(&qemu_tpmdev_opts);
qemu_add_opts(&qemu_realtime_opts);
+ qemu_add_opts(&qemu_msg_opts);
runstate_init();
@@ -3838,6 +3857,13 @@ int main(int argc, char **argv, char **envp)
}
configure_realtime(opts);
break;
+ case QEMU_OPTION_msg:
+ opts = qemu_opts_parse(qemu_find_opts("msg"), optarg, 0);
+ if (!opts) {
+ exit(1);
+ }
+ configure_msg(opts);
+ break;
default:
os_parse_cmd_args(popt->index, optarg);
}