Skip to content
This repository was archived by the owner on Oct 24, 2022. It is now read-only.

Commit 2db5f82

Browse files
committed
Minimally implement {get,set}_inflight_fd.
This implementation just returns Err(InvalidOperation), which is the correct response for a backend that hasn't negotiated the inflight feature. Eventually, it'd be nice if we allowed the backend to negotiate this feature; harshanavkis/vhost-user-backend@8b44378 and slp/vhost-user-backend@3346318 are two attempts at this. This is intended as a simple, bikeshed-free way to get things compiling again while we decide on, and implement, a way to actually support the inflight feature. Signed-off-by: Gaelan Steele <[email protected]>
1 parent b109e4d commit 2db5f82

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,20 @@ impl<S: VhostUserBackend> VhostUserSlaveReqHandlerMut for VhostUserHandler<S> {
945945

946946
Ok(())
947947
}
948+
949+
fn get_inflight_fd(
950+
&mut self,
951+
_inflight: &vhost::vhost_user::message::VhostUserInflight,
952+
) -> VhostUserResult<(vhost::vhost_user::message::VhostUserInflight, File)> {
953+
// Assume the backend hasn't negotiated the inflight feature; it
954+
// wouldn't be correct for the backend to do so, as we don't (yet)
955+
// provide a way for it to handle such requests.
956+
Err(VhostUserError::InvalidOperation)
957+
}
958+
959+
fn set_inflight_fd(&mut self, _inflight: &vhost::vhost_user::message::VhostUserInflight, _file: File) -> VhostUserResult<()> {
960+
Err(VhostUserError::InvalidOperation)
961+
}
948962
}
949963

950964
impl<S: VhostUserBackend> Drop for VhostUserHandler<S> {

0 commit comments

Comments
 (0)