vbox: fix issue where could not restart a stopped instance

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett 2015-03-19 09:53:40 -04:00
parent 703ea4b497
commit e1a35bb267
No known key found for this signature in database
GPG Key ID: A519480096146526
1 changed files with 7 additions and 5 deletions

12
host.go
View File

@ -643,12 +643,14 @@ func (h *Host) Kill() error {
}
func (h *Host) Restart() error {
if err := h.Stop(); err != nil {
return err
}
if h.MachineInState(state.Running)() {
if err := h.Stop(); err != nil {
return err
}
if err := utils.WaitFor(h.MachineInState(state.Stopped)); err != nil {
return err
if err := utils.WaitFor(h.MachineInState(state.Stopped)); err != nil {
return err
}
}
if err := h.Start(); err != nil {