From a44a903587c65a55c077dccca2829e79a559f8b1 Mon Sep 17 00:00:00 2001 From: Yang Zhong Date: Fri, 19 Jul 2019 19:49:15 +0800 Subject: [PATCH] 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 --- vhost_rs/src/vhost_user/master.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vhost_rs/src/vhost_user/master.rs b/vhost_rs/src/vhost_user/master.rs index 0bbc03ec8..2fdbb5091 100644 --- a/vhost_rs/src/vhost_user/master.rs +++ b/vhost_rs/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()) }