Releases the advisory lock held for the corresponding disk image.
(&mut self)
| 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 { |
no test coverage detected