pub fn try_open_handle(memflow: &ModuleHandle, pid: Option<i32>) -> Result<Self> {
        let vm_fd: RawFd = unsafe {
            ioctl(
                memflow.as_raw_fd(),
                IO_MEMFLOW_OPEN_VM as u64,
                pid.unwrap_or_default(),
            )
        };

        if vm_fd < 0 {
            Err(std::io::Error::last_os_error())
        } else {
            Ok(Self {
                vm: unsafe { File::from_raw_fd(vm_fd) },
            })
        }
    }
/// 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 driver
/// * `pid` - optional process identifier. If it is `None`, or `Some(0)`, handle to any of the KVM
/// VMs gets retrieved.
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`.
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 ` .
pub fn try_open_handle(memflow: &ModuleHandle, pid: Option<i32>) -> Result<Self> {
        let vm_fd: RawFd = unsafe {
            ioctl(
                memflow.as_raw_fd(),
                IO_MEMFLOW_OPEN_VM as u64,
                pid.unwrap_or_default(),
            )
        };
        if vm_fd < 0 {
            Err(std::io::Error::last_os_error())
        } else {
            Ok(Self {
                vm: unsafe { File::from_raw_fd(vm_fd) },
            })
        }
    }
pub fn try_open_handle ( memflow : & ModuleHandle , pid : Option < i32 > ) -> Result < Self > { let vm_fd : RawFd = unsafe { ioctl ( memflow . as_raw_fd ( ) , IO_MEMFLOW_OPEN_VM as u64 , pid . unwrap_or_default ( ) , ) } ; if vm_fd < 0 { Err ( std :: io :: Error :: last_os_error ( ) ) } else { Ok ( Self { vm : unsafe { File :: from_raw_fd ( vm_fd ) } , } ) } }
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`.
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 ` .
memflow
&ModuleHandle
pid
Option<i32>