Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
remove more references to evolving
Signed-off-by: Jorge Prendes <[email protected]>
  • Loading branch information
jprendes committed Aug 6, 2025
commit 87cab1943a8834ede8c0aa863a1029a8944c42b5
2 changes: 1 addition & 1 deletion src/hyperlight_host/src/hypervisor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ pub(crate) mod tests {
use crate::sandbox::uninitialized::GuestBinary;
#[cfg(any(crashdump, gdb))]
use crate::sandbox::uninitialized::SandboxRuntimeConfig;
use crate::sandbox::uninitialized_evolve::set_up_hypervisor_partition;
use crate::sandbox::uninitialized_init::set_up_hypervisor_partition;
use crate::sandbox::{SandboxConfiguration, UninitializedSandbox};
use crate::{Result, is_hypervisor_present, new_error};

Expand Down
2 changes: 1 addition & 1 deletion src/hyperlight_host/src/sandbox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub mod sandbox;
pub mod uninitialized;
/// Functionality for properly converting `UninitializedSandbox`es to
/// initialized `Sandbox`es.
pub(crate) mod uninitialized_evolve;
pub(crate) mod uninitialized_init;

/// Representation of a snapshot of a `Sandbox`.
pub mod snapshot;
Expand Down
6 changes: 3 additions & 3 deletions src/hyperlight_host/src/sandbox/sandbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,10 @@ mod tests {
}
}

/// Tests that evolving from Sandbox to Sandbox creates a new state
/// and restoring a snapshot from before evolving restores the previous state
/// Tests that calling a guest function from a Sandbox mutates its state
/// and restoring a snapshot restores the previous state
#[test]
fn snapshot_evolve_restore_handles_state_correctly() {
fn snapshot_restore_resets_state_correctly() {
let mut sbox: Sandbox = {
let path = simple_guest_as_string().unwrap();
let u_sbox = UninitializedSandbox::new(GuestBinary::FilePath(path), None).unwrap();
Expand Down
6 changes: 3 additions & 3 deletions src/hyperlight_host/src/sandbox/uninitialized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use tracing::{Span, instrument};

use super::host_funcs::{FunctionRegistry, default_writer_func};
use super::mem_mgr::MemMgrWrapper;
use super::uninitialized_evolve::evolve_impl_multi_use;
use super::uninitialized_init::init_impl_multi_use;
use crate::func::host_functions::{HostFunction, register_host_function};
use crate::func::{ParameterTuple, SupportedReturnType};
#[cfg(feature = "build-metadata")]
Expand Down Expand Up @@ -97,11 +97,11 @@ impl UninitializedSandbox {
/// Creates and initializes the virtual machine, transforming this into a ready-to-use sandbox.
///
/// This method consumes the `UninitializedSandbox` and performs the final initialization
/// steps to create the underlying virtual machine. Once evolved, the resulting
/// steps to create the underlying virtual machine. Once initialized, the resulting
/// [`Sandbox`] can execute guest code and handle function calls.
#[instrument(err(Debug), skip_all, parent = Span::current(), level = "Trace")]
pub fn init(self) -> Result<Sandbox> {
evolve_impl_multi_use(self)
init_impl_multi_use(self)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use crate::sandbox::{HostSharedMemory, MemMgrWrapper};
use crate::signal_handlers::setup_signal_handlers;
use crate::{Result, Sandbox, UninitializedSandbox, log_then_return, new_error};

/// The implementation for evolving `UninitializedSandbox`es to
/// The implementation for initializing `UninitializedSandbox`es to
/// `Sandbox`es.
///
/// Note that `cb_opt`'s type has been carefully considered.
Expand All @@ -57,7 +57,7 @@ use crate::{Result, Sandbox, UninitializedSandbox, log_then_return, new_error};
/// If this doesn't make sense, and you want to change this type,
/// please reach out to a Hyperlight developer before making the change.
#[instrument(err(Debug), skip_all, , parent = Span::current(), level = "Trace")]
fn evolve_impl<TransformFunc, ResSandbox>(
fn init_impl<TransformFunc, ResSandbox>(
u_sbox: UninitializedSandbox,
transform: TransformFunc,
) -> Result<ResSandbox>
Expand Down Expand Up @@ -120,8 +120,8 @@ where
}

#[instrument(err(Debug), skip_all, parent = Span::current(), level = "Trace")]
pub(super) fn evolve_impl_multi_use(u_sbox: UninitializedSandbox) -> Result<Sandbox> {
evolve_impl(u_sbox, |hf, hshm, vm, dispatch_ptr| {
pub(super) fn init_impl_multi_use(u_sbox: UninitializedSandbox) -> Result<Sandbox> {
init_impl(u_sbox, |hf, hshm, vm, dispatch_ptr| {
#[cfg(gdb)]
let dbg_mem_wrapper = dbg_mem_access_handler_wrapper(hshm.clone());
Ok(Sandbox::from_uninit(
Expand Down Expand Up @@ -275,12 +275,12 @@ pub(crate) fn set_up_hypervisor_partition(
mod tests {
use hyperlight_testing::{callback_guest_as_string, simple_guest_as_string};

use super::evolve_impl_multi_use;
use super::init_impl_multi_use;
use crate::UninitializedSandbox;
use crate::sandbox::uninitialized::GuestBinary;

#[test]
fn test_evolve() {
fn test_init() {
let guest_bin_paths = vec![
simple_guest_as_string().unwrap(),
callback_guest_as_string().unwrap(),
Expand All @@ -289,7 +289,7 @@ mod tests {
let u_sbox =
UninitializedSandbox::new(GuestBinary::FilePath(guest_bin_path.clone()), None)
.unwrap();
evolve_impl_multi_use(u_sbox).unwrap();
init_impl_multi_use(u_sbox).unwrap();
}
}
}
Loading