applehv: machine tests for stop and rm
change behaviour of stopped a stopped/exited machine to match qemu in that stopping a stopped machine is NOT an error. add condition to machine rm where rm is not run twice due to a logic error [NO NEW TESTS NEEDED] Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
		
							parent
							
								
									94f47d6f66
								
							
						
					
					
						commit
						2ff43429f7
					
				|  | @ -681,7 +681,7 @@ func (m *MacMachine) Stop(name string, opts machine.StopOptions) error { | |||
| 	} | ||||
| 
 | ||||
| 	if vmState != machine.Running { | ||||
| 		return machine.ErrWrongState | ||||
| 		return nil | ||||
| 	} | ||||
| 
 | ||||
| 	defer func() { | ||||
|  |  | |||
|  | @ -94,10 +94,11 @@ func (vf *VfkitHelper) stop(force, wait bool) error { | |||
| 		if err := vf.stateChange(define.HardStop); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
| 	} else { | ||||
| 		if err := vf.stateChange(define.Stop); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
| 	if !wait { | ||||
| 		return nil | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue