You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you create a Mac virtualized VM, you specify drive size in GB or MB:
But then the VM summary shows a different size:
Same thing when adding a new drive to an existing VM:
Throughout the project ByteCountFormatter … countStyle: .file is used:
Specifies display of file or storage byte counts. The actual behavior for this is platform-specific; on OS X 10.8, this uses the decimal style, but that may change over time.
So it’s using .decimal (1000 bytes are shown as 1 KB), but size calculations throughout the project use 1024 bytes in 1 KB (e.g. MiB and GiB, not MB and GB) for disk sizes.
I’ve tried to fix this myself, but there’s just too many places this propagates to. I suggest using Int64 bytes for disk sizes throughout the code. At the moment many places use size in MiB as Int, which can’t be converted to/from decimal MB without rounding errors.
I can make a PR, but I want to get some feedback first to make sure the issue and the effort are worth it.
Configuration
UTM Version: 4.0.3
macOS Version: 12.5.1
Mac Chip: M1
The text was updated successfully, but these errors were encountered:
It's the difference between megabytes (MB) which is 1000 and mibibytes (MiB) which is 1024. I try to make the distinction when possible but it may be missing in some places. Apple APIs for printing sizes all use MB but I made the decision to make configurations use MiB because that's what drive manufactures like to use as well.
I made the decision to make configurations use MiB because that's what drive manufactures like to use as well
But drive manufacturers use decimal MB, not binary MiB. That’s the reason Apple started doing this too. Users were complaining when they get a drive/product advertised in GB (decimal), but in the OS they were seeing smaller disk size (it said “GB” too but was binary). Only memory manufacturers use binary GiB and say “GB”.
When you create a Mac virtualized VM, you specify drive size in GB or MB:
But then the VM summary shows a different size:
Same thing when adding a new drive to an existing VM:
Throughout the project
ByteCountFormatter … countStyle: .file
is used:So it’s using
.decimal
(1000 bytes are shown as 1 KB), but size calculations throughout the project use 1024 bytes in 1 KB (e.g. MiB and GiB, not MB and GB) for disk sizes.I’ve tried to fix this myself, but there’s just too many places this propagates to. I suggest using
Int64
bytes for disk sizes throughout the code. At the moment many places use size in MiB asInt
, which can’t be converted to/from decimal MB without rounding errors.I can make a PR, but I want to get some feedback first to make sure the issue and the effort are worth it.
Configuration
The text was updated successfully, but these errors were encountered: