加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-qemu-core-when-vhost-user-net-config-with-server.patch 1.63 KB
一键复制 编辑 原始数据 按行查看 历史
Jiabo Feng 提交于 2024-04-07 10:21 . QEMU update to version 8.2.0-5
From 97335ac382e36db18a61d3891f1fafd15475822e Mon Sep 17 00:00:00 2001
From: caojinhuahw <caojinhua1@huawei.com>
Date: Mon, 19 Dec 2022 12:35:50 +0000
Subject: [PATCH] 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 9c60e15c8e..0c9ab069ae 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -347,6 +347,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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化