Struct kvm_rs::vcpu::Vcpu

source ·
pub struct Vcpu { /* private fields */ }
Expand description

Wrapper for VCPU ioctls.

Representation of the file descriptor obtained by the KVM_CREATE_VCPU ioctl. This wrapper provides access to the VCPU ioctls as described in KVM API.

Implementations§

source§

impl Vcpu

source

pub fn get_regs(&self) -> Result<kvm_regs>

Get the general purpose registers with the KVM_GET_REGS ioctl in form of kvm_regs.

source

pub fn set_regs(&self, regs: kvm_regs) -> Result<()>

Set the general purpose registers with the KVM_SET_REGS ioctl in form of kvm_regs.

source

pub fn get_sregs(&self) -> Result<kvm_sregs>

Get the special registers with the KVM_GET_SREGS ioctl in form of kvm_sregs.

source

pub fn set_sregs(&self, sregs: kvm_sregs) -> Result<()>

Set the special registers with the KVM_SET_SREGS ioctl in form of kvm_sregs.

source

pub fn get_debugregs(&self) -> Result<kvm_debugregs>

Get the debug registers with the KVM_GET_DEBUGREGS ioctl in form of kvm_debugregs.

source

pub fn set_debugregs(&self, dregs: kvm_debugregs) -> Result<()>

Set the debug registers with the KVM_SET_DEBUGREGS ioctl in form of kvm_debugregs.

source

pub fn set_single_step(&self, enable: bool) -> Result<()>

Enable or disable guest single steppig (debug) with the KVM_GUESTDBG_ENABLE ioctl.

source

pub fn run(&mut self) -> Result<KvmExit<'_>>

Run the guest VCPU with the KVM_RUN ioctl until it exits with one of the exit reasons described in KvmExit.

Auto Trait Implementations§

§

impl RefUnwindSafe for Vcpu

§

impl !Send for Vcpu

§

impl !Sync for Vcpu

§

impl Unpin for Vcpu

§

impl UnwindSafe for Vcpu

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.