1 Star 0 Fork 121

lijian/qemu

forked from src-openEuler/qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
libvhost-user-Fix-VHOST_USER_ADD_MEM_REG-reply.patch 1.83 KB
一键复制 编辑 原始数据 按行查看 历史
From c2353941d94a5aeb8364dc5204c29a4fbb09437f Mon Sep 17 00:00:00 2001
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
Date: Tue, 21 Nov 2023 06:47:43 +0000
Subject: [PATCH] libvhost-user: Fix VHOST_USER_ADD_MEM_REG reply mainline
inclusion commit 7f27d20ded2f480f3e66d03f90ea71507b834276 category: bugfix
---------------------------------------------------------------
With REPLY_NEEDED, libvhost-user sends both the acutal result and an
additional ACK reply for VHOST_USER_ADD_MEM_REG. This is incorrect, the
spec mandates that it behave the same with and without REPLY_NEEDED
because it always sends a reply.
Fixes: ec94c8e621de96c50c2d381c8c9ec94f5beec7c1
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20220627134500.94842-4-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
---
subprojects/libvhost-user/libvhost-user.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c
index 787f4d2d4f..8ab20138f4 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -756,15 +756,9 @@ vu_add_mem_reg(VuDev *dev, VhostUserMsg *vmsg) {
/* Send the message back to qemu with the addresses filled in. */
vmsg->fd_num = 0;
- if (!vu_send_reply(dev, dev->sock, vmsg)) {
- vu_panic(dev, "failed to respond to add-mem-region for postcopy");
- return false;
- }
-
DPRINT("Successfully added new region in postcopy\n");
dev->nregions++;
- return false;
-
+ return true;
} else {
for (i = 0; i < dev->max_queues; i++) {
if (dev->vq[i].vring.desc) {
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jianli-97/qemu.git
git@gitee.com:jianli-97/qemu.git
jianli-97
qemu
qemu
master

搜索帮助