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

Method add_net

vmm/src/device_manager.rs:5100–5109  ·  view source on GitHub ↗
(&mut self, net_cfg: &mut NetConfig)

Source from the content-addressed store, hash-verified

5098 }
5099
5100 pub fn add_net(&mut self, net_cfg: &mut NetConfig) -> DeviceManagerResult<PciDeviceInfo> {
5101 self.validate_identifier(&net_cfg.pci_common.id)?;
5102
5103 if net_cfg.pci_common.iommu && !self.is_iommu_segment(net_cfg.pci_common.pci_segment) {
5104 return Err(DeviceManagerError::InvalidIommuHotplug);
5105 }
5106
5107 let device = self.make_virtio_net_device(net_cfg)?;
5108 self.hotplug_virtio_pci_device(device)
5109 }
5110
5111 pub fn add_vdpa(&mut self, vdpa_cfg: &mut VdpaConfig) -> DeviceManagerResult<PciDeviceInfo> {
5112 self.validate_identifier(&vdpa_cfg.pci_common.id)?;

Callers

nothing calls this directly

Calls 4

is_iommu_segmentMethod · 0.80
validate_identifierMethod · 0.45

Tested by

no test coverage detected