From 00800b849985eb4d7a3b9e53b776b5379c0666a4 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Wed, 6 Jul 2022 14:28:14 +0200 Subject: [PATCH] virtio-devices: Remove deprecated call to VHOST_USER_RESET_OWNER The latest vhost-user specification describes VHOST_USER_RESET_OWNER command as deprecated with the following explanation: This is no longer used. Used to be sent to request disabling all rings, but some back-ends interpreted it to also discard connection state (this interpretation would lead to bugs). It is recommended that back-ends either ignore this message, or use it to disable all rings. Also, it's been observed that when using either Rust Hypervisor Firmware or EDK2 OVMF firmware with SPDK (using the block device as the boot disk), the virtio reset that happens when the firmware no longer needs to access the block device caused a failure by triggering the command VHOST_USER_RESET_OWNER. For all these reasons, this patch simplifies the virtio reset implementation by simply disabling the virtqueues and no longer calling into VHOST_USER_RESET_OWNER. Partially fixes #4285 Signed-off-by: Sebastien Boeuf --- virtio-devices/src/vhost_user/vu_common_ctrl.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/virtio-devices/src/vhost_user/vu_common_ctrl.rs b/virtio-devices/src/vhost_user/vu_common_ctrl.rs index b520d3cb9..3aa363444 100644 --- a/virtio-devices/src/vhost_user/vu_common_ctrl.rs +++ b/virtio-devices/src/vhost_user/vu_common_ctrl.rs @@ -290,10 +290,7 @@ impl VhostUserHandle { } pub fn reset_vhost_user(&mut self, num_queues: usize) -> Result<()> { - self.enable_vhost_user_vrings(num_queues, false)?; - - // Reset the owner. - self.vu.reset_owner().map_err(Error::VhostUserResetOwner) + self.enable_vhost_user_vrings(num_queues, false) } pub fn set_protocol_features_vhost_user(