mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-03 20:15:45 +00:00
vm-virtio: vhost-user-net: Map proper error when getting features
Simple patch replacing unwrap() with appropriate map_err(). Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
cdfe576eb1
commit
a4ebcf486d
@ -68,7 +68,9 @@ impl<'a> Net {
|
|||||||
|
|
||||||
// Get features from backend, do negotiation to get a feature collection which
|
// Get features from backend, do negotiation to get a feature collection which
|
||||||
// both VMM and backend support.
|
// both VMM and backend support.
|
||||||
let backend_features = vhost_user_net.get_features().unwrap();
|
let backend_features = vhost_user_net
|
||||||
|
.get_features()
|
||||||
|
.map_err(Error::VhostUserGetFeatures)?;
|
||||||
avail_features &= backend_features;
|
avail_features &= backend_features;
|
||||||
// Set features back is required by the vhost crate mechanism, since the
|
// Set features back is required by the vhost crate mechanism, since the
|
||||||
// later vhost call will check if features is filled in master before execution.
|
// later vhost call will check if features is filled in master before execution.
|
||||||
|
Loading…
Reference in New Issue
Block a user