diff --git a/vm-virtio/src/device.rs b/vm-virtio/src/device.rs index 1a372eea4..41f253972 100644 --- a/vm-virtio/src/device.rs +++ b/vm-virtio/src/device.rs @@ -101,6 +101,12 @@ pub trait VirtioDevice: Send { fn iommu_translate(&self, addr: u64) -> u64 { addr } + + /// Some devices may need to do some explicit shutdown work. This method + /// may be implemented to do this. The VMM should call shutdown() on + /// every device as part of shutting down the VM. Acting on the device + /// after a shutdown() can lead to unpredictable results. + fn shutdown(&mut self) {} } /// Trait providing address translation the same way a physical DMA remapping