]> git.ipfire.org Git - thirdparty/qemu.git/commit
monitor: move error_vprintf back to error-report.c
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 24 Sep 2025 15:25:45 +0000 (16:25 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 5 Mar 2026 17:40:24 +0000 (17:40 +0000)
commita582a5784e5fa8a52203b79488f5027cd4bf2c80
tree32c3605e4d39d4a5df4e9e2a2fae4690ee258cbd
parentcd670accb5987e68d4e5967922bc79efc10a5e02
monitor: move error_vprintf back to error-report.c

The current unit tests rely on monitor.o not being linked, such
that the monitor stubs get linked instead. Since error_vprintf
is in monitor.o this allows a stub error_vprintf impl to be used
that calls g_test_message.

This takes a different approach, with error_vprintf moving
back to error-report.c such that it is always linked into the
tests. The monitor_vprintf() stub is then changed to use
g_test_message if QTEST_SILENT_ERRORS is set, otherwise it will
return -1 and trigger error_vprintf to call vfprintf.

The end result is functionally equivalent for the purposes of
the unit tests.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
monitor/monitor.c
stubs/error-printf.c [deleted file]
stubs/meson.build
stubs/monitor-core.c
util/error-report.c