@@ -803,7 +803,7 @@ func (ctx kvmContext) Start(domainName string) error {
803
803
return logError ("failed to start domain that is stopped %v" , err )
804
804
}
805
805
806
- if status , err := getQemuStatus (qmpFile ); err != nil || status != "running" {
806
+ if status , err := getQemuStatus (qmpFile ); err != nil || status != types . RUNNING {
807
807
return logError ("domain status is not running but %s after cont command returned %v" , status , err )
808
808
}
809
809
return nil
@@ -837,33 +837,13 @@ func (ctx kvmContext) Info(domainName string) (int, types.SwState, error) {
837
837
return effectiveDomainID , effectiveDomainState , err
838
838
}
839
839
840
- // if task us alive, we augment task status with finer grained details from qemu
841
- // lets parse the status according to https://github.com/qemu/qemu/blob/master/qapi/run-state.json#L8
842
- stateMap := map [string ]types.SwState {
843
- "finish-migrate" : types .PAUSED ,
844
- "inmigrate" : types .PAUSING ,
845
- "paused" : types .PAUSED ,
846
- "postmigrate" : types .PAUSED ,
847
- "prelaunch" : types .PAUSED ,
848
- "restore-vm" : types .PAUSED ,
849
- "running" : types .RUNNING ,
850
- "save-vm" : types .PAUSED ,
851
- "shutdown" : types .HALTING ,
852
- "suspended" : types .PAUSED ,
853
- "watchdog" : types .PAUSING ,
854
- "colo" : types .PAUSED ,
855
- "preconfig" : types .PAUSED ,
856
- }
857
- res , err := getQemuStatus (getQmpExecutorSocket (domainName ))
840
+ _ , err = getQemuStatus (getQmpExecutorSocket (domainName ))
858
841
if err != nil {
859
- return effectiveDomainID , types .BROKEN , logError ("couldn't retrieve status for domain %s: %v" , domainName , err )
842
+ return effectiveDomainID , types .BROKEN ,
843
+ logError ("couldn't retrieve status for domain %s: %v" , domainName , err )
860
844
}
861
845
862
- if effectiveDomainState , matched := stateMap [res ]; ! matched {
863
- return effectiveDomainID , types .BROKEN , logError ("domain %s reported to be in unexpected state %s" , domainName , res )
864
- } else {
865
- return effectiveDomainID , effectiveDomainState , nil
866
- }
846
+ return effectiveDomainID , effectiveDomainState , nil
867
847
}
868
848
869
849
func (ctx kvmContext ) Cleanup (domainName string ) error {
0 commit comments