mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-04 19:11:11 +00:00
hypervisor: mshv: create_device returns DeviceFd directly
This aligns with KVM's code. No functional change. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
c5e966c972
commit
eca6609dbb
@ -918,12 +918,12 @@ impl MshvVm {
|
||||
/// Creates an in-kernel device.
|
||||
///
|
||||
/// See the documentation for `MSHV_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)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1117,8 +1117,9 @@ impl vm::Vm for MshvVm {
|
||||
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()),
|
||||
)?))
|
||||
}
|
||||
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user