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

Method try_lock_disks

vmm/src/device_manager.rs:2597–2604  ·  view source on GitHub ↗

Tries to acquire advisory locks for all disk images. This should only be called when a VM boots or VM state is restored. For live-migration, the locks must be released on the destination side before they are acquired again by the receiving side.

(&self)

Source from the content-addressed store, hash-verified

2595 /// For live-migration, the locks must be released on the destination side
2596 /// before they are acquired again by the receiving side.
2597 pub fn try_lock_disks(&self) -> DeviceManagerResult<()> {
2598 for dev in &self.block_devices {
2599 let mut dev = dev.lock().unwrap();
2600 dev.try_lock_image()
2601 .map_err(DeviceManagerError::DiskLockError)?;
2602 }
2603 Ok(())
2604 }
2605
2606 /// Release all advisory locks held for the disk images.
2607 ///

Callers 2

bootMethod · 0.80
restoreMethod · 0.80

Calls 1

try_lock_imageMethod · 0.80

Tested by

no test coverage detected