From ceafd4cee79497be796d662e595e422287705003 Mon Sep 17 00:00:00 2001 From: Sergio Lopez Date: Thu, 24 Oct 2019 20:35:10 +0200 Subject: [PATCH] vhost_user_backend: remove ownership check in set_features() set_features() fails with InvalidOperation if !self.owned. I don't see this as a requirement in the specification and, in fact, vm-virtio implementation for resetting the device calls SET_FEATURES just after RESET_OWNER. Signed-off-by: Sergio Lopez --- vhost_user_backend/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vhost_user_backend/src/lib.rs b/vhost_user_backend/src/lib.rs index 8d3d0251f..8a92435e2 100644 --- a/vhost_user_backend/src/lib.rs +++ b/vhost_user_backend/src/lib.rs @@ -477,9 +477,7 @@ impl VhostUserSlaveReqHandler for VhostUserHandler { } fn set_features(&mut self, features: u64) -> VhostUserResult<()> { - if !self.owned { - return Err(VhostUserError::InvalidOperation); - } else if (features & !self.backend.read().unwrap().features()) != 0 { + if (features & !self.backend.read().unwrap().features()) != 0 { return Err(VhostUserError::InvalidParam); }