From: Xie Yongji <xieyon...@baidu.com> Now we attempt to connect asynchronously for "reconnect socket" during open(). But vhost-user device prefer a connected socket during initialization. That means we may still need to support sync connection during open() for the "reconnect socket".
Signed-off-by: Xie Yongji <xieyon...@baidu.com> Signed-off-by: Zhang Yu <zhangy...@baidu.com> --- chardev/char-socket.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index eaa8e8b68f..f2819d52e7 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -1072,7 +1072,7 @@ static void qmp_chardev_open_socket(Chardev *chr, s->reconnect_time = reconnect; } - if (s->reconnect_time) { + if (s->reconnect_time && !is_waitconnect) { tcp_chr_connect_async(chr); } else { if (s->is_listen) { @@ -1120,7 +1120,8 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, Error **errp) { bool is_listen = qemu_opt_get_bool(opts, "server", false); - bool is_waitconnect = is_listen && qemu_opt_get_bool(opts, "wait", true); + bool is_waitconnect = is_listen ? qemu_opt_get_bool(opts, "wait", true) : + qemu_opt_get_bool(opts, "wait", false); bool is_telnet = qemu_opt_get_bool(opts, "telnet", false); bool is_tn3270 = qemu_opt_get_bool(opts, "tn3270", false); bool is_websock = qemu_opt_get_bool(opts, "websocket", false); -- 2.17.1