Skip to content

Commit 15cc79d

Browse files
committed
Rename MutiUseSandbox -> Sandbox
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
1 parent 5d8dffb commit 15cc79d

File tree

19 files changed

+85
-85
lines changed

19 files changed

+85
-85
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ It is followed by an example of a simple guest application using the Hyperlight
3535
```rust
3636
use std::thread;
3737

38-
use hyperlight_host::{MultiUseSandbox, UninitializedSandbox};
38+
use hyperlight_host::{Sandbox, UninitializedSandbox};
3939

4040
fn main() -> hyperlight_host::Result<()> {
4141
// Create an uninitialized sandbox with a guest binary
@@ -52,7 +52,7 @@ fn main() -> hyperlight_host::Result<()> {
5252
// Note: This function is unused by the guest code below, it's just here for demonstration purposes
5353

5454
// Initialize sandbox to be able to call host functions
55-
let mut multi_use_sandbox: MultiUseSandbox = uninitialized_sandbox.evolve()?;
55+
let mut multi_use_sandbox = uninitialized_sandbox.evolve()?;
5656

5757
// Call a function in the guest
5858
let message = "Hello, World! I am executing inside of a VM :)\n".to_string();

fuzz/fuzz_targets/guest_call.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ use std::sync::{Mutex, OnceLock};
2020

2121
use hyperlight_host::func::{ParameterValue, ReturnType};
2222
use hyperlight_host::sandbox::uninitialized::GuestBinary;
23-
use hyperlight_host::{MultiUseSandbox, UninitializedSandbox};
23+
use hyperlight_host::{Sandbox, UninitializedSandbox};
2424
use hyperlight_testing::simple_guest_for_fuzzing_as_string;
2525
use libfuzzer_sys::fuzz_target;
26-
static SANDBOX: OnceLock<Mutex<MultiUseSandbox>> = OnceLock::new();
26+
static SANDBOX: OnceLock<Mutex<Sandbox>> = OnceLock::new();
2727

2828
// This fuzz target tests all combinations of ReturnType and Parameters for `call_guest_function_by_name`.
2929
// For fuzzing efficiency, we create one Sandbox and reuse it for all fuzzing iterations.
@@ -36,7 +36,7 @@ fuzz_target!(
3636
)
3737
.unwrap();
3838

39-
let mu_sbox: MultiUseSandbox = u_sbox.evolve().unwrap();
39+
let mu_sbox: Sandbox = u_sbox.evolve().unwrap();
4040
SANDBOX.set(Mutex::new(mu_sbox)).unwrap();
4141
},
4242

fuzz/fuzz_targets/host_call.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ use std::sync::{Mutex, OnceLock};
2020

2121
use hyperlight_host::func::{ParameterValue, ReturnType};
2222
use hyperlight_host::sandbox::uninitialized::GuestBinary;
23-
use hyperlight_host::{HyperlightError, MultiUseSandbox, UninitializedSandbox};
23+
use hyperlight_host::{HyperlightError, Sandbox, UninitializedSandbox};
2424
use hyperlight_testing::simple_guest_for_fuzzing_as_string;
2525
use libfuzzer_sys::fuzz_target;
26-
static SANDBOX: OnceLock<Mutex<MultiUseSandbox>> = OnceLock::new();
26+
static SANDBOX: OnceLock<Mutex<Sandbox>> = OnceLock::new();
2727

2828
// This fuzz target tests all combinations of ReturnType and Parameters for `call_guest_function_by_name`.
2929
// For fuzzing efficiency, we create one Sandbox and reuse it for all fuzzing iterations.
@@ -35,7 +35,7 @@ fuzz_target!(
3535
)
3636
.unwrap();
3737

38-
let mu_sbox: MultiUseSandbox = u_sbox.evolve().unwrap();
38+
let mu_sbox: Sandbox = u_sbox.evolve().unwrap();
3939
SANDBOX.set(Mutex::new(mu_sbox)).unwrap();
4040
},
4141

fuzz/fuzz_targets/host_print.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
use std::sync::{Mutex, OnceLock};
44

55
use hyperlight_host::sandbox::uninitialized::GuestBinary;
6-
use hyperlight_host::{MultiUseSandbox, UninitializedSandbox};
6+
use hyperlight_host::{Sandbox, UninitializedSandbox};
77
use hyperlight_testing::simple_guest_for_fuzzing_as_string;
88
use libfuzzer_sys::{Corpus, fuzz_target};
99

10-
static SANDBOX: OnceLock<Mutex<MultiUseSandbox>> = OnceLock::new();
10+
static SANDBOX: OnceLock<Mutex<Sandbox>> = OnceLock::new();
1111

1212
// This fuzz target is used to test the HostPrint host function. We generate
1313
// an arbitrary ParameterValue::String, which is passed to the guest, which passes
@@ -21,7 +21,7 @@ fuzz_target!(
2121
)
2222
.unwrap();
2323

24-
let mu_sbox: MultiUseSandbox = u_sbox.evolve().unwrap();
24+
let mu_sbox: Sandbox = u_sbox.evolve().unwrap();
2525
SANDBOX.set(Mutex::new(mu_sbox)).unwrap();
2626
},
2727

src/hyperlight_component_util/src/host.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ fn emit_component<'a, 'b, 'c>(s: &'c mut State<'a, 'b>, wn: WitName, ct: &'c Com
356356
#(#exports)*
357357
}
358358
impl #ns::#r#trait for ::hyperlight_host::sandbox::UninitializedSandbox {
359-
type Exports<I: #ns::#import_trait + ::std::marker::Send> = #wrapper_name<I, ::hyperlight_host::sandbox::initialized_multi_use::MultiUseSandbox>;
359+
type Exports<I: #ns::#import_trait + ::std::marker::Send> = #wrapper_name<I, ::hyperlight_host::sandbox::sandbox::Sandbox>;
360360
fn instantiate<I: #ns::#import_trait + ::std::marker::Send + 'static>(mut self, i: I) -> Self::Exports<I> {
361361
let rts = register_host_functions(&mut self, i);
362362
let sb = self.evolve().unwrap();

src/hyperlight_host/benches/benchmarks.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
use criterion::{Criterion, criterion_group, criterion_main};
1818
use hyperlight_host::GuestBinary;
1919
use hyperlight_host::sandbox::{
20-
Callable, MultiUseSandbox, SandboxConfiguration, UninitializedSandbox,
20+
Callable, Sandbox, SandboxConfiguration, UninitializedSandbox,
2121
};
2222
use hyperlight_testing::simple_guest_as_string;
2323

@@ -26,7 +26,7 @@ fn create_uninit_sandbox() -> UninitializedSandbox {
2626
UninitializedSandbox::new(GuestBinary::FilePath(path), None).unwrap()
2727
}
2828

29-
fn create_multiuse_sandbox() -> MultiUseSandbox {
29+
fn create_multiuse_sandbox() -> Sandbox {
3030
create_uninit_sandbox().evolve().unwrap()
3131
}
3232

@@ -63,7 +63,7 @@ fn guest_call_benchmark(c: &mut Criterion) {
6363
.register("HostAdd", |a: i32, b: i32| Ok(a + b))
6464
.unwrap();
6565

66-
let mut multiuse_sandbox: MultiUseSandbox = uninitialized_sandbox.evolve().unwrap();
66+
let mut multiuse_sandbox: Sandbox = uninitialized_sandbox.evolve().unwrap();
6767

6868
b.iter(|| {
6969
multiuse_sandbox

src/hyperlight_host/examples/func_ctx/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use hyperlight_host::sandbox::UninitializedSandbox;
1919
use hyperlight_testing::simple_guest_as_string;
2020

2121
fn main() {
22-
// create a new `MultiUseSandbox` configured to run the `simpleguest.exe`
22+
// create a new `Sandbox` configured to run the `simpleguest.exe`
2323
// test guest binary
2424
let path = simple_guest_as_string().unwrap();
2525
let mut sbox = UninitializedSandbox::new(GuestBinary::FilePath(path), None)

src/hyperlight_host/examples/guest-debugging/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::thread;
1919
use hyperlight_host::sandbox::SandboxConfiguration;
2020
#[cfg(gdb)]
2121
use hyperlight_host::sandbox::config::DebugInfo;
22-
use hyperlight_host::{MultiUseSandbox, UninitializedSandbox};
22+
use hyperlight_host::{Sandbox, UninitializedSandbox};
2323

2424
/// Build a sandbox configuration that enables GDB debugging when the `gdb` feature is enabled.
2525
fn get_sandbox_cfg() -> Option<SandboxConfiguration> {
@@ -68,8 +68,8 @@ fn main() -> hyperlight_host::Result<()> {
6868
// Note: This function is unused, it's just here for demonstration purposes
6969

7070
// Initialize sandboxes to be able to call host functions
71-
let mut multi_use_sandbox_dbg: MultiUseSandbox = uninitialized_sandbox_dbg.evolve()?;
72-
let mut multi_use_sandbox: MultiUseSandbox = uninitialized_sandbox.evolve()?;
71+
let mut multi_use_sandbox_dbg: Sandbox = uninitialized_sandbox_dbg.evolve()?;
72+
let mut multi_use_sandbox: Sandbox = uninitialized_sandbox.evolve()?;
7373

7474
// Call guest function
7575
let message =

src/hyperlight_host/examples/hello-world/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ limitations under the License.
1616
#![allow(clippy::disallowed_macros)]
1717
use std::thread;
1818

19-
use hyperlight_host::{MultiUseSandbox, UninitializedSandbox};
19+
use hyperlight_host::{Sandbox, UninitializedSandbox};
2020

2121
fn main() -> hyperlight_host::Result<()> {
2222
// Create an uninitialized sandbox with a guest binary
@@ -35,7 +35,7 @@ fn main() -> hyperlight_host::Result<()> {
3535
// Note: This function is unused, it's just here for demonstration purposes
3636

3737
// Initialize sandbox to be able to call host functions
38-
let mut multi_use_sandbox: MultiUseSandbox = uninitialized_sandbox.evolve()?;
38+
let mut multi_use_sandbox: Sandbox = uninitialized_sandbox.evolve()?;
3939

4040
// Call guest function
4141
let message = "Hello, World! I am executing inside of a VM :)\n".to_string();

src/hyperlight_host/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub use error::HyperlightError;
7474
/// Re-export for `MemMgrWrapper` type
7575
/// A sandbox that can call be used to make multiple calls to guest functions,
7676
/// and otherwise reused multiple times
77-
pub use sandbox::MultiUseSandbox;
77+
pub use sandbox::Sandbox;
7878
/// The re-export for the `UninitializedSandbox` type
7979
pub use sandbox::UninitializedSandbox;
8080
/// The re-export for the `is_hypervisor_present` type

0 commit comments

Comments
 (0)