diff mbox series

[v4,04/32] block/nbd: connect_thread_func(): do qio_channel_set_delay(false)

Message ID 20210610100802.5888-5-vsementsov@virtuozzo.com
State New
Headers show
Series block/nbd: rework client connection | expand

Commit Message

Vladimir Sementsov-Ogievskiy June 10, 2021, 10:07 a.m. UTC
nbd_open() does it (through nbd_establish_connection()).
Actually we lost that call on reconnect path in 1dc4718d849e1a1fe
"block/nbd: use non-blocking connect: fix vm hang on connect()"
when we have introduced reconnect thread.

Fixes: 1dc4718d849e1a1fe665ce5241ed79048cfa2cfc
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/nbd.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Eric Blake June 10, 2021, 6:37 p.m. UTC | #1
On Thu, Jun 10, 2021 at 01:07:34PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> nbd_open() does it (through nbd_establish_connection()).
> Actually we lost that call on reconnect path in 1dc4718d849e1a1fe
> "block/nbd: use non-blocking connect: fix vm hang on connect()"
> when we have introduced reconnect thread.
> 
> Fixes: 1dc4718d849e1a1fe665ce5241ed79048cfa2cfc
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
>  block/nbd.c | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/block/nbd.c b/block/nbd.c
> index 01d2c2efad..f3a036354d 100644
> --- a/block/nbd.c
> +++ b/block/nbd.c
> @@ -408,6 +408,8 @@ static void *connect_thread_func(void *opaque)
>          thr->sioc = NULL;
>      }
>  
> +    qio_channel_set_delay(QIO_CHANNEL(thr->sioc), false);
> +
>      qemu_mutex_lock(&thr->mutex);
>  
>      switch (thr->state) {
> -- 
> 2.29.2
>
diff mbox series

Patch

diff --git a/block/nbd.c b/block/nbd.c
index 01d2c2efad..f3a036354d 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -408,6 +408,8 @@  static void *connect_thread_func(void *opaque)
         thr->sioc = NULL;
     }
 
+    qio_channel_set_delay(QIO_CHANNEL(thr->sioc), false);
+
     qemu_mutex_lock(&thr->mutex);
 
     switch (thr->state) {