From 65a38e6f704e506dc9710029490f9e57c2e9d5d8 Mon Sep 17 00:00:00 2001 From: Arron Wang Date: Tue, 3 Mar 2020 11:43:48 +0000 Subject: [PATCH] vm-virtio: vhost_user: Fix blk device configuration space offset value Current device configuration space offset value is 0, we need to update that value to VHOST_USER_CONFIG_OFFSET(0x100) to follow the spec Fixes #844 Signed-off-by: Arron Wang --- vm-virtio/src/vhost_user/blk.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vm-virtio/src/vhost_user/blk.rs b/vm-virtio/src/vhost_user/blk.rs index c658e1f46..c7f441368 100644 --- a/vm-virtio/src/vhost_user/blk.rs +++ b/vm-virtio/src/vhost_user/blk.rs @@ -20,6 +20,7 @@ use std::sync::Arc; use std::thread; use std::vec::Vec; use vhost_rs::vhost_user::message::VhostUserConfigFlags; +use vhost_rs::vhost_user::message::VHOST_USER_CONFIG_OFFSET; use vhost_rs::vhost_user::message::{VhostUserProtocolFeatures, VhostUserVirtioFeatures}; use vhost_rs::vhost_user::{Master, VhostUserMaster, VhostUserMasterReqHandler}; use vhost_rs::VhostBackend; @@ -116,7 +117,7 @@ impl Blk { let config_space: Vec = vec![0u8; config_len as usize]; let (_, config_space) = vhost_user_blk .get_config( - 0, + VHOST_USER_CONFIG_OFFSET, config_len as u32, VhostUserConfigFlags::WRITABLE, config_space.as_slice(),