Support for VirtualMachine.networkDevices
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 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 🙏
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...
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.
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()
@balajiv113 Do you have any idea about this method signature?
@Code-Hex you mean the signature of attachmentWasDisconnectedWithError ??
@balajiv113 Yes, I think this usage is may difficult 🤔 https://github.com/Code-Hex/vz/issues/118#issuecomment-1399531495
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.
@balajiv113 Thanks.
Yeah I think so :D
One thing to watch out is, we need to support both this and GUI delegate.