mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-01 11:05:46 +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.
|
/// Creates an in-kernel device.
|
||||||
///
|
///
|
||||||
/// See the documentation for `MSHV_CREATE_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
|
let device_fd = self
|
||||||
.fd
|
.fd
|
||||||
.create_device(device)
|
.create_device(device)
|
||||||
.map_err(|e| vm::HypervisorVmError::CreateDevice(e.into()))?;
|
.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,
|
flags: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
self.create_device(&mut vfio_dev)
|
Ok(Arc::new(self.create_device(&mut vfio_dev).map_err(
|
||||||
.map_err(|e| vm::HypervisorVmError::CreatePassthroughDevice(e.into()))
|
|e| vm::HypervisorVmError::CreatePassthroughDevice(e.into()),
|
||||||
|
)?))
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user