Skip to content

Commit 5bf20cd

Browse files
committed
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 <[email protected]>
1 parent 9fa26c3 commit 5bf20cd

File tree

1 file changed

+3
-2
lines changed
  • src/vmm/src/devices/virtio/transport/pci

1 file changed

+3
-2
lines changed

src/vmm/src/devices/virtio/transport/pci/device.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,11 +962,12 @@ impl PciDevice for VirtioPciDevice {
962962
}
963963
None => {
964964
error!("Attempt to reset device when not implemented in underlying device");
965-
self.common_config.driver_status = DEVICE_FAILED;
965+
// TODO: currently we don't support device resetting, but we still
966+
// follow the spec and set the status field to 0.
967+
self.common_config.driver_status = DEVICE_INIT;
966968
}
967969
}
968970
}
969-
970971
None
971972
}
972973
}

0 commit comments

Comments
 (0)