pub fn request_virtual_interrupt(&self, request: &InterruptRequest) -> Result<()> {
        let mut control_flags: u32 = 0;
        if request.level_triggered {
            control_flags |= 0x1;
        }
        if request.logical_destination_mode {
            control_flags |= 0x2;
        }
        if request.long_mode {
            control_flags |= 1 << 30;
        }

        let interrupt_arg = mshv_assert_interrupt {
            control: hv_interrupt_control {
                as_uint64: request.interrupt_type as u64 | ((control_flags as u64) << 32),
            },
            dest_addr: request.apic_id,
            vector: request.vector,
        };
        // SAFETY: IOCTL with correct types
        let ret = unsafe { ioctl_with_ref(&self.vm, MSHV_ASSERT_INTERRUPT(), &interrupt_arg) };
        if ret == 0 {
            Ok(())
        } else {
            Err(errno::Error::last())
        }
    }
/// Inject an interrupt into the guest..
Inject an interrupt into the guest
Inject an interrupt into the guest
pub fn request_virtual_interrupt(&self, request: &InterruptRequest) -> Result<()> {
        let mut control_flags: u32 = 0;
        if request.level_triggered {
            control_flags |= 0x1;
        }
        if request.logical_destination_mode {
            control_flags |= 0x2;
        }
        if request.long_mode {
            control_flags |= 1 << 30;
        }
        let interrupt_arg = mshv_assert_interrupt {
            control: hv_interrupt_control {
                as_uint64: request.interrupt_type as u64 | ((control_flags as u64) << 32),
            },
            dest_addr: request.apic_id,
            vector: request.vector,
        };
        // SAFETY: IOCTL with correct types
        let ret = unsafe { ioctl_with_ref(&self.vm, MSHV_ASSERT_INTERRUPT(), &interrupt_arg) };
        if ret == 0 {
            Ok(())
        } else {
            Err(errno::Error::last())
        }
    }
pub fn request_virtual_interrupt ( & self , request : & InterruptRequest ) -> Result < ( ) > { let mut control_flags : u32 = 0 ; if request . level_triggered { control_flags |= 0x1 ; } if request . logical_destination_mode { control_flags |= 0x2 ; } if request . long_mode { control_flags |= 1 << 30 ; } let interrupt_arg = mshv_assert_interrupt { control : hv_interrupt_control { as_uint64 : request . interrupt_type as u64 | ( ( control_flags as u64 ) << 32 ) , } , dest_addr : request . apic_id , vector : request . vector , } ; // SAFETY: IOCTL with correct types let ret = unsafe { ioctl_with_ref ( & self . vm , MSHV_ASSERT_INTERRUPT ( ) , & interrupt_arg ) } ; if ret == 0 { Ok ( ( ) ) } else { Err ( errno :: Error :: last ( ) ) } }
Inject an interrupt into the guest..
Inject an interrupt into the guest ..
&self
request
&InterruptRequest
&self
request
&InterruptRequest