vm-virtio: Add shutdown method to VirtioDevice trait
This allows the VMM to explicitly shutdown devices as part of the VM shutdown ahead of what Drop::drop() would do. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
ebd83699dc
commit
545ea9ea33
1 changed files with 6 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue