diff --git a/src/transport/x86_64.rs b/src/transport/x86_64.rs index 19b6b044..979d25f7 100644 --- a/src/transport/x86_64.rs +++ b/src/transport/x86_64.rs @@ -13,10 +13,7 @@ use super::{ }, DeviceStatus, DeviceType, Transport, }; -use crate::{ - hal::{Hal, PhysAddr}, - Error, -}; +use crate::{hal::PhysAddr, Error}; pub use cam::HypCam; use hypercalls::HypIoRegion; use zerocopy::{FromBytes, Immutable, IntoBytes}; @@ -53,7 +50,7 @@ pub struct HypPciTransport { impl HypPciTransport { /// Constructs a new x86-64 pKVM PCI VirtIO transport for the given device function on the given /// PCI root controller. - pub fn new( + pub fn new( root: &mut PciRoot, device_function: DeviceFunction, ) -> Result { @@ -114,7 +111,7 @@ impl HypPciTransport { } } - let common_cfg = get_bar_region::( + let common_cfg = get_bar_region::( root, device_function, &common_cfg.ok_or(VirtioPciError::MissingCommonConfig)?, @@ -126,16 +123,16 @@ impl HypPciTransport { notify_off_multiplier, )); } - let notify_region = get_bar_region::(root, device_function, ¬ify_cfg)?; + let notify_region = get_bar_region::(root, device_function, ¬ify_cfg)?; - let isr_status = get_bar_region::( + let isr_status = get_bar_region::( root, device_function, &isr_cfg.ok_or(VirtioPciError::MissingIsrConfig)?, )?; let config_space = if let Some(device_cfg) = device_cfg { - Some(get_bar_region::( + Some(get_bar_region::( root, device_function, &device_cfg, @@ -286,7 +283,7 @@ impl Transport for HypPciTransport { } } -fn get_bar_region( +fn get_bar_region( root: &mut PciRoot, device_function: DeviceFunction, struct_info: &VirtioCapabilityInfo,