crosvm merge: updated create_disk_file arguments
Added argument "false" to create_disk_file. Need to add check to see if
file is sparse.
Bug: 233264075
Test: atest --test-mapping
Change-Id: I56fc84ead35e114ef2d59ca9805b0b8a1f7056fc
diff --git a/virtualizationservice/src/composite.rs b/virtualizationservice/src/composite.rs
index aee84cd..c9a68ac 100644
--- a/virtualizationservice/src/composite.rs
+++ b/virtualizationservice/src/composite.rs
@@ -121,7 +121,13 @@
/// This will work for raw, QCOW2, composite and Android sparse images.
fn get_partition_size(partition: &File, path: &Path) -> Result<u64, Error> {
// TODO: Use `context` once disk::Error implements std::error::Error.
- Ok(create_disk_file(partition.try_clone()?, MAX_NESTING_DEPTH, path)
- .map_err(|e| anyhow!("Failed to open partition image: {}", e))?
- .get_len()?)
+ // TODO: Add check for is_sparse_file
+ Ok(create_disk_file(
+ partition.try_clone()?,
+ /* is_sparse_file */ false,
+ MAX_NESTING_DEPTH,
+ path,
+ )
+ .map_err(|e| anyhow!("Failed to open partition image: {}", e))?
+ .get_len()?)
}