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

Method validate_identifier

vmm/src/device_manager.rs:5223–5235  ·  view source on GitHub ↗
(&self, id: &Option<String>)

Source from the content-addressed store, hash-verified

5221 }
5222
5223 fn validate_identifier(&self, id: &Option<String>) -> DeviceManagerResult<()> {
5224 if let Some(id) = id {
5225 if id.starts_with("__") {
5226 return Err(DeviceManagerError::InvalidIdentifier(id.clone()));
5227 }
5228
5229 if self.device_tree.lock().unwrap().contains_key(id) {
5230 return Err(DeviceManagerError::IdentifierNotUnique(id.clone()));
5231 }
5232 }
5233
5234 Ok(())
5235 }
5236
5237 pub(crate) fn acpi_platform_addresses(&self) -> &AcpiPlatformAddresses {
5238 &self.acpi_platform_addresses

Callers 9

add_deviceMethod · 0.45
add_user_deviceMethod · 0.45
add_diskMethod · 0.45
add_fsMethod · 0.45
add_pmemMethod · 0.45
add_netMethod · 0.45
add_vdpaMethod · 0.45
add_vsockMethod · 0.45

Calls 2

cloneMethod · 0.45
contains_keyMethod · 0.45

Tested by

no test coverage detected