From 6fb7c3bbc2b932c7bdee6dd8ea40e4a40539a58d Mon Sep 17 00:00:00 2001 From: Yang Zhong Date: Fri, 19 Jul 2019 20:04:26 +0800 Subject: [PATCH] vhost_rs: remove config space offset setting There is one definition in message.rs file as below: pub const VHOST_USER_CONFIG_OFFSET: u32 = 0x100 This definition is only for virtio mmio config space and we will add this offset in virtio-mmio side and not vhost user protocl side. Signed-off-by: Yang Zhong --- vhost_rs/src/vhost_user/message.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vhost_rs/src/vhost_user/message.rs b/vhost_rs/src/vhost_user/message.rs index 8faad5aa2..98bce128d 100644 --- a/vhost_rs/src/vhost_user/message.rs +++ b/vhost_rs/src/vhost_user/message.rs @@ -575,10 +575,9 @@ impl VhostUserMsgValidator for VhostUserConfig { fn is_valid(&self) -> bool { if (self.flags & !VhostUserConfigFlags::all().bits()) != 0 { return false; - } else if self.offset < VHOST_USER_CONFIG_OFFSET - || self.offset >= VHOST_USER_CONFIG_SIZE + } else if self.offset >= VHOST_USER_CONFIG_SIZE || self.size == 0 - || self.size > (VHOST_USER_CONFIG_SIZE - VHOST_USER_CONFIG_OFFSET) + || self.size > VHOST_USER_CONFIG_SIZE || self.size + self.offset > VHOST_USER_CONFIG_SIZE { return false;