Trait Suspendable

Source
pub trait Suspendable {
    // Provided methods
    fn snapshot(&mut self) -> Result<AnySnapshot> { ... }
    fn restore(&mut self, _data: AnySnapshot) -> Result<()> { ... }
    fn sleep(&mut self) -> Result<()> { ... }
    fn wake(&mut self) -> Result<()> { ... }
}
Expand description

This trait provides the functions required for a device to implement to successfully suspend/resume in crosvm.

Provided Methods§

Source

fn snapshot(&mut self) -> Result<AnySnapshot>

Save the device state in an image that can be restored.

Source

fn restore(&mut self, _data: AnySnapshot) -> Result<()>

Load a saved snapshot of an image.

Source

fn sleep(&mut self) -> Result<()>

Stop all threads related to the device. Sleep should be idempotent.

Source

fn wake(&mut self) -> Result<()>

Create/Resume all threads related to the device. Wake should be idempotent.

Implementations on Foreign Types§

Source§

impl<T: PciDevice + ?Sized> Suspendable for Box<T>

Source§

fn snapshot(&mut self) -> Result<AnySnapshot>

Source§

fn restore(&mut self, data: AnySnapshot) -> Result<()>

Source§

fn sleep(&mut self) -> Result<()>

Source§

fn wake(&mut self) -> Result<()>

Implementors§

Source§

impl Suspendable for AcAdapter

Source§

impl Suspendable for ACPIPMResource

Source§

impl Suspendable for GoldfishBattery

Source§

impl Suspendable for Cmos

Source§

impl Suspendable for Ioapic

Source§

impl Suspendable for Pic

The PIC is only used in very early boot on x86_64, and snapshots are not generally taken during that time, so we can safely skip the PIC for now.

Source§

impl Suspendable for PciRootConfiguration

Source§

impl Suspendable for Pl030

Source§

impl Suspendable for VirtualPmc

Source§

impl Suspendable for CoIommuDev

Source§

impl Suspendable for Debugcon

Source§

impl Suspendable for FwCfgDevice

Source§

impl Suspendable for I8042Device

Source§

impl Suspendable for MockDevice

Source§

impl Suspendable for PciBridge

Source§

impl Suspendable for PciConfigIo

Source§

impl Suspendable for PciConfigMmio

Source§

impl Suspendable for PciVirtualConfigMmio

Source§

impl Suspendable for Pflash

Source§

impl Suspendable for Pit

Source§

impl Suspendable for ProxyDevice

Source§

impl Suspendable for PvPanicPciDevice

Source§

impl Suspendable for Serial

Source§

impl Suspendable for SmcccTrng

Source§

impl Suspendable for StubPciDevice

Source§

impl Suspendable for VfioPciDevice

Source§

impl Suspendable for VfioPlatformDevice

Source§

impl Suspendable for VirtCpufreq

Source§

impl Suspendable for VirtCpufreqV2

Source§

impl Suspendable for XhciController

Source§

impl Suspendable for VirtioMmioDevice

Source§

impl Suspendable for VirtioPciDevice

Source§

impl Suspendable for Vmwdt

Source§

impl<V: VcpuX86_64 + 'static> Suspendable for UserspaceIrqChip<V>