monitor: QError support
authorLuiz Capitulino <lcapitulino@redhat.com>
Thu, 19 Nov 2009 01:05:31 +0000 (23:05 -0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 3 Dec 2009 15:41:20 +0000 (09:41 -0600)
commit005dd4ec4a22ffb386d5df82167381e41c3fea40
tree66789e33d8ff66cc287ff78a83eb568d5e169906
parent7b0c1b4a2b6cf7eb586273c000fbaa0e479df0b7
monitor: QError support

This commit adds QError support in the Monitor.

A QError member is added to the Monitor struct. This new member
stores error information and is also used to check if an error
has occurred when the called handler returns.

Additionally, a new macro called qemu_error_new() is introduced.
It builds on top of the QemuErrorSink API and should be used in
place of qemu_error().

When all conversion to qemu_error_new() is done, qemu_error() can
be turned private.

Basically, Monitor's error flow is something like this:

1. An error occurs in the handler, it calls qemu_error_new()
2. qemu_error_new() builds a new QError object and stores it in
   the Monitor struct
3. The handler returns
4. Top level Monitor code checks the Monitor struct and calls
   qerror_print() to print the error

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
monitor.c
sysemu.h