From a6e1e0fb6c7c7e87a21069716fbad2ab4292f0cc Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Thu, 11 Mar 2021 19:18:13 +0100 Subject: [PATCH] lib: Set reply_ack based on acked protocol features In case VHOST_USER_PROTOCOL_F_REPLY_ACK has been negotiated, the reply ack must be explicitly set on the SlaveFsCacheReq handler. Signed-off-by: Sebastien Boeuf --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 05673db..321054b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -873,6 +873,10 @@ impl VhostUserSlaveReqHandlerMut for VhostUserHandler { } fn set_slave_req_fd(&mut self, vu_req: SlaveFsCacheReq) { + if self.acked_protocol_features & VhostUserProtocolFeatures::REPLY_ACK.bits() != 0 { + vu_req.set_reply_ack_flag(true); + } + self.backend.write().unwrap().set_slave_req_fd(vu_req); } }