Skip to content

Commit 87cab19

Browse files
committed
remove more references to evolving
Signed-off-by: Jorge Prendes <[email protected]>
1 parent 10875d1 commit 87cab19

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

src/hyperlight_host/src/hypervisor/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ pub(crate) mod tests {
532532
use crate::sandbox::uninitialized::GuestBinary;
533533
#[cfg(any(crashdump, gdb))]
534534
use crate::sandbox::uninitialized::SandboxRuntimeConfig;
535-
use crate::sandbox::uninitialized_evolve::set_up_hypervisor_partition;
535+
use crate::sandbox::uninitialized_init::set_up_hypervisor_partition;
536536
use crate::sandbox::{SandboxConfiguration, UninitializedSandbox};
537537
use crate::{Result, is_hypervisor_present, new_error};
538538

src/hyperlight_host/src/sandbox/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub mod sandbox;
3636
pub mod uninitialized;
3737
/// Functionality for properly converting `UninitializedSandbox`es to
3838
/// initialized `Sandbox`es.
39-
pub(crate) mod uninitialized_evolve;
39+
pub(crate) mod uninitialized_init;
4040

4141
/// Representation of a snapshot of a `Sandbox`.
4242
pub mod snapshot;

src/hyperlight_host/src/sandbox/sandbox.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,10 @@ mod tests {
468468
}
469469
}
470470

471-
/// Tests that evolving from Sandbox to Sandbox creates a new state
472-
/// and restoring a snapshot from before evolving restores the previous state
471+
/// Tests that calling a guest function from a Sandbox mutates its state
472+
/// and restoring a snapshot restores the previous state
473473
#[test]
474-
fn snapshot_evolve_restore_handles_state_correctly() {
474+
fn snapshot_restore_resets_state_correctly() {
475475
let mut sbox: Sandbox = {
476476
let path = simple_guest_as_string().unwrap();
477477
let u_sbox = UninitializedSandbox::new(GuestBinary::FilePath(path), None).unwrap();

src/hyperlight_host/src/sandbox/uninitialized.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use tracing::{Span, instrument};
2424

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

src/hyperlight_host/src/sandbox/uninitialized_evolve.rs renamed to src/hyperlight_host/src/sandbox/uninitialized_init.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use crate::sandbox::{HostSharedMemory, MemMgrWrapper};
4545
use crate::signal_handlers::setup_signal_handlers;
4646
use crate::{Result, Sandbox, UninitializedSandbox, log_then_return, new_error};
4747

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

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

278-
use super::evolve_impl_multi_use;
278+
use super::init_impl_multi_use;
279279
use crate::UninitializedSandbox;
280280
use crate::sandbox::uninitialized::GuestBinary;
281281

282282
#[test]
283-
fn test_evolve() {
283+
fn test_init() {
284284
let guest_bin_paths = vec![
285285
simple_guest_as_string().unwrap(),
286286
callback_guest_as_string().unwrap(),
@@ -289,7 +289,7 @@ mod tests {
289289
let u_sbox =
290290
UninitializedSandbox::new(GuestBinary::FilePath(guest_bin_path.clone()), None)
291291
.unwrap();
292-
evolve_impl_multi_use(u_sbox).unwrap();
292+
init_impl_multi_use(u_sbox).unwrap();
293293
}
294294
}
295295
}

0 commit comments

Comments
 (0)