Skip to content

Commit

Permalink
Fixed virt_to_phys test failing due to uninitialized GUEST_ADDRESS
Browse files Browse the repository at this point in the history
  • Loading branch information
jounathaen committed Dec 2, 2024
1 parent 3349f9b commit 38021d6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/arch/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,15 @@ mod tests {

#[test]
fn test_virt_to_phys() {
let _ = env_logger::builder()
.filter(None, log::LevelFilter::Trace)
.is_test(true)
.try_init();

use crate::vm::GUEST_ADDRESS;
let guest_address = GuestPhysAddr::new(0x11111000);
let _ = *GUEST_ADDRESS.get_or_init(|| guest_address);

let mem = MmapMemory::new(
0,
align_up!(MIN_PHYSMEM_SIZE * 2, 0x20_0000),
Expand Down

0 comments on commit 38021d6

Please sign in to comment.