Skip to content

Commit 44fb300

Browse files
committed
License header + cargo fmt
Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent ce91a4c commit 44fb300

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

src/hyperlight_host/src/hypervisor/gdb/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use x86_64_target::HyperlightSandboxTarget;
3434
use super::InterruptHandle;
3535
use super::regs::CommonRegisters;
3636
use crate::hypervisor::regs::CommonFpu;
37-
use crate::hypervisor::vm::Vm;
37+
use crate::hypervisor::virtual_machine::VirtualMachine;
3838
use crate::mem::layout::SandboxMemoryLayout;
3939
use crate::mem::memory_region::MemoryRegion;
4040
use crate::mem::mgr::SandboxMemoryManager;
@@ -277,7 +277,7 @@ pub(crate) enum DebugResponse {
277277

278278
/// Trait for VMs that support debugging capabilities.
279279
/// This extends the base Hypervisor trait with GDB-specific functionality.
280-
pub(crate) trait DebuggableVm: Vm {
280+
pub(crate) trait DebuggableVm: VirtualMachine {
281281
/// Translates a guest virtual address to a guest physical address
282282
fn translate_gva(&self, gva: u64) -> crate::Result<u64>;
283283

src/hyperlight_host/src/hypervisor/hyperlight_vm.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,18 @@ use crate::hypervisor::LinuxInterruptHandle;
4141
#[cfg(crashdump)]
4242
use crate::hypervisor::crashdump;
4343
use crate::hypervisor::regs::CommonSpecialRegisters;
44-
use crate::hypervisor::virtual_machine::HypervisorType;
4544
#[cfg(not(gdb))]
4645
use crate::hypervisor::virtual_machine::VirtualMachine;
47-
use crate::hypervisor::virtual_machine::get_available_hypervisor;
4846
#[cfg(kvm)]
4947
use crate::hypervisor::virtual_machine::kvm::KvmVm;
5048
#[cfg(mshv3)]
5149
use crate::hypervisor::virtual_machine::mshv::MshvVm;
5250
#[cfg(target_os = "windows")]
5351
use crate::hypervisor::virtual_machine::whp::WhpVm;
52+
use crate::hypervisor::virtual_machine::{HypervisorType, VmExit, get_available_hypervisor};
5453
#[cfg(target_os = "windows")]
5554
use crate::hypervisor::wrappers::HandleWrapper;
56-
use crate::hypervisor::{
57-
InterruptHandle, InterruptHandleImpl, get_max_log_level, virtual_machine::VmExit,
58-
};
55+
use crate::hypervisor::{InterruptHandle, InterruptHandleImpl, get_max_log_level};
5956
use crate::mem::memory_region::{MemoryRegion, MemoryRegionFlags, MemoryRegionType};
6057
use crate::mem::mgr::SandboxMemoryManager;
6158
use crate::mem::ptr::{GuestPtr, RawPtr};

src/hyperlight_host/src/hypervisor/virtual_machine/mod.rs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
1+
/*
2+
Copyright 2025 The Hyperlight Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
use std::fmt::Debug;
18+
use std::sync::OnceLock;
19+
120
use tracing::{Span, instrument};
221

322
use crate::Result;
423
use crate::hypervisor::regs::{CommonFpu, CommonRegisters, CommonSpecialRegisters};
524
use crate::mem::memory_region::MemoryRegion;
6-
use std::fmt::Debug;
725

826
#[cfg(kvm)]
927
/// Functionality to manipulate KVM-based virtual machines
@@ -14,8 +32,6 @@ pub(crate) mod mshv;
1432
#[cfg(target_os = "windows")]
1533
pub(crate) mod whp;
1634

17-
use std::sync::OnceLock;
18-
1935
static AVAILABLE_HYPERVISOR: OnceLock<Option<HypervisorType>> = OnceLock::new();
2036

2137
/// Returns which type of hypervisor is available, if any

0 commit comments

Comments
 (0)