mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
devices: Implement DMA for fw_cfg device
We pass a reference to the guest memory when we create the device in DeviceManager. This allows us to access the guest memory for DMA. Signed-off-by: Alex Orozco <alexorozco@google.com>
This commit is contained in:
@@ -1477,7 +1477,9 @@ impl DeviceManager {
|
||||
|
||||
#[cfg(feature = "fw_cfg")]
|
||||
pub fn create_fw_cfg_device(&mut self) -> Result<(), DeviceManagerError> {
|
||||
let fw_cfg = Arc::new(Mutex::new(devices::legacy::FwCfg::new()));
|
||||
let fw_cfg = Arc::new(Mutex::new(devices::legacy::FwCfg::new(
|
||||
self.memory_manager.lock().as_ref().unwrap().guest_memory(),
|
||||
)));
|
||||
|
||||
self.fw_cfg = Some(fw_cfg.clone());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user