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 <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2019-08-30 12:14:22 -07:00 committed by Rob Bradford
parent 97699a521f
commit 772191b409

View File

@ -100,8 +100,8 @@ pub fn setup_vhost_user(
queue_evts: Vec<EventFd>,
acked_features: u64,
) -> Result<Vec<(EventFd, Queue)>> {
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)