Skip to content
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

suggest for #167 #168

Merged
merged 3 commits into from
Nov 2, 2024
Merged

suggest for #167 #168

merged 3 commits into from
Nov 2, 2024

Conversation

Code-Hex
Copy link
Owner

@Code-Hex Code-Hex commented Nov 2, 2024

This PR is made for #167

The following logs are generated when the NBD server is stopped or restarted in the middle of a session.

$ ./virtualization -nbd-url=nbd://192.168.105.2:10809/disk0
2024/11/02 15:22:37 start VM is running
2024/11/02 15:22:37 NBD client connected with the server
2024/11/02 15:26:37 NBD client has been encountered error: Error Domain=VZErrorDomain Code=20001 Description="An error occurred during negotiation with the Network Block Device server. Failed to negotiate with server" UserInfo={
    NSLocalizedFailure = "An error occurred during negotiation with the Network Block Device server.";
    NSLocalizedFailureReason = "Failed to negotiate with server";
}
2024/11/02 15:26:39 NBD client has been encountered error: Error Domain=VZErrorDomain Code=20001 Description="An error occurred during negotiation with the Network Block Device server. Failed to negotiate with server" UserInfo={
    NSLocalizedFailure = "An error occurred during negotiation with the Network Block Device server.";
    NSLocalizedFailureReason = "Failed to negotiate with server";
}
2024/11/02 15:26:42 NBD client has been encountered error: Error Domain=VZErrorDomain Code=20001 Description="An error occurred during negotiation with the Network Block Device server. Failed to negotiate with server" UserInfo={
    NSLocalizedFailure = "An error occurred during negotiation with the Network Block Device server.";
    NSLocalizedFailureReason = "Failed to negotiate with server";
}
2024/11/02 15:26:47 NBD client has been encountered error: Error Domain=VZErrorDomain Code=20001 Description="An error occurred during negotiation with the Network Block Device server. Failed to negotiate with server" UserInfo={
    NSLocalizedFailure = "An error occurred during negotiation with the Network Block Device server.";
    NSLocalizedFailureReason = "Failed to negotiate with server";
}
2024/11/02 15:26:55 NBD client has been encountered error: Error Domain=VZErrorDomain Code=20001 Description="An error occurred during negotiation with the Network Block Device server. Failed to negotiate with server" UserInfo={
    NSLocalizedFailure = "An error occurred during negotiation with the Network Block Device server.";
    NSLocalizedFailureReason = "Failed to negotiate with server";
}
2024/11/02 15:27:12 NBD client connected with the server

lstocchi and others added 3 commits October 31, 2024 11:25
this adds support for the VZNetworkBlockDeviceStorageDeviceAttachmentDelegate to being able to listen to changes to a network block device attachment.

Signed-off-by: Luca Stocchi <[email protected]>
Signed-off-by: Luca Stocchi <[email protected]>
@Code-Hex Code-Hex changed the title suggested for#167 suggested for #167 Nov 2, 2024
Comment on lines +180 to 184
// StorageDevices return the list of storage device configuration configured in this virtual machine configuration.
// Return an empty array if no storage device configuration is set.
func (v *VirtualMachineConfiguration) StorageDevices() []StorageDeviceConfiguration {
return v.storageDeviceConfiguration
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took this approach because converting from raw pointers to a slice of interfaces and then to each concrete type is challenging. I plan to apply similar fixes to other similar methods in a separate PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah this was definitely the part I was missing as I didn't change it during my tests, thanks for the fix 🙏

@Code-Hex Code-Hex changed the title suggested for #167 suggest for #167 Nov 2, 2024
Copy link
Contributor

@lstocchi lstocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot @Code-Hex !!

Update: also tested with my vfkit use-case. Works like a charm 🚀

@Code-Hex
Copy link
Owner Author

Code-Hex commented Nov 2, 2024

@lstocchi Thanks your confirmation!

Let's merge this PR👌

@Code-Hex Code-Hex merged commit 46a19ee into main Nov 2, 2024
8 checks passed
@Code-Hex Code-Hex deleted the fix/delegate-pr branch November 2, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants