The reconnect timer is not switched to the given context, fix it.

Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com>
---
 chardev/char-socket.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 4fcdd8aedd..671861f98c 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -632,6 +632,11 @@ static void tcp_chr_update_read_handler(Chardev *chr)
 {
     SocketChardev *s = SOCKET_CHARDEV(chr);
 
+    if (s->reconnect_timer) {
+        tcp_chr_reconn_timer_cancel(s);
+        qemu_chr_socket_restart_timer(chr);
+    }
+
     if (s->listener) {
         /*
          * It's possible that chardev context is changed in
-- 
2.21.0.rc1


Reply via email to