pub struct PartitionUnit { /* private fields */ }
Expand description
The control point for managing a partition unit.
Implementations§
Source§impl PartitionUnit
impl PartitionUnit
Sourcepub fn new(
spawner: impl Spawn,
builder: UnitBuilder<'_>,
partition: impl VmPartition,
params: PartitionUnitParams<'_>,
) -> Result<(Self, Vec<VpRunner>), Error>
pub fn new( spawner: impl Spawn, builder: UnitBuilder<'_>, partition: impl VmPartition, params: PartitionUnitParams<'_>, ) -> Result<(Self, Vec<VpRunner>), Error>
Creates a new VM partition state unit.
The caller is responsible for launching a thread for each VP and running
the VP using the returned VpRunner
s.
Sourcepub fn unit_handle(&self) -> &UnitHandle
pub fn unit_handle(&self) -> &UnitHandle
Gets the handle for the partition unit.
Sourcepub async fn teardown(self) -> Sender<HaltReason>
pub async fn teardown(self) -> Sender<HaltReason>
Tears down the state unit, returning the client_notify_send
sender
passed to Self::new()
.
Sourcepub async fn clear_halt(&mut self) -> bool
pub async fn clear_halt(&mut self) -> bool
Clears the current halt reason from the partition, resuming the VPs if they are stopped.
Sourcepub async fn temporarily_stop_vps(&mut self) -> StopGuard
pub async fn temporarily_stop_vps(&mut self) -> StopGuard
Temporarily stops the VPs, returning a guard that will resume them when dropped.
Sourcepub async fn set_initial_regs(
&mut self,
vtl: Vtl,
state: Arc<InitialRegs>,
) -> Result<(), InitialRegError>
pub async fn set_initial_regs( &mut self, vtl: Vtl, state: Arc<InitialRegs>, ) -> Result<(), InitialRegError>
Sets the register state for the VPs for initial boot.
If the VM has been run before and has not been reset since it last ran, the target VTL will be scrubbed first so that the partition state is clean.
pub async fn set_initial_page_visibility( &mut self, vis: Vec<(MemoryRange, PageVisibility)>, ) -> Result<(), InitialVisibilityError>
Auto Trait Implementations§
impl Freeze for PartitionUnit
impl !RefUnwindSafe for PartitionUnit
impl Send for PartitionUnit
impl Sync for PartitionUnit
impl Unpin for PartitionUnit
impl !UnwindSafe for PartitionUnit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more