mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: fix bug with wrong lock granularity for image container formats
The lock must always correspond to the physical size of the file, everything else doesn't make sense. Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
committed by
Rob Bradford
parent
603b5e862c
commit
9569809d4c
@@ -773,7 +773,7 @@ impl Block {
|
||||
// TODO In future, we could add a `lock_granularity=` configuration to the CLI.
|
||||
// For now, we stick to QEMU behavior.
|
||||
fn lock_granularity(&mut self) -> LockGranularity {
|
||||
self.disk_image.logical_size().map_or_else(
|
||||
self.disk_image.physical_size().map_or_else(
|
||||
// use a safe fallback
|
||||
|e| {
|
||||
let fallback = LockGranularity::WholeFile;
|
||||
|
||||
Reference in New Issue
Block a user