MCPcopy Index your code
hub / github.com/cloud-hypervisor/cloud-hypervisor / validate

Method validate

vmm/src/config.rs:804–827  ·  view source on GitHub ↗
(&self, vm_config: &VmConfig)

Source from the content-addressed store, hash-verified

802 }
803
804 pub fn validate(&self, vm_config: &VmConfig) -> ValidationResult<()> {
805 let num_pci_segments = match &vm_config.platform {
806 Some(platform_config) => platform_config.num_pci_segments,
807 None => 1,
808 };
809
810 if self.pci_segment >= num_pci_segments {
811 return Err(ValidationError::InvalidPciSegment(self.pci_segment));
812 }
813
814 if self.mmio32_aperture_weight == 0 {
815 return Err(ValidationError::InvalidPciSegmentApertureWeight(
816 self.mmio32_aperture_weight,
817 ));
818 }
819
820 if self.mmio64_aperture_weight == 0 {
821 return Err(ValidationError::InvalidPciSegmentApertureWeight(
822 self.mmio64_aperture_weight,
823 ));
824 }
825
826 Ok(())
827 }
828}
829
830impl PlatformConfig {

Callers 15

parseMethod · 0.45
test_config_validationFunction · 0.45
vm_restoreMethod · 0.45
vm_add_deviceMethod · 0.45
vm_add_user_deviceMethod · 0.45
vm_add_diskMethod · 0.45
vm_add_fsMethod · 0.45
vm_add_pmemMethod · 0.45

Calls 15

validate_pci_device_idFunction · 0.85
newFunction · 0.85
containsMethod · 0.80
iterMethod · 0.80
total_sizeMethod · 0.80
is_emptyMethod · 0.45
lenMethod · 0.45
cloneMethod · 0.45
insertMethod · 0.45
removeMethod · 0.45
pushMethod · 0.45