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 <slp@redhat.com>
This commit is contained in:
Sergio Lopez 2019-10-24 20:35:10 +02:00 committed by Rob Bradford
parent 5870452d25
commit ceafd4cee7

View File

@ -477,9 +477,7 @@ impl<S: VhostUserBackend> VhostUserSlaveReqHandler for VhostUserHandler<S> {
}
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);
}