pub fn save_state(&self) -> Result<VmState> {
        let pitstate = self.fd.get_pit2().map_err(Error::VmGetPit2)?;

        let mut clock = self.fd.get_clock().map_err(Error::VmGetClock)?;
        // This bit is not accepted in SET_CLOCK, clear it.
        clock.flags &= !KVM_CLOCK_TSC_STABLE;

        let mut pic_master = kvm_irqchip {
            chip_id: KVM_IRQCHIP_PIC_MASTER,
            ..Default::default()
        };
        self.fd
            .get_irqchip(&mut pic_master)
            .map_err(Error::VmGetIrqChip)?;

        let mut pic_slave = kvm_irqchip {
            chip_id: KVM_IRQCHIP_PIC_SLAVE,
            ..Default::default()
        };
        self.fd
            .get_irqchip(&mut pic_slave)
            .map_err(Error::VmGetIrqChip)?;

        let mut ioapic = kvm_irqchip {
            chip_id: KVM_IRQCHIP_IOAPIC,
            ..Default::default()
        };
        self.fd
            .get_irqchip(&mut ioapic)
            .map_err(Error::VmGetIrqChip)?;

        Ok(VmState {
            pitstate,
            clock,
            pic_master,
            pic_slave,
            ioapic,
        })
    }
/// Saves and returns the Kvm Vm state.
Saves and returns the Kvm Vm state.
Saves and returns the Kvm Vm state .
pub fn save_state(&self) -> Result<VmState> {
        let pitstate = self.fd.get_pit2().map_err(Error::VmGetPit2)?;
        let mut clock = self.fd.get_clock().map_err(Error::VmGetClock)?;
        // This bit is not accepted in SET_CLOCK, clear it.
        clock.flags &= !KVM_CLOCK_TSC_STABLE;
        let mut pic_master = kvm_irqchip {
            chip_id: KVM_IRQCHIP_PIC_MASTER,
            ..Default::default()
        };
        self.fd
            .get_irqchip(&mut pic_master)
            .map_err(Error::VmGetIrqChip)?;
        let mut pic_slave = kvm_irqchip {
            chip_id: KVM_IRQCHIP_PIC_SLAVE,
            ..Default::default()
        };
        self.fd
            .get_irqchip(&mut pic_slave)
            .map_err(Error::VmGetIrqChip)?;
        let mut ioapic = kvm_irqchip {
            chip_id: KVM_IRQCHIP_IOAPIC,
            ..Default::default()
        };
        self.fd
            .get_irqchip(&mut ioapic)
            .map_err(Error::VmGetIrqChip)?;
        Ok(VmState {
            pitstate,
            clock,
            pic_master,
            pic_slave,
            ioapic,
        })
    }
pub fn save_state ( & self ) -> Result < VmState > { let pitstate = self . fd . get_pit2 ( ) . map_err ( Error :: VmGetPit2 ) ? ; let mut clock = self . fd . get_clock ( ) . map_err ( Error :: VmGetClock ) ? ; // This bit is not accepted in SET_CLOCK, clear it. clock . flags &= ! KVM_CLOCK_TSC_STABLE ; let mut pic_master = kvm_irqchip { chip_id : KVM_IRQCHIP_PIC_MASTER , .. Default :: default ( ) } ; self . fd . get_irqchip ( & mut pic_master ) . map_err ( Error :: VmGetIrqChip ) ? ; let mut pic_slave = kvm_irqchip { chip_id : KVM_IRQCHIP_PIC_SLAVE , .. Default :: default ( ) } ; self . fd . get_irqchip ( & mut pic_slave ) . map_err ( Error :: VmGetIrqChip ) ? ; let mut ioapic = kvm_irqchip { chip_id : KVM_IRQCHIP_IOAPIC , .. Default :: default ( ) } ; self . fd . get_irqchip ( & mut ioapic ) . map_err ( Error :: VmGetIrqChip ) ? ; Ok ( VmState { pitstate , clock , pic_master , pic_slave , ioapic , } ) }
Saves and returns the Kvm Vm state.
Saves and returns the Kvm Vm state .
&self
&self