Struct memflow_kvm_ioctl::VMHandle
source · pub struct VMHandle { /* private fields */ }
Expand description
Handle to a KVM VM
This is a handle to a single KVM instance. Allows access to basic memory layout information of the VM.
Implementations§
source§impl VMHandle
impl VMHandle
sourcepub fn try_open_handle(memflow: &ModuleHandle, pid: Option<i32>) -> Result<Self>
pub fn try_open_handle(memflow: &ModuleHandle, pid: Option<i32>) -> Result<Self>
Open a KVM instance with a memflow handle
This may be useful when multiple VMs are accessed to save syscalls, but in regular scenarios,
use try_open
.
Arguments
memflow
- handle to the memflow driverpid
- optional process identifier. If it isNone
, orSome(0)
, handle to any of the KVM VMs gets retrieved.
sourcepub fn try_open(pid: Option<i32>) -> Result<Self>
pub fn try_open(pid: Option<i32>) -> Result<Self>
Open a KVM instance
Arguments
pid
- optional process identifier. If it isNone
, orSome(0)
, handle to any of the KVM VMs gets retrieved. Otherwise, the specific PID gets targeted. And if the process does not exist, this function will fail.
sourcepub fn info(&self, slot_count: usize) -> Result<(i32, Vec<vm_memslot>)>
pub fn info(&self, slot_count: usize) -> Result<(i32, Vec<vm_memslot>)>
Retrieve info about the KVM instance
Pulls info about the current VM handle. That means its PID, and the memory layout (in KVMs userspace).
sourcepub fn map_vm(&self, slot_count: usize) -> Result<Vec<vm_memslot>>
pub fn map_vm(&self, slot_count: usize) -> Result<Vec<vm_memslot>>
Memory map the KVM instance
Maps the memory of the KVM instance into local address space, and returns the mapped memory layout.
The memory map is permanent (unless manually unmapped using libc). KVM has the possibility of changing the memory layout (in its process only), but this function can not account for it.
Auto Trait Implementations§
impl RefUnwindSafe for VMHandle
impl Send for VMHandle
impl Sync for VMHandle
impl Unpin for VMHandle
impl UnwindSafe for VMHandle
Blanket Implementations§
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