diff options
author | Markus Armbruster <armbru@redhat.com> | 2010-02-17 10:52:26 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2010-03-16 16:55:05 +0100 |
commit | d6f468337aba7eeeab0c7a772eda7491eb432cca (patch) | |
tree | 452f99d0c5ff5f3529c7a8f48c8f3e1df38791d4 /monitor.c | |
parent | a44264880ef42254edb88f9ec5d6f35e3e84089b (diff) | |
download | qemu-d6f468337aba7eeeab0c7a772eda7491eb432cca.zip qemu-d6f468337aba7eeeab0c7a772eda7491eb432cca.tar.gz qemu-d6f468337aba7eeeab0c7a772eda7491eb432cca.tar.bz2 |
monitor: Factor monitor_set_error() out of qemu_error_internal()
This separates the monitor part from the QError part.
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -3858,6 +3858,18 @@ fail: return NULL; } +void monitor_set_error(Monitor *mon, QError *qerror) +{ + /* report only the first error */ + if (!mon->error) { + mon->error = qerror; + } else { + MON_DEBUG("Additional error report at %s:%d\n", + qerror->file, qerror->linenr); + QDECREF(qerror); + } +} + static void monitor_print_error(Monitor *mon) { qerror_print(mon->error); @@ -4759,14 +4771,7 @@ void qemu_error_internal(const char *file, int linenr, const char *func, QDECREF(qerror); break; case ERR_SINK_MONITOR: - /* report only the first error */ - if (!qemu_error_sink->mon->error) { - qemu_error_sink->mon->error = qerror; - } else { - MON_DEBUG("Additional error report at %s:%d\n", qerror->file, - qerror->linenr); - QDECREF(qerror); - } + monitor_set_error(qemu_error_sink->mon, qerror); break; } } |