That's not a big deal to print these messages to log, if QMP monitor is active. And these two are the only users of this API. To simplify things, let's use more usual error_report() and info_report(), and drop error_printf_unless_qmp() in the following commit.
Drop \n from messages, as vreport() adds one. Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]> --- ui/vnc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index e6bcf0e1cf..ffeed5788e 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -3534,8 +3534,8 @@ int vnc_display_password(const char *id, const char *password) return -EINVAL; } if (vd->auth == VNC_AUTH_NONE) { - error_printf_unless_qmp("If you want use passwords please enable " - "password auth using '-vnc ${dpy},password'.\n"); + error_report("If you want use passwords please enable " + "password auth using '-vnc ${dpy},password'."); return -EINVAL; } @@ -3574,9 +3574,8 @@ static void vnc_display_print_local_addr(VncDisplay *vd) qapi_free_SocketAddress(addr); return; } - error_printf_unless_qmp("VNC server running on %s:%s\n", - addr->u.inet.host, - addr->u.inet.port); + info_report("VNC server running on %s:%s", addr->u.inet.host, + addr->u.inet.port); qapi_free_SocketAddress(addr); } -- 2.48.1
