#include "monitor/monitor.h"
#include "qemu/error-report.h"
+#ifdef CONFIG_MARU
+static QLIST_HEAD(, ErrorReporter) error_reporters =
+ QLIST_HEAD_INITIALIZER(error_reporters);
+
+void add_error_reporter(ErrorReporter *new_reporter)
+{
+ QLIST_INSERT_HEAD(&error_reporters, new_reporter, node);
+}
+
+static void report_to_clients(const char *fmt, va_list ap)
+{
+ ErrorReporter *reporter;
+ QLIST_FOREACH(reporter, &error_reporters, node) {
+ if (reporter->report) {
+ (*(reporter->report))(fmt, ap);
+ }
+ }
+}
+#endif
+
/*
* Print to current monitor if we have one, else to stderr.
* TODO should return int, so callers can calculate width, but that
monitor_vprintf(cur_mon, fmt, ap);
} else {
vfprintf(stderr, fmt, ap);
+#ifdef CONFIG_MARU
+ report_to_clients(fmt, ap);
+#endif
}
}