pub struct PlatformX86 { /* private fields */ }Expand description
The x86 specific platform properties for a virtual machine.
Reference to the official documentation:
https://www.virtualbox.org/sdkref/interface_i_platform_x86.html
Implementations§
Source§impl PlatformX86
impl PlatformX86
Sourcepub fn get_hpet_enabled(&self) -> Result<bool, VboxError>
pub fn get_hpet_enabled(&self) -> Result<bool, VboxError>
This attribute controls if High Precision Event Timer (HPET) is enabled in this VM.
§Returns
Returns bool on success, or a VboxError on failure.
§Example
use virtualbox_rs::VirtualBox;
let vbox = VirtualBox::init().unwrap();
let machine = vbox.
find_machines("Freebsd_14").unwrap();
let platform = machine.get_platform().unwrap();
let platform_x86 = platform.get_x86().unwrap();
let hpet_enabled = platform_x86.get_hpet_enabled().unwrap();Sourcepub fn set_hpet_enabled(&self, hpet_enabled: bool) -> Result<(), VboxError>
pub fn set_hpet_enabled(&self, hpet_enabled: bool) -> Result<(), VboxError>
This attribute controls if High Precision Event Timer (HPET) is enabled in this VM.
§Arguments
hpet_enabled- This attribute controls if High Precision Event Timer (HPET) is enabled in this VM.
§Returns
Returns () on success, or a VboxError on failure.
§Example
use virtualbox_rs::{Session, VirtualBox};
use virtualbox_rs::enums::SessionType;
let vbox = VirtualBox::init().unwrap();
let machine = vbox.
find_machines("Freebsd_14").unwrap();
let mut session = Session::init().unwrap();
machine.lock_machine(&mut session, SessionType::Shared).unwrap();
let machine_mut = session.get_machine().unwrap();
let platform = machine_mut.get_platform().unwrap();
let platform_x86 = platform.get_x86().unwrap();
platform_x86.set_hpet_enabled(true).unwrap();Sourcepub fn get_cpu_property(
&self,
property: CPUPropertyType,
) -> Result<bool, VboxError>
pub fn get_cpu_property( &self, property: CPUPropertyType, ) -> Result<bool, VboxError>
Returns the virtual CPU boolean value of the specified property.
§Arguments
property-CPUPropertyType. Property type to query.
§Returns
Returns bool success, or a VboxError on failure.
§Example
use virtualbox_rs::{VirtualBox};
use virtualbox_rs::enums::CPUPropertyType;
let vbox = VirtualBox::init().unwrap();
let machine = vbox.
find_machines("Freebsd_14").unwrap();
let platform = machine.get_platform().unwrap();
let platform_x86 = platform.get_x86().unwrap();
let cpu_property = platform_x86.get_cpu_property(CPUPropertyType::APIC).unwrap();Sourcepub fn set_cpu_property(
&self,
property: CPUPropertyType,
value: bool,
) -> Result<(), VboxError>
pub fn set_cpu_property( &self, property: CPUPropertyType, value: bool, ) -> Result<(), VboxError>
Sets the virtual CPU boolean value of the specified property.
§Arguments
property-CPUPropertyType. Property type to query.value- bool. Property value.
§Returns
Returns () success, or a VboxError on failure.
§Example
use virtualbox_rs::{Session, VirtualBox};
use virtualbox_rs::enums::{CPUPropertyType, SessionType};
let vbox = VirtualBox::init().unwrap();
let machine = vbox.
find_machines("Freebsd_14").unwrap();
let mut session = Session::init().unwrap();
machine.lock_machine(&mut session, SessionType::Shared).unwrap();
let machine_mut = session.get_machine().unwrap();
let platform = machine_mut.get_platform().unwrap();
let platform_x86 = platform.get_x86().unwrap();
platform_x86.set_cpu_property(CPUPropertyType::APIC, true).unwrap();Sourcepub fn get_hw_virt_ex_property(
&self,
property: HWVirtExPropertyType,
) -> Result<bool, VboxError>
pub fn get_hw_virt_ex_property( &self, property: HWVirtExPropertyType, ) -> Result<bool, VboxError>
Returns the value of the specified hardware virtualization boolean property.
§Arguments
property-HWVirtExPropertyType. Property type to query.
§Returns
Returns bool success, or a VboxError on failure.
§Example
use virtualbox_rs::{VirtualBox};
use virtualbox_rs::enums::HWVirtExPropertyType;
let vbox = VirtualBox::init().unwrap();
let machine = vbox.
find_machines("Freebsd_14").unwrap();
let platform = machine.get_platform().unwrap();
let platform_x86 = platform.get_x86().unwrap();
let property = platform_x86.get_hw_virt_ex_property(HWVirtExPropertyType::NestedPaging).unwrap();Sourcepub fn set_hw_virt_ex_property(
&self,
property: HWVirtExPropertyType,
value: bool,
) -> Result<(), VboxError>
pub fn set_hw_virt_ex_property( &self, property: HWVirtExPropertyType, value: bool, ) -> Result<(), VboxError>
Sets a new value for the specified hardware virtualization boolean property.
§Arguments
property-HWVirtExPropertyType. Property type to set.value- bool. New property value.
§Returns
Returns () success, or a VboxError on failure.
§Example
use virtualbox_rs::{Session, VirtualBox};
use virtualbox_rs::enums::{HWVirtExPropertyType, SessionType};
let vbox = VirtualBox::init().unwrap();
let machine = vbox.
find_machines("Freebsd_14").unwrap();
let mut session = Session::init().unwrap();
machine.lock_machine(&mut session, SessionType::Shared).unwrap();
let machine_mut = session.get_machine().unwrap();
let platform = machine_mut.get_platform().unwrap();
let platform_x86 = platform.get_x86().unwrap();
platform_x86.set_hw_virt_ex_property(HWVirtExPropertyType::NestedPaging, true).unwrap();