MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / create_device

Method create_device

hypervisor/src/kvm/mod.rs:585–591  ·  view source on GitHub ↗

Creates an emulated device in the kernel. See the documentation for `KVM_CREATE_DEVICE`.

(&self, device: &mut CreateDevice)

Source from the content-addressed store, hash-verified

583 ///
584 /// See the documentation for `KVM_CREATE_DEVICE`.
585 fn create_device(&self, device: &mut CreateDevice) -> vm::Result<vfio_ioctls::VfioDeviceFd> {
586 let device_fd = self
587 .fd
588 .create_device(device)
589 .map_err(|e| vm::HypervisorVmError::CreateDevice(e.into()))?;
590 Ok(VfioDeviceFd::new_from_kvm(device_fd))
591 }
592 /// Checks if a particular `Cap` is available.
593 pub fn check_extension(&self, c: Cap) -> bool {
594 self.fd.check_extension(c)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected