summaryrefslogtreecommitdiff
path: root/src/vhost_user
diff options
context:
space:
mode:
authorYang Zhong <yang.zhong@intel.com>2019-07-04 19:39:26 +0800
committerAndreea Florescu <andreea.florescu15@gmail.com>2020-09-04 17:59:53 +0300
commit2f9c79529062787e9afe1e6fe86053cb5c68e6ec (patch)
tree52640deaf76a40c9cd17cb1c0d9f2acef3a9e003 /src/vhost_user
parent4ff21ad9d999fdf59d39467246b03e9e28418c8f (diff)
downloadvmm_vhost-2f9c79529062787e9afe1e6fe86053cb5c68e6ec.tar.gz
vhost-user: Change get_config()/set_config()
Use acked_protocol_features to replace acked_virtio_features in get_config()/set_config() for protocol features like CONFIG. This patch also fix wrong GET_CONFIG setting for set_config(). Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Diffstat (limited to 'src/vhost_user')
-rw-r--r--src/vhost_user/master.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vhost_user/master.rs b/src/vhost_user/master.rs
index 02eb715..d437ee4 100644
--- a/src/vhost_user/master.rs
+++ b/src/vhost_user/master.rs
@@ -352,7 +352,7 @@ impl VhostUserMaster for Master {
let mut node = self.node.lock().unwrap();
// depends on VhostUserProtocolFeatures::CONFIG
- if node.acked_virtio_features & VhostUserProtocolFeatures::CONFIG.bits() == 0 {
+ if node.acked_protocol_features & VhostUserProtocolFeatures::CONFIG.bits() == 0 {
return error_code(VhostUserError::InvalidOperation);
}
@@ -384,11 +384,11 @@ impl VhostUserMaster for Master {
let mut node = self.node.lock().unwrap();
// depends on VhostUserProtocolFeatures::CONFIG
- if node.acked_virtio_features & VhostUserProtocolFeatures::CONFIG.bits() == 0 {
+ if node.acked_protocol_features & VhostUserProtocolFeatures::CONFIG.bits() == 0 {
return error_code(VhostUserError::InvalidOperation);
}
- let hdr = node.send_request_with_payload(MasterReq::GET_CONFIG, &body, buf, None)?;
+ let hdr = node.send_request_with_payload(MasterReq::SET_CONFIG, &body, buf, None)?;
node.wait_for_ack(&hdr).map_err(|e| e.into())
}