Since it depends on monitor code, and error_vprintf_unless_qmp() is
already there.
This will help to move error-report in a common subproject.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <
20220420132624.
2439741-31-marcandre.lureau@redhat.com>
void monitor_register_hmp_info_hrt(const char *name,
HumanReadableText *(*handler)(Error **errp));
+int error_vprintf_unless_qmp(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0);
+int error_printf_unless_qmp(const char *fmt, ...) G_GNUC_PRINTF(1, 2);
+
#endif /* MONITOR_H */
int error_vprintf(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0);
int error_printf(const char *fmt, ...) G_GNUC_PRINTF(1, 2);
-int error_vprintf_unless_qmp(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0);
-int error_printf_unless_qmp(const char *fmt, ...) G_GNUC_PRINTF(1, 2);
void error_vreport(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0);
void warn_vreport(const char *fmt, va_list ap) G_GNUC_PRINTF(1, 0);
return -1;
}
+int error_printf_unless_qmp(const char *fmt, ...)
+{
+ va_list ap;
+ int ret;
+
+ va_start(ap, fmt);
+ ret = error_vprintf_unless_qmp(fmt, ap);
+ va_end(ap);
+ return ret;
+}
static MonitorQAPIEventConf monitor_qapi_event_conf[QAPI_EVENT__MAX] = {
/* Limit guest-triggerable events to 1 per second */
#include "qemu/osdep.h"
#include "qemu/error-report.h"
+#include "monitor/monitor.h"
int error_vprintf(const char *fmt, va_list ap)
{
#include "qemu/cutils.h"
#include "qemu/help_option.h"
#include "io/dns-resolver.h"
+#include "monitor/monitor.h"
#define VNC_REFRESH_INTERVAL_BASE GUI_REFRESH_INTERVAL_DEFAULT
#define VNC_REFRESH_INTERVAL_INC 50
return ret;
}
-int error_printf_unless_qmp(const char *fmt, ...)
-{
- va_list ap;
- int ret;
-
- va_start(ap, fmt);
- ret = error_vprintf_unless_qmp(fmt, ap);
- va_end(ap);
- return ret;
-}
-
static Location std_loc = {
.kind = LOC_NONE
};