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

Method unlock_image

virtio-devices/src/block.rs:966–978  ·  view source on GitHub ↗

Releases the advisory lock held for the corresponding disk image.

(&mut self)

Source from the content-addressed store, hash-verified

964
965 /// Releases the advisory lock held for the corresponding disk image.
966 pub fn unlock_image(&mut self) -> Result<()> {
967 let granularity = self.lock_granularity();
968
969 // It is very unlikely that this fails;
970 // Should we remove the Result to simplify the error propagation on
971 // higher levels?
972 let fd = self.disk_image.fd();
973 fcntl::clear_lock(&fd, granularity).map_err(|error| Error::LockDiskImage {
974 path: self.disk_path.clone(),
975 error,
976 lock_type: LockType::Unlock,
977 })
978 }
979
980 fn state(&self) -> BlockState {
981 BlockState {

Callers 1

release_disk_locksMethod · 0.80

Calls 4

clear_lockFunction · 0.85
lock_granularityMethod · 0.80
fdMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected