From 772191b409f1ebbe8424bef11349f93aebbfa8b9 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Fri, 30 Aug 2019 12:14:22 -0700 Subject: [PATCH] vm-virtio: vhost-user: Rely on acked features to setup backend At this point in the code, the acked features have been provided by the guest and they can be set back to the backend. There's no need to retrieve one more time the backend features for this purpose. Signed-off-by: Sebastien Boeuf --- vm-virtio/src/vhost_user/vu_common_ctrl.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vm-virtio/src/vhost_user/vu_common_ctrl.rs b/vm-virtio/src/vhost_user/vu_common_ctrl.rs index 6ce0b124f..670f8e6f2 100644 --- a/vm-virtio/src/vhost_user/vu_common_ctrl.rs +++ b/vm-virtio/src/vhost_user/vu_common_ctrl.rs @@ -100,8 +100,8 @@ pub fn setup_vhost_user( queue_evts: Vec, acked_features: u64, ) -> Result> { - let backend_features = vu.get_features().unwrap(); - vu.set_features(acked_features & backend_features) + // Set features based on the acked features from the guest driver. + vu.set_features(acked_features) .map_err(Error::VhostUserSetFeatures)?; setup_vhost_user_vring(vu, mem, queues, queue_evts)