From 32dc596a798bb15ae2cdcba731633feaaeb98a70 Mon Sep 17 00:00:00 2001 From: Egor Lazarchuk Date: Mon, 29 Sep 2025 14:17:05 +0100 Subject: [PATCH] fix(pci): correctly set device status to 0 on reset Even though currently, no device supports resetting, when the guest attempts to reset the device we must set the status to 0 as specified in the 2.4.1 Device Requirements: Device Reset. This does not change the current status of us not supporting device resetting. This is the issue we encountered during addition of virtio-pmem device where the guest kernel now resets devices on VM shutdown. Signed-off-by: Egor Lazarchuk --- src/vmm/src/devices/virtio/transport/pci/device.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vmm/src/devices/virtio/transport/pci/device.rs b/src/vmm/src/devices/virtio/transport/pci/device.rs index 9fc5322e86f..f60ca43ac14 100644 --- a/src/vmm/src/devices/virtio/transport/pci/device.rs +++ b/src/vmm/src/devices/virtio/transport/pci/device.rs @@ -962,11 +962,12 @@ impl PciDevice for VirtioPciDevice { } None => { error!("Attempt to reset device when not implemented in underlying device"); - self.common_config.driver_status = DEVICE_FAILED; + // TODO: currently we don't support device resetting, but we still + // follow the spec and set the status field to 0. + self.common_config.driver_status = DEVICE_INIT; } } } - None } }