libvhost-user: Fix extra vu_add/rem_mem_reg reply
commit5ebfdeb21223e0406a711decbb2baceb5ec8c416
authorKevin Wolf <kwolf@redhat.com>
Thu, 7 Apr 2022 13:36:56 +0000 (7 15:36 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 4 May 2022 13:55:23 +0000 (4 15:55 +0200)
tree3aa3603a0e9fe710245aa8ba53be30c2f144be4d
parent31009d13cc505b9569971fbbe50266c1727ba5db
libvhost-user: Fix extra vu_add/rem_mem_reg reply

Outside of postcopy mode, neither VHOST_USER_ADD_MEM_REG nor
VHOST_USER_REM_MEM_REG are supposed to send a reply unless explicitly
requested with the need_reply flag. Their current implementation always
sends a reply, even if it isn't requested. This confuses the master
because it will interpret the reply as a reply for the next message for
which it actually expects a reply.

need_reply is already handled correctly by vu_dispatch(), so just don't
send a reply in the non-postcopy part of the message handler for these
two commands.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20220407133657.155281-3-kwolf@redhat.com>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
subprojects/libvhost-user/libvhost-user.c