vhost_rs: 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>
This commit is contained in:
Yang Zhong 2019-07-19 19:49:15 +08:00 committed by Sebastien Boeuf
parent b4187a1b9d
commit a44a903587

View File

@ -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())
}