summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Wolf2022-06-27 15:45:00 +0200
committerMichael S. Tsirkin2022-06-28 00:53:18 +0200
commit7f27d20ded2f480f3e66d03f90ea71507b834276 (patch)
treefae3c9c8c6bcd038a58255b7fb8c940bb3b5d0ce
parentlibvhost-user: Fix VHOST_USER_GET_MAX_MEM_SLOTS reply (diff)
downloadqemu-7f27d20ded2f480f3e66d03f90ea71507b834276.tar.gz
qemu-7f27d20ded2f480f3e66d03f90ea71507b834276.tar.xz
qemu-7f27d20ded2f480f3e66d03f90ea71507b834276.zip
libvhost-user: Fix VHOST_USER_ADD_MEM_REG reply
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>
-rw-r--r--subprojects/libvhost-user/libvhost-user.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c
index cfa1bcc334..ffed4729a3 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -779,15 +779,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) {