clone: actually reclaim unallocated bytes (#974)

This commit is contained in:
Nikolay Edigaryev 2024-12-17 00:25:07 +04:00 committed by GitHub
parent 2d7615bdf8
commit e6a30b07e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -77,7 +77,7 @@ struct Clone: AsyncParsableCommand {
// So, once we clone the VM let's try to claim the rest of space for the VM to run without errors.
let unallocatedBytes = try sourceVM.sizeBytes() - sourceVM.allocatedSizeBytes()
if unallocatedBytes > 0 {
try Prune.reclaimIfNeeded(UInt64(), sourceVM)
try Prune.reclaimIfNeeded(UInt64(unallocatedBytes), sourceVM)
}
}, onCancel: {
try? FileManager.default.removeItem(at: tmpVMDir.baseURL)