monitor: remove redundant error_[v]printf_unless_qmp
The only callers of these functions have been removed. Adding any new usage of them is highly undesirable, so they should be entirely removed. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Daniel P. Berrangé committed
Sep 10, 2025 at 16:29 UTC
7818c014ef658ed4477c016fb2b03b351f1e7556
3 files changed
-32
include/monitor/monitor.h
-3
@@ -59,7 +59,4 @@ void monitor_register_hmp(const char *name, bool info,
59
void monitor_register_hmp_info_hrt(const char *name,
60
HumanReadableText *(*handler)(Error **errp));
61
62
-int error_vprintf_unless_qmp(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0);
63
-int error_printf_unless_qmp(const char *fmt, ...) G_GNUC_PRINTF(1, 2);
64
-
62
#endif /* MONITOR_H */
monitor/monitor.c
-24
@@ -281,30 +281,6 @@ int error_vprintf(const char *fmt, va_list ap)
281
return vfprintf(stderr, fmt, ap);
282
}
283
284
-int error_vprintf_unless_qmp(const char *fmt, va_list ap)
285
-{
286
- Monitor *cur_mon = monitor_cur();
287
-
288
- if (!cur_mon) {
289
- return vfprintf(stderr, fmt, ap);
290
- }
291
- if (!monitor_cur_is_qmp()) {
292
- return monitor_vprintf(cur_mon, fmt, ap);
293
- }
294
- return -1;
295
-}
296
-
297
-int error_printf_unless_qmp(const char *fmt, ...)
298
-{
299
- va_list ap;
300
- int ret;
301
-
302
- va_start(ap, fmt);
303
- ret = error_vprintf_unless_qmp(fmt, ap);
304
- va_end(ap);
305
- return ret;
306
-}
307
-
284
static MonitorQAPIEventConf monitor_qapi_event_conf[QAPI_EVENT__MAX] = {
285
/* Limit guest-triggerable events to 1 per second */
286
[QAPI_EVENT_RTC_CHANGE] = { 1000 * SCALE_MS },
stubs/error-printf.c
-5
@@ -16,8 +16,3 @@ int error_vprintf(const char *fmt, va_list ap)
16
}
17
return vfprintf(stderr, fmt, ap);
18
}
19
-
20
-int error_vprintf_unless_qmp(const char *fmt, va_list ap)
21
-{
22
- return error_vprintf(fmt, ap);
23
-}