mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-21 23:41:15 +00:00
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
@ -101,6 +101,12 @@ pub trait VirtioDevice: Send {
|
|||||||
fn iommu_translate(&self, addr: u64) -> u64 {
|
fn iommu_translate(&self, addr: u64) -> u64 {
|
||||||
addr
|
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
|
/// Trait providing address translation the same way a physical DMA remapping
|
||||||
|
Loading…
Reference in New Issue
Block a user