Give Ctrl-] a grace period before force-stopping #45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding:
The console escape path asks the guest to stop and immediately force-stops the VM.
Problem:
stopVirtualMachineFromConsolecloses the serial input pipe, callsvmz_request_stop, then immediately callsvmz_force_stop.guestDidStopbefore force stop.Impact:
Ctrl-] can behave like a hard power-off even when the guest could shut down cleanly. That risks data loss once disks are added and makes the "trying to halt VM lifecycle" message misleading.
Suggested fix:
Make Ctrl-] enter a stopping state: request graceful stop, wait for the graceful-stop delegate or a short timeout, and only then call force stop. Print distinct messages for graceful request, timeout, and forced stop.
Relevant code:
src/vmz.zig:stopVirtualMachineFromConsole.lib/libvmz.swift:vmz_request_stopandvmz_force_stop.