aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-08-14 10:36:06 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 20:43:33 -0500
commitac7531ecdc8349ffc3a8d85721218df5585e30b6 (patch)
tree61b23e3a7f491b9f5939f03ab77527e9183be0cb /vl.c
parent81a322d4a1b68d47908a6630bf22897a289722aa (diff)
add qemu_error() + friends
This patch adds some functions for error reporting to address the problem that error messages should be routed to different destinations depending on the context of the caller, i.e. monitor command errors should go to the monitor, command line errors to stderr. qemu_error() is a printf-like function to report errors. qemu_errors_to_file() and qemu_errors_to_mon() switch the destination for the error message to the specified file or monitor. When setting a new destination the old one will be kept. One can switch back using qemu_errors_to_previous(). i.e. it works like a stack. main() calls qemu_errors_to_file(stderr), so errors go to stderr by default. monitor callbacks are wrapped into qemu_errors_to_mon() + qemu_errors_to_previous(), so any errors triggered by monitor commands will go to the monitor. Each thread has its own error message destination. qemu-kvm probably should add a qemu_errors_to_file(stderr) call to the i/o-thread initialization code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index 10d0c5273d..cd0f907b31 100644
--- a/vl.c
+++ b/vl.c
@@ -4878,6 +4878,7 @@ int main(int argc, char **argv, char **envp)
CPUState *env;
int show_vnc_port = 0;
+ qemu_errors_to_file(stderr);
qemu_cache_utils_init(envp);
LIST_INIT (&vm_change_state_head);