We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
AttachVhd
AttachVirtualDiskFlagPermanentLifetime
With the AttachVirtualDiskFlagNone, AttachVirtualDisk won't actually attach disk. Use AttachVirtualDiskFlagPermanentLifetime works fine
AttachVirtualDiskFlagNone
AttachVirtualDisk
func AttachVhd(path string) (err error) { handle, err := OpenVirtualDisk( path, VirtualDiskAccessNone, OpenVirtualDiskFlagCachedIO|OpenVirtualDiskFlagIgnoreRelativeParentLocator, ) if err != nil { return err } defer syscall.CloseHandle(handle) //nolint:errcheck params := AttachVirtualDiskParameters{Version: 2} if err := AttachVirtualDisk( handle, AttachVirtualDiskFlagNone, ¶ms, ); err != nil { return fmt.Errorf("failed to attach virtual disk: %w", err) } return nil }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
With the
AttachVirtualDiskFlagNone
,AttachVirtualDisk
won't actually attach disk. UseAttachVirtualDiskFlagPermanentLifetime
works fineThe text was updated successfully, but these errors were encountered: