79c4324644
Change-Id: I2d302dda68298877c65c99147f5bf22186a59aac
47 lines
1.6 KiB
Diff
47 lines
1.6 KiB
Diff
From 228609b7d942639a1ac8a9ba2816b6bb7cbc5ab8 Mon Sep 17 00:00:00 2001
|
|
From: caojinhuahw <caojinhua1@huawei.com>
|
|
Date: Mon, 19 Dec 2022 12:35:50 +0000
|
|
Subject: [PATCH 2/2] fix qemu-core when vhost-user-net config with server mode
|
|
|
|
commit 3a223111d7 set default reconnect for vhost-user-net
|
|
device, if vhost-user-net config with server mode will
|
|
casuse the core when ovs client stop.
|
|
tcp_chr_disconnect ---> set tcp_char state disconnect
|
|
tcp_chr start reconnect ---> set tcp_char state connecting
|
|
tcp_char is listen ---> call tcp_chr_accept()
|
|
fun tcp_char_accept() set tcp_char state to connecting, but
|
|
current tcp_char state already is connecting, assert failed
|
|
in tcp_char_change_state() raise qemu core
|
|
assert(s->state == TCP_CHARDEV_STATE_DISCONNECTED)
|
|
|
|
this commit check tcp_char mode, if tcp_char config with server
|
|
mode, dont set reconnect time for tcp_chr.
|
|
|
|
fix: 3a223111d7 vhost-user: Add support reconnect vhost-user socket
|
|
|
|
Signed-off-by: caojinhuahw <caojinhua1@huawei.com>
|
|
---
|
|
chardev/char-socket.c | 6 ++++++
|
|
1 file changed, 6 insertions(+)
|
|
|
|
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
|
|
index b1e9f43ec6..57ae53304a 100644
|
|
--- a/chardev/char-socket.c
|
|
+++ b/chardev/char-socket.c
|
|
@@ -403,6 +403,12 @@ static void tcp_chr_set_reconnect_time(Chardev *chr,
|
|
void qemu_chr_set_reconnect_time(Chardev *chr, int64_t reconnect_time)
|
|
{
|
|
ChardevClass *cc = CHARDEV_GET_CLASS(chr);
|
|
+ SocketChardev *s = SOCKET_CHARDEV(chr);
|
|
+
|
|
+ /* if sock dev is listen, dont set reconnect time */
|
|
+ if (s->is_listen) {
|
|
+ return;
|
|
+ }
|
|
|
|
if (cc->chr_set_reconnect_time) {
|
|
cc->chr_set_reconnect_time(chr, reconnect_time);
|
|
--
|
|
2.27.0
|
|
|