Skip to content

Commit cfec9a3

Browse files
committed
fix error
1 parent a6745e4 commit cfec9a3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

hypervisor/cloudhypervisor/start.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ func (ch *CloudHypervisor) startOne(ctx context.Context, id string) error {
3636

3737
// Idempotent: skip if the VM process is already running regardless of
3838
// recorded state — prevents double-launch after a state-update failure.
39-
if err := ch.withRunningVM(id, func(_ int) error {
39+
if runErr := ch.withRunningVM(id, func(_ int) error {
4040
if rec.State != types.VMStateRunning {
4141
return ch.updateState(ctx, id, types.VMStateRunning)
4242
}
4343
return nil
44-
}); err == nil {
44+
}); runErr == nil {
4545
return nil // already running
4646
}
4747

0 commit comments

Comments
 (0)