qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-4.0 1/6] char-socket: Enable "wait" option f


From: Yury Kotov
Subject: Re: [Qemu-devel] [PATCH for-4.0 1/6] char-socket: Enable "wait" option for client mode
Date: Thu, 06 Dec 2018 12:31:51 +0300

Hi,

06.12.2018, 09:37, "address@hidden" <address@hidden>:
> From: Xie Yongji <address@hidden>
>
> 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 <address@hidden>
> Signed-off-by: Zhang Yu <address@hidden>
> ---
>  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);

Does reconnect+wait allow to start QEMU when the first connection was failed?
I think it was the main reason to use tcp_chr_connect_async for reconnect case.

>      } 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

Regards,
Yury




reply via email to

[Prev in Thread] Current Thread [Next in Thread]