pub fn info(&self, slot_count: usize) -> Result<(i32, Vec<vm_memslot>)> {
        let mut vm_info = vm_info::default();
        let mut memslots = vec![Default::default(); slot_count];

        vm_info.slot_count = slot_count as u32;
        vm_info.slots = memslots.as_mut_ptr();

        let ret = unsafe { ioctl(self.vm.as_raw_fd(), IO_MEMFLOW_VM_INFO as u64, &mut vm_info) };

        if ret < 0 {
            Err(std::io::Error::last_os_error())
        } else {
            memslots.truncate(vm_info.slot_count as usize);
            Ok((vm_info.userspace_pid as i32, memslots))
        }
    }
/// Retrieve info about the KVM instance
///
/// Pulls info about the current VM handle. That means its PID, and the memory layout (in KVMs userspace).
Retrieve info about the KVM instance
Pulls info about the current VM handle. That means its PID, and the memory layout (in KVMs userspace).
Retrieve info about the KVM instance Pulls info about the current VM handle . That means its PID and the memory layout ( in KVMs userspace ) .
pub fn info(&self, slot_count: usize) -> Result<(i32, Vec<vm_memslot>)> {
        let mut vm_info = vm_info::default();
        let mut memslots = vec![Default::default(); slot_count];
        vm_info.slot_count = slot_count as u32;
        vm_info.slots = memslots.as_mut_ptr();
        let ret = unsafe { ioctl(self.vm.as_raw_fd(), IO_MEMFLOW_VM_INFO as u64, &mut vm_info) };
        if ret < 0 {
            Err(std::io::Error::last_os_error())
        } else {
            memslots.truncate(vm_info.slot_count as usize);
            Ok((vm_info.userspace_pid as i32, memslots))
        }
    }
pub fn info ( & self , slot_count : usize ) -> Result < ( i32 , Vec < vm_memslot > ) > { let mut vm_info = vm_info :: default ( ) ; let mut memslots = vec ! [ Default default ( ) slot_count ] ; vm_info . slot_count = slot_count as u32 ; vm_info . slots = memslots . as_mut_ptr ( ) ; let ret = unsafe { ioctl ( self . vm . as_raw_fd ( ) , IO_MEMFLOW_VM_INFO as u64 , & mut vm_info ) } ; if ret < 0 { Err ( std :: io :: Error :: last_os_error ( ) ) } else { memslots . truncate ( vm_info . slot_count as usize ) ; Ok ( ( vm_info . userspace_pid as i32 , memslots ) ) } }
Retrieve info about the KVM instance
Pulls info about the current VM handle.
Retrieve info about the KVM instance Pulls info about the current VM handle .
&self
slot_count
usize