From 18d52869c5a702067a867fbd41160c0c94c6663b Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 16 Jul 2019 10:29:23 +0100 Subject: [PATCH] arch: x86_64: Make unit tests pass With the adoption for rust-vmm linux-loader crate some small changes were needed to update the unit tests to reflect this change: * configure_system now takes an extra parameter * the e820 entry structure comes from the linux-loader crate Signed-off-by: Rob Bradford --- arch/src/x86_64/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/src/x86_64/mod.rs b/arch/src/x86_64/mod.rs index 220a00211..ad31cb6f4 100644 --- a/arch/src/x86_64/mod.rs +++ b/arch/src/x86_64/mod.rs @@ -185,7 +185,7 @@ fn add_e820_entry( #[cfg(test)] mod tests { use super::*; - use arch_gen::x86::bootparam::e820entry; + use linux_loader::loader::bootparam::e820entry; #[test] fn regions_lt_4gb() { @@ -217,7 +217,7 @@ mod tests { fn test_system_configuration() { let no_vcpus = 4; let gm = GuestMemoryMmap::new(&vec![(GuestAddress(0), 0x10000)]).unwrap(); - let config_err = configure_system(&gm, GuestAddress(0), 0, 1); + let config_err = configure_system(&gm, GuestAddress(0), 0, 1, None); assert!(config_err.is_err()); assert_eq!( config_err.unwrap_err(), @@ -230,19 +230,19 @@ mod tests { let mem_size = 128 << 20; let arch_mem_regions = arch_memory_regions(mem_size); let gm = GuestMemoryMmap::new(&arch_mem_regions).unwrap(); - configure_system(&gm, GuestAddress(0), 0, no_vcpus).unwrap(); + configure_system(&gm, GuestAddress(0), 0, no_vcpus, None).unwrap(); // Now assigning some memory that is equal to the start of the 32bit memory hole. let mem_size = 3328 << 20; let arch_mem_regions = arch_memory_regions(mem_size); let gm = GuestMemoryMmap::new(&arch_mem_regions).unwrap(); - configure_system(&gm, GuestAddress(0), 0, no_vcpus).unwrap(); + configure_system(&gm, GuestAddress(0), 0, no_vcpus, None).unwrap(); // Now assigning some memory that falls after the 32bit memory hole. let mem_size = 3330 << 20; let arch_mem_regions = arch_memory_regions(mem_size); let gm = GuestMemoryMmap::new(&arch_mem_regions).unwrap(); - configure_system(&gm, GuestAddress(0), 0, no_vcpus).unwrap(); + configure_system(&gm, GuestAddress(0), 0, no_vcpus, None).unwrap(); } #[test]