mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
hypervisor: aarch64: use KVM DeviceFd in GIC code
The code is obviously KVM only. We don't need to use dyn Device there. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -319,12 +319,12 @@ impl KvmVm {
|
||||
/// Creates an emulated device in the kernel.
|
||||
///
|
||||
/// See the documentation for `KVM_CREATE_DEVICE`.
|
||||
fn create_device(&self, device: &mut CreateDevice) -> vm::Result<Arc<dyn device::Device>> {
|
||||
fn create_device(&self, device: &mut CreateDevice) -> vm::Result<DeviceFd> {
|
||||
let device_fd = self
|
||||
.fd
|
||||
.create_device(device)
|
||||
.map_err(|e| vm::HypervisorVmError::CreateDevice(e.into()))?;
|
||||
Ok(Arc::new(device_fd))
|
||||
Ok(device_fd)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -694,8 +694,9 @@ impl vm::Vm for KvmVm {
|
||||
flags: 0,
|
||||
};
|
||||
|
||||
self.create_device(&mut vfio_dev)
|
||||
.map_err(|e| vm::HypervisorVmError::CreatePassthroughDevice(e.into()))
|
||||
Ok(Arc::new(self.create_device(&mut vfio_dev).map_err(
|
||||
|e| vm::HypervisorVmError::CreatePassthroughDevice(e.into()),
|
||||
)?))
|
||||
}
|
||||
///
|
||||
/// Start logging dirty pages
|
||||
|
||||
Reference in New Issue
Block a user