-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
example/gui-linux does not exit when vm.Stop()
is used
#150
Labels
bug
Something isn't working
Comments
cfergeau
added a commit
to cfergeau/vz
that referenced
this issue
Nov 10, 2023
The GUI code in virtualization_view.m is notified when there was a guest initiated shutdown ('guestDidStopVirtualMachine') and when there was a virtualization error ('didStopWithError'). When calling Stop(), the VM is forcefully stopped (similar to pulling the plug on real hardware). This action is neither a guest initiated shutdown, nor a virtualization error, so the GUI code does not catch it. This means after calling vm.Stop(), the GUI main loop will keep running, and the application using Code-Hex/vz will never exit. This commit fixes this by adding an observer for VM state changes, and by calling 'terminate' when the VM state becomes 'stopped' or 'error'. This fixes Code-Hex#150
cfergeau
added a commit
to cfergeau/vz
that referenced
this issue
Jan 23, 2024
The GUI code in virtualization_view.m is notified when there was a guest initiated shutdown ('guestDidStopVirtualMachine') and when there was a virtualization error ('didStopWithError'). When calling Stop(), the VM is forcefully stopped (similar to pulling the plug on real hardware). This action is neither a guest initiated shutdown, nor a virtualization error, so the GUI code does not catch it. This means after calling vm.Stop(), the GUI main loop will keep running, and the application using Code-Hex/vz will never exit. This commit fixes this by adding an observer for VM state changes, and by calling 'terminate' when the VM state becomes 'stopped' or 'error'. This fixes Code-Hex#150
cfergeau
added a commit
to cfergeau/vz
that referenced
this issue
Mar 29, 2024
The GUI code in virtualization_view.m is notified when there was a guest initiated shutdown ('guestDidStopVirtualMachine') and when there was a virtualization error ('didStopWithError'). When calling Stop(), the VM is forcefully stopped (similar to pulling the plug on real hardware). This action is neither a guest initiated shutdown, nor a virtualization error, so the GUI code does not catch it. This means after calling vm.Stop(), the GUI main loop will keep running, and the application using Code-Hex/vz will never exit. This commit fixes this by adding an observer for VM state changes, and by calling 'terminate' when the VM state becomes 'stopped' or 'error'. This fixes Code-Hex#150
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The GUI code in virtualization_view.m is notified when there was a guest initiated shutdown ('guestDidStopVirtualMachine') and when there was a virtualization error ('didStopWithError').
When calling Stop(), the VM is forcefully stopped (similar to pulling the plug on real hardware). This action is neither a guest initiated shutdown, nor a virtualization error, so the GUI code does not catch it. This means after calling vm.Stop(), the GUI main loop will keep running, and the application using Code-Hex/vz will never exit.
The branch https://github.com/cfergeau/vz/tree/hardstop-gui has a fix for this bug. It adds an observer for VM state changes, and calls 'terminate' when the VM state becomes 'stopped' or 'error'.
I can file a PR if this approach is acceptable to you, or I can explore a different fix if needed.
This was initially reported as crc-org/vfkit#67
To Reproduce
Steps to reproduce the behavior:
(this change is made in my branch https://github.com/cfergeau/vz/tree/hardstop-gui)
Expected behavior
The process stops after 10 seconds.
Environment that you use to compile (please complete the following information):
sw_vers | pbcopy
]uname -m | pbcopy
]arm64
go version | pbcopy
]go version go1.20.5 darwin/arm64
The text was updated successfully, but these errors were encountered: