Paolo Bonzini | 397d30e | 2016-10-24 18:31:02 +0200 | [diff] [blame] | 1 | #include "qemu/osdep.h" |
| 2 | #include "qemu-common.h" |
| 3 | #include "qemu/error-report.h" |
| 4 | |
| 5 | void error_vprintf(const char *fmt, va_list ap) |
| 6 | { |
Paolo Bonzini | 28017e0 | 2016-10-24 18:31:03 +0200 | [diff] [blame] | 7 | if (g_test_initialized() && !g_test_subprocess()) { |
| 8 | char *msg = g_strdup_vprintf(fmt, ap); |
| 9 | g_test_message("%s", msg); |
| 10 | g_free(msg); |
| 11 | } else { |
| 12 | vfprintf(stderr, fmt, ap); |
| 13 | } |
Paolo Bonzini | 397d30e | 2016-10-24 18:31:02 +0200 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | void error_vprintf_unless_qmp(const char *fmt, va_list ap) |
| 17 | { |
| 18 | error_vprintf(fmt, ap); |
| 19 | } |