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 <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2021-03-11 19:18:13 +01:00
parent 46f2ad4fba
commit a6e1e0fb6c

View file

@ -873,6 +873,10 @@ impl<S: VhostUserBackend> VhostUserSlaveReqHandlerMut for VhostUserHandler<S> {
}
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);
}
}