Skip to content

Commit

Permalink
vz: use DiskImageCachingModeCached (rumored to fix disk corruption on…
Browse files Browse the repository at this point in the history
… ARM)

Switch away from `DiskImageCachingModeAutomatic` to `DiskImageCachingModeCached`,
as this is rumored to fix disk corruption on ARM
(See recent comments in utmapp/UTM issue 4840)

Expected to fix issue 1957 (for vz)

Signed-off-by: Akihiro Suda <[email protected]>
  • Loading branch information
AkihiroSuda committed Nov 24, 2023
1 parent 70d0177 commit 3cda012
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/vz/vm_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,12 @@ func attachDisks(driver *driver.BaseDriver, vmConfig *vz.VirtualMachineConfigura
if err = validateDiskFormat(diffDiskPath); err != nil {
return err
}
diffDiskAttachment, err := vz.NewDiskImageStorageDeviceAttachmentWithCacheAndSync(diffDiskPath, false, vz.DiskImageCachingModeAutomatic, vz.DiskImageSynchronizationModeFsync)
// DiskImageCachingModeCached is chosen to avoid disk corruption on ARM:
// - https://github.com/utmapp/UTM/issues/4840#issuecomment-1824340975
// - https://github.com/utmapp/UTM/issues/4840#issuecomment-1824542732
//
// Eventually we may bring this back to DiskImageCachingModeAutomatic when the corruption issue is properly fixed.
diffDiskAttachment, err := vz.NewDiskImageStorageDeviceAttachmentWithCacheAndSync(diffDiskPath, false, vz.DiskImageCachingModeCached, vz.DiskImageSynchronizationModeFsync)
if err != nil {
return err
}
Expand Down

0 comments on commit 3cda012

Please sign in to comment.