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 Nov 20, 2024
1 parent c9ab783 commit d4eb1e1
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 d4eb1e1

Please sign in to comment.