aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--monitor.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/monitor.c b/monitor.c
index eccb61d183..23c0661aa8 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4628,8 +4628,13 @@ void qemu_error_internal(const char *file, int linenr, const char *func,
QDECREF(qerror);
break;
case ERR_SINK_MONITOR:
- assert(qemu_error_sink->mon->error == NULL);
- qemu_error_sink->mon->error = qerror;
+ /* report only the first error */
+ if (!qemu_error_sink->mon->error) {
+ qemu_error_sink->mon->error = qerror;
+ } else {
+ /* XXX: warn the programmer */
+ QDECREF(qerror);
+ }
break;
}
}