pub struct Partition { /* private fields */ }Implementations§
Source§impl Partition
impl Partition
pub fn check_sev_snp_launch_extensions(&self) -> Result<(), Error>
pub fn enable_hypercall_exits(&self, hypercall_mask: u64) -> Result<(), Error>
pub fn check_extension(&self, extension: u32) -> Result<c_int>
pub fn sev_snp_init(&self, sev: BorrowedFd<'_>) -> Result<(), Error>
pub fn sev_snp_launch_start( &self, sev: BorrowedFd<'_>, data: &mut kvm_sev_snp_launch_start, ) -> Result<(), Error>
pub fn sev_snp_launch_update( &self, sev: BorrowedFd<'_>, gfn_start: u64, uaddr: u64, len: u64, page_type: SevSnpPageType, ) -> Result<(), Error>
pub fn sev_snp_launch_finish( &self, sev: BorrowedFd<'_>, data: &mut kvm_sev_snp_launch_finish, ) -> Result<(), Error>
pub fn enable_split_irqchip(&self, lines: u32) -> Result<(), Error>
Sourcepub fn enable_x2apic_api(&self) -> Result<(), Error>
pub fn enable_x2apic_api(&self) -> Result<(), Error>
Enable X2APIC IDs in interrupt and LAPIC APIs.
pub fn enable_unknown_msr_exits(&self) -> Result<(), Error>
Sourcepub fn set_bsp(&mut self, vcpu_idx: u32) -> Result<(), Error>
pub fn set_bsp(&mut self, vcpu_idx: u32) -> Result<(), Error>
Set the VCPU index of the BSP. This must be called before any VCPUs are created.
pub fn add_vp(&mut self, vcpu_idx: u32) -> Result<(), Error>
pub fn vp(&self, index: u32) -> Processor<'_>
pub fn request_msi(&self, msi: &kvm_msi) -> Result<(), Error>
Sourcepub unsafe fn set_user_memory_region(
&self,
slot: u32,
data: *mut u8,
size: usize,
addr: u64,
readonly: bool,
) -> Result<(), Error>
pub unsafe fn set_user_memory_region( &self, slot: u32, data: *mut u8, size: usize, addr: u64, readonly: bool, ) -> Result<(), Error>
Sets or clears a userspace memory slot.
§Safety
If size is nonzero, data..data + size must be a valid userspace
mapping for KVM to access until the slot is changed or cleared. The
caller must also ensure that addr and size satisfy KVM’s memory-slot
alignment and range requirements.
Sourcepub unsafe fn set_user_memory_region2(
&self,
slot: u32,
data: *mut u8,
size: usize,
addr: u64,
readonly: bool,
guest_memfd: Option<(&File, u64)>,
) -> Result<(), Error>
pub unsafe fn set_user_memory_region2( &self, slot: u32, data: *mut u8, size: usize, addr: u64, readonly: bool, guest_memfd: Option<(&File, u64)>, ) -> Result<(), Error>
Sets or clears a userspace memory slot with optional guestmemfd backing.
§Safety
If size is nonzero, data..data + size must be a valid userspace
mapping for KVM to access until the slot is changed or cleared. The
caller must ensure that addr, size, and any guestmemfd offset
satisfy KVM’s memory-slot alignment and range requirements. If
guest_memfd is supplied, the file must remain open and valid for as
long as KVM may reference the slot.
pub fn create_guest_memfd(&self, size: u64) -> Result<File, Error>
pub fn set_memory_attributes( &self, addr: u64, size: u64, attributes: u64, ) -> Result<(), Error>
pub fn set_gsi_routes( &self, routes: &[(u32, RoutingEntry)], ) -> Result<(), Error>
pub fn irqfd(&self, gsi: u32, event: RawFd, assign: bool) -> Result<(), Error>
pub fn irq_line(&self, gsi: u32, level: bool) -> Result<(), Error>
pub fn ioeventfd( &self, datamatch: u64, addr: u64, len: u32, fd: i32, flags: u32, ) -> Result<(), Error>
pub fn create_device(&self, ty: u32, flags: u32) -> Result<Device>
Sourcepub fn test_create_device(&self, ty: u32) -> Result<()>
pub fn test_create_device(&self, ty: u32) -> Result<()>
Tests whether a device type can be created without actually creating it.
Uses KVM_CREATE_DEVICE_TEST to probe support. Unlike
create_device, this does not wrap any fd.
Sourcepub fn get_clock_ns(&self) -> Result<kvm_clock_data, Error>
pub fn get_clock_ns(&self) -> Result<kvm_clock_data, Error>
Gets the current kvmclock value.