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

Function add_to_config

vmm/src/config.rs:423–429  ·  view source on GitHub ↗
(items: &mut Option<Vec<T>>, item: T)

Source from the content-addressed store, hash-verified

421type ValidationResult<T> = std::result::Result<T, ValidationError>;
422
423pub fn add_to_config<T>(items: &mut Option<Vec<T>>, item: T) {
424 if let Some(items) = items {
425 items.push(item);
426 } else {
427 *items = Some(vec![item]);
428 }
429}
430
431/// Check that the PCI device supplied is neither out of range nor does
432/// it use any reserved device ID.

Callers 15

vm_add_deviceMethod · 0.85
vm_add_user_deviceMethod · 0.85
vm_add_diskMethod · 0.85
vm_add_fsMethod · 0.85
vm_add_pmemMethod · 0.85
vm_add_netMethod · 0.85
vm_add_vdpaMethod · 0.85
add_deviceMethod · 0.85
add_user_deviceMethod · 0.85
add_diskMethod · 0.85
add_fsMethod · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected