]> git.proxmox.com Git - mirror_qemu.git/blame - stubs/error-printf.c
Merge tag 'pull-maintainer-may24-160524-2' of https://gitlab.com/stsquad/qemu into...
[mirror_qemu.git] / stubs / error-printf.c
CommitLineData
397d30e9 1#include "qemu/osdep.h"
397d30e9 2#include "qemu/error-report.h"
756a98dd 3#include "monitor/monitor.h"
397d30e9 4
679cb8e1 5int error_vprintf(const char *fmt, va_list ap)
397d30e9 6{
679cb8e1
MA
7 int ret;
8
977a7204
DB
9 if (g_test_initialized() && !g_test_subprocess() &&
10 getenv("QTEST_SILENT_ERRORS")) {
28017e01
PB
11 char *msg = g_strdup_vprintf(fmt, ap);
12 g_test_message("%s", msg);
679cb8e1 13 ret = strlen(msg);
28017e01 14 g_free(msg);
679cb8e1 15 return ret;
28017e01 16 }
679cb8e1 17 return vfprintf(stderr, fmt, ap);
397d30e9
PB
18}
19
679cb8e1 20int error_vprintf_unless_qmp(const char *fmt, va_list ap)
397d30e9 21{
679cb8e1 22 return error_vprintf(fmt, ap);
397d30e9 23}