vfio: Add a public function to retrive VFIO container

The VFIO container is the object needed to update the VFIO mapping
associated with a VFIO device. This patch allows the device manager
to have access to the VFIO container.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2019-10-07 10:20:35 -07:00
committed by Samuel Ortiz
parent 34bb31791b
commit 3598e603d5
2 changed files with 11 additions and 5 deletions
+2
View File
@@ -1006,6 +1006,8 @@ impl DeviceManager {
VfioDevice::new(&device_cfg.path, device_fd.clone(), vm_info.memory.clone())
.map_err(DeviceManagerError::VfioCreate)?;
let _vfio_container = vfio_device.get_container();
let mut vfio_pci_device = VfioPciDevice::new(vm_info.vm_fd, allocator, vfio_device)
.map_err(DeviceManagerError::VfioPciCreate)?;