pub struct Kvm {
pub(crate) kvm: File,
}
Expand description
A wrapper around opening and using /dev/kvm
.
Useful for querying extensions and basic values from the KVM backend. A Kvm
is required to
create a Vm
object.
Fields§
§kvm: File
Implementations§
source§impl Kvm
impl Kvm
sourcepub fn new_with_path(device_path: &Path) -> Result<Kvm>
pub fn new_with_path(device_path: &Path) -> Result<Kvm>
Opens a KVM device at device_path
and returns a Kvm object on success.
pub(crate) fn check_extension_int(&self, c: Cap) -> i32
sourcepub fn check_extension(&self, c: Cap) -> bool
pub fn check_extension(&self, c: Cap) -> bool
Checks if a particular Cap
is available.
sourcepub fn get_vcpu_mmap_size(&self) -> Result<usize>
pub fn get_vcpu_mmap_size(&self) -> Result<usize>
Gets the size of the mmap required to use vcpu’s kvm_run
structure.
pub(crate) fn get_cpuid(&self, kind: IoctlNr) -> Result<CpuId>
sourcepub fn get_supported_cpuid(&self) -> Result<CpuId>
pub fn get_supported_cpuid(&self) -> Result<CpuId>
X86 specific call to get the system supported CPUID values
sourcepub fn get_emulated_cpuid(&self) -> Result<CpuId>
pub fn get_emulated_cpuid(&self) -> Result<CpuId>
X86 specific call to get the system emulated CPUID values
sourcepub fn get_msr_index_list(&self) -> Result<Vec<u32>>
pub fn get_msr_index_list(&self) -> Result<Vec<u32>>
X86 specific call to get list of supported MSRS
See the documentation for KVM_GET_MSR_INDEX_LIST.
pub fn get_vm_type(&self) -> c_ulong
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Kvm
impl Send for Kvm
impl Sync for Kvm
impl Unpin for Kvm
impl UnwindSafe for Kvm
Blanket Implementations§
§impl<T> AsRawDescriptors for Twhere
T: AsRawDescriptor,
impl<T> AsRawDescriptors for Twhere
T: AsRawDescriptor,
§fn as_raw_descriptors(&self) -> Vec<i32>
fn as_raw_descriptors(&self) -> Vec<i32>
Returns the underlying raw descriptors. Read more
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more