pub fn map_vm(&self, slot_count: usize) -> Result<Vec<vm_memslot>> {
        let mut vm_info = vm_map_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_MAP_VM 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(memslots)
        }
    }
/// 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.
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.
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 .
pub fn map_vm(&self, slot_count: usize) -> Result<Vec<vm_memslot>> {
        let mut vm_info = vm_map_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_MAP_VM 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(memslots)
        }
    }
pub fn map_vm ( & self , slot_count : usize ) -> Result < Vec < vm_memslot > > { let mut vm_info = vm_map_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_MAP_VM 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 ( memslots ) } }
Memory map the KVM instance
Maps the memory of the KVM instance into local address space, and returns the mapped memory layout.
Memory map the KVM instance Maps the memory of the KVM instance into local address space and returns the mapped memory layout .
&self
slot_count
usize