Skip to content

Commit

Permalink
Handle error state in waitForVMState
Browse files Browse the repository at this point in the history
If the virtualization framework returns an error state, vfkit currently
ignores it. This commit catches this error state, and returns an error
when it happens.
  • Loading branch information
cfergeau authored and praveenkumar committed Nov 4, 2022
1 parent e64a666 commit 52a4bc5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/vfkit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ func waitForVMState(vm *vz.VirtualMachine, state vz.VirtualMachineState) error {
if newState == state {
return nil
}
if newState == vz.VirtualMachineStateError {
return fmt.Errorf("hypervisor virtualization error")
}
case <-time.After(5 * time.Second):
return fmt.Errorf("timeout waiting for VM state %v", state)
}
Expand Down

0 comments on commit 52a4bc5

Please sign in to comment.