xref: /openbmc/qemu/stubs/error-printf.c (revision a68694cd)
1 #include "qemu/osdep.h"
2 #include "qemu/error-report.h"
3 
4 int error_vprintf(const char *fmt, va_list ap)
5 {
6     int ret;
7 
8     if (g_test_initialized() && !g_test_subprocess() &&
9         getenv("QTEST_SILENT_ERRORS")) {
10         char *msg = g_strdup_vprintf(fmt, ap);
11         g_test_message("%s", msg);
12         ret = strlen(msg);
13         g_free(msg);
14         return ret;
15     }
16     return vfprintf(stderr, fmt, ap);
17 }
18 
19 int error_vprintf_unless_qmp(const char *fmt, va_list ap)
20 {
21     return error_vprintf(fmt, ap);
22 }
23