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

Support for VirtualMachine.networkDevices #118

Open
balajiv113 opened this issue Jan 10, 2023 · 9 comments
Open

Support for VirtualMachine.networkDevices #118

balajiv113 opened this issue Jan 10, 2023 · 9 comments
Labels
enhancement New feature or request

Comments

@balajiv113
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently there are some network issues. Mostly this happens in cases where system is put on sleep. This support help to debug network issues better and also mostly resolve by reconnecting

Describe the solution you'd like
Support for VirtualMachine.networkDevices. With this support, we can use attachmentWasDisconnectedWithError to understand what went wrong and also this provides support for updating the network attachment on the fly.

Additional context
https://developer.apple.com/documentation/virtualization/vzvirtualmachinedelegate/3869835-virtualmachine?language=objc
https://developer.apple.com/documentation/virtualization/vznetworkdevice/3869833-attachment?language=objc

@balajiv113 balajiv113 added the enhancement New feature or request label Jan 10, 2023
@Code-Hex
Copy link
Owner

@balajiv113 Thanks for creating a new issue!
I didn't know that! Thanks.

I will work for it in Sat (JST) because I'm a little busy 🙏

@Code-Hex
Copy link
Owner

Code-Hex commented Jan 22, 2023

I'm sorry too late.

This is a delegate method which meant that the method will be held by a different object than VZVirtualMachine, which has VZVirtualMachine as a property. So I may take a little time to design...

@Code-Hex
Copy link
Owner

Note that this understanding is wrong. They are not dependent on each other.

Support for VirtualMachine.networkDevices. With this support, we can use attachmentWasDisconnectedWithError to understand

Here is a good example. I use the delegate to use the GUI; the object we specify for delegate is not a VZVirtualMachine object.

@Code-Hex
Copy link
Owner

This is one idea, although the long method names are annoying.

vm, err := vz.NewVirtualMachine(config)
if err != nil {
  return err
}

vm.WatchNetworkDeviceAttachmentWasDisconnected(func(networkDevice *vz.NetworkDevice, err error) {
  // Do something here...
})

vm.Start()

@Code-Hex
Copy link
Owner

@balajiv113 Do you have any idea about this method signature?

@balajiv113
Copy link
Contributor Author

@Code-Hex you mean the signature of attachmentWasDisconnectedWithError ??

@Code-Hex
Copy link
Owner

@balajiv113 Yes, I think this usage is may difficult 🤔
#118 (comment)

@balajiv113
Copy link
Contributor Author

True but this was better compared to creating delegate object as a whole in go.

This will be extensible as well when new methods comes up as far as i see. Internally we will manage the delegate and users doesn't have to know much about it.

One thing to watch out is, we need to support both this and GUI delegate.

@Code-Hex
Copy link
Owner

@balajiv113 Thanks.

Yeah I think so :D

One thing to watch out is, we need to support both this and GUI delegate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants