aboutsummaryrefslogtreecommitdiff
path: root/qemu-error.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-03-02 14:56:34 +0100
committerMarkus Armbruster <armbru@redhat.com>2010-03-16 17:01:08 +0100
commitcde0fc7544ca590c83f349d4dcccf375d55d6042 (patch)
tree1b31f269b788b772394fd00a077eeae5fc9ea74f /qemu-error.c
parent6620d3ce9ee44c01c7d715322be7879ad3d98c7a (diff)
error: Let converted handlers print in human monitor
While fully converted handlers are not supposed to print anything when running in a QMP monitor, they are free to print in a human monitor. For instance, device_add (not yet converted) prints help, and will continue to do so after conversion. Moreover, utility functions converted to QError should remain usable from unconverted handlers. Two problems: * handler_audit() complains when a converted handler prints. Limit that to QMP monitors. * With QMP, handlers need to pass the error object by way of monitor_set_error(). However, we do that both for QMP and for the human monitor. The human monitor prints the error object after the handler returns. If the handler prints anything else, that output "overtakes" the error message. Limit use of monitor_set_error() to QMP monitors. Update handler_audit() accordingly.
Diffstat (limited to 'qemu-error.c')
-rw-r--r--qemu-error.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qemu-error.c b/qemu-error.c
index 5be6bea4c9..a8c178b332 100644
--- a/qemu-error.c
+++ b/qemu-error.c
@@ -207,7 +207,7 @@ void qerror_report_internal(const char *file, int linenr, const char *func,
qerror = qerror_from_info(file, linenr, func, fmt, &va);
va_end(va);
- if (cur_mon) {
+ if (monitor_cur_is_qmp()) {
monitor_set_error(cur_mon, qerror);
} else {
qerror_print(qerror);