From 38021d637b20b397c355fadc0b980b31ca263f65 Mon Sep 17 00:00:00 2001 From: Jonathan Klimt Date: Tue, 17 Sep 2024 14:59:15 +0200 Subject: [PATCH] Fixed virt_to_phys test failing due to uninitialized GUEST_ADDRESS --- src/arch/x86_64/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/arch/x86_64/mod.rs b/src/arch/x86_64/mod.rs index c5d3db6e..a10452f4 100644 --- a/src/arch/x86_64/mod.rs +++ b/src/arch/x86_64/mod.rs @@ -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),