Merge "Revert "Match create_composite_disk to crosvm updates"" am: 51345a7c8b

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Virtualization/+/2042243

Change-Id: Ie6207c056f84f984d8138b82ca460bb42accfc60
diff --git a/virtualizationservice/src/composite.rs b/virtualizationservice/src/composite.rs
index aee84cd..cb814f3 100644
--- a/virtualizationservice/src/composite.rs
+++ b/virtualizationservice/src/composite.rs
@@ -94,8 +94,8 @@
                 .as_ref()
                 .try_clone()
                 .context("Failed to clone partition image file descriptor")?;
+            let size = get_partition_size(&file)?;
             let path = fd_path_for_file(&file);
-            let size = get_partition_size(&file, &path)?;
             files.push(file);
 
             Ok(PartitionInfo {
@@ -119,9 +119,9 @@
 /// Find the size of the partition image in the given file by parsing the header.
 ///
 /// This will work for raw, QCOW2, composite and Android sparse images.
-fn get_partition_size(partition: &File, path: &Path) -> Result<u64, Error> {
+fn get_partition_size(partition: &File) -> Result<u64, Error> {
     // TODO: Use `context` once disk::Error implements std::error::Error.
-    Ok(create_disk_file(partition.try_clone()?, MAX_NESTING_DEPTH, path)
+    Ok(create_disk_file(partition.try_clone()?, MAX_NESTING_DEPTH)
         .map_err(|e| anyhow!("Failed to open partition image: {}", e))?
         .get_len()?)
 }