When macOS shut down or QEMU quit on its own, reims-go had issued no stop, so it only saw the VM stopped at its next steady poll, up to 5 s later. Now pollVMs waits on each running QEMU process handle and wakes the poll the moment the process exits; a PID is only waited on while it names qemu-system-x86_64.exe, so a reused PID is not mistaken for the VM. Measured with macos-tahoe and QMP quit: the window got the state change 51 ms after QEMU exited. Off Windows the steady poll remains. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
408 B
Go
17 lines
408 B
Go
//go:build !windows
|
|
|
|
package host
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
)
|
|
|
|
// ErrOtherProcess: the PID now names a process other than the one expected.
|
|
var ErrOtherProcess = errors.New("pid belongs to another process")
|
|
|
|
// WaitProcessExit is not implemented off Windows; callers fall back to polling.
|
|
func WaitProcessExit(ctx context.Context, pid uint32, imageSuffix string) error {
|
|
return errors.ErrUnsupported
|
|
}
|