-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for init disk with cache and sync mode #117
Conversation
8697647
to
5b6792f
Compare
I confim that the workaround in makes a massive positive performance difference for mounting/importing a database, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. almost LGTM
storage.go
Outdated
DiskImageSynchronizationModeFull DiskImageSynchronizationMode = 1 | ||
DiskImageSynchronizationModeFsync DiskImageSynchronizationMode = 2 | ||
DiskImageSynchronizationModeNone DiskImageSynchronizationMode = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a matter of taste. I like
DiskImageSynchronizationModeFull DiskImageSynchronizationMode = 1 | |
DiskImageSynchronizationModeFsync DiskImageSynchronizationMode = 2 | |
DiskImageSynchronizationModeNone DiskImageSynchronizationMode = 3 | |
DiskImageSynchronizationModeFull DiskImageSynchronizationMode = 1 + iota | |
DiskImageSynchronizationModeFsync DiskImageSynchronizationMode | |
DiskImageSynchronizationModeNone DiskImageSynchronizationMode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
// | ||
// This is only supported on macOS 12 and newer, error will | ||
// be returned on older versions. | ||
func NewDiskImageStorageDeviceAttachmentWithCacheAndSync(diskPath string, readOnly bool, cachingMode DiskImageCachingMode, syncMode DiskImageSynchronizationMode) (*DiskImageStorageDeviceAttachment, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add tests here?
This is to check availability.
Line 109 in 23eeede
t.Run("macOS 12", func(t *testing.T) { |
This one is for checking actually working or not. (It's OK only check exists disk path)
https://github.com/Code-Hex/vz/blob/main/storage_test.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done the first test, about second test we don't have disk path from configuration i believe.
I can add a test to create disk (with cache and sync mode) and start vm and see if its running. Is that okay ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@balajiv113 Sure! Thanks!
@rfay If you have any information on what to enable in the Linux Kernel Config (like I'm writing wiki that consolidates all this information. |
I'm afraid I'm pretty ignorant; just tried out @balajiv113 's comment/workaround and was super happy with the result. |
@Code-Hex DiskImageSynchronizationModeFsync and DiskImageSynchronizationModeNone performing more or less same. |
@balajiv113 I see. Thank you for your comments! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f255afa
to
dc1aa19
Compare
Signed-off-by: Balaji Vijayakumar <kuttibalaji.v6@gmail.com>
Updated PR with verified commit as well :) |
Which issue(s) this PR fixes:
Fixes #106
Additional documentation